Quantcast

Is there a way to dynamically rename signals?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is there a way to dynamically rename signals?

chronopolis
I have this in a goto loop

a1, a2 diskgrain Sfilename, kenv, kfreq, kpitch, kgrsize, kstr, 1, iolaps

Is there a way to dynamically change a1 and a2 per pass? Like a(index), a(index+1)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

rorywalsh
You could just use an array? Or? 

On 4 April 2017 at 20:04, chronopolis <[hidden email]> wrote:
I have this in a goto loop

a1, a2 diskgrain Sfilename, kenv, kfreq, kpitch, kgrsize, kstr, 1, iolaps

Is there a way to dynamically change a1 and a2 per pass? Like a(index),
a(index+1)




--
View this message in context: http://csound.1045644.n5.nabble.com/Is-there-a-way-to-dynamically-rename-signals-tp5755489.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

chronopolis
Thanks Rory,

I figured out a workaround.

One other question: Is it possible to control 2 instruments with a single MIDI channel? I tried Massign but it seems it can only be mapped to a single destination. Basically, I have a synth and then an effect in another instrument and I want them both to be polyphonic on the same MIDI channel.

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

rorywalsh
Good question. I've never figured this out myself. Maybe someone with a little more MIDI experience can help out. 

On 5 April 2017 at 19:56, chronopolis <[hidden email]> wrote:
Thanks Rory,

I figured out a workaround.

One other question: Is it possible to control 2 instruments with a single
MIDI channel? I tried Massign but it seems it can only be mapped to a single
destination. Basically, I have a synth and then an effect in another
instrument and I want them both to be polyphonic on the same MIDI channel.

Thanks.



--
View this message in context: http://csound.1045644.n5.nabble.com/Is-there-a-way-to-dynamically-rename-signals-tp5755489p5755521.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

Bernt Isak Wærstad
You need to use one instrument to receive notes on the wanted channel and then trigger (you can use the event opcode) all the synths you want from that instrument sending midi nn and amp to the instruments using p-fields.

It has annoyed me before that I couldn't just write
massign 1,3
massign 1,4
massign 1,10 
etc.

I vaguely remember there being a good reason for this, though I cannot recall what it was

On 5 April 2017 at 21:50, Rory Walsh <[hidden email]> wrote:
Good question. I've never figured this out myself. Maybe someone with a little more MIDI experience can help out. 

On 5 April 2017 at 19:56, chronopolis <[hidden email]> wrote:
Thanks Rory,

I figured out a workaround.

One other question: Is it possible to control 2 instruments with a single
MIDI channel? I tried Massign but it seems it can only be mapped to a single
destination. Basically, I have a synth and then an effect in another
instrument and I want them both to be polyphonic on the same MIDI channel.

Thanks.



--
View this message in context: http://csound.1045644.n5.nabble.com/Is-there-a-way-to-dynamically-rename-signals-tp5755489p5755521.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Mvh.

Bernt Isak Wærstad


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

Iain McCurdy

Or you can use subinstr. Sub-instruments will mirror the on and off behaviour of the instrument triggered by MIDI.


instr 1

icps cpsmidi

a1 poscil 0.2, icps

a3,a4 subinstr 2, icps

outs a1+a3,a1+a4

endin


instr 2

a1 poscil 0.2,p4*1.5

outs a1,a1

endin







From: A discussion list for users of Csound <[hidden email]> on behalf of Bernt Isak Wærstad <[hidden email]>
Sent: 05 April 2017 20:15
To: [hidden email]
Subject: Re: [Csnd] Is there a way to dynamically rename signals?
 
You need to use one instrument to receive notes on the wanted channel and then trigger (you can use the event opcode) all the synths you want from that instrument sending midi nn and amp to the instruments using p-fields.

It has annoyed me before that I couldn't just write
massign 1,3
massign 1,4
massign 1,10 
etc.

I vaguely remember there being a good reason for this, though I cannot recall what it was

On 5 April 2017 at 21:50, Rory Walsh <[hidden email]> wrote:
Good question. I've never figured this out myself. Maybe someone with a little more MIDI experience can help out. 

On 5 April 2017 at 19:56, chronopolis <[hidden email]> wrote:
Thanks Rory,

I figured out a workaround.

One other question: Is it possible to control 2 instruments with a single
MIDI channel? I tried Massign but it seems it can only be mapped to a single
destination. Basically, I have a synth and then an effect in another
instrument and I want them both to be polyphonic on the same MIDI channel.

Thanks.



--
View this message in context: http://csound.1045644.n5.nabble.com/Is-there-a-way-to-dynamically-rename-signals-tp5755489p5755521.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Mvh.

Bernt Isak Wærstad


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

rorywalsh
subinstr, that's the one. In this way you don't have to worry about turning off a note. 

On 5 April 2017 at 21:42, Iain McCurdy <[hidden email]> wrote:

Or you can use subinstr. Sub-instruments will mirror the on and off behaviour of the instrument triggered by MIDI.


instr 1

icps cpsmidi

a1 poscil 0.2, icps

a3,a4 subinstr 2, icps

outs a1+a3,a1+a4

endin


instr 2

a1 poscil 0.2,p4*1.5

outs a1,a1

endin







From: A discussion list for users of Csound <[hidden email]> on behalf of Bernt Isak Wærstad <[hidden email]>
Sent: 05 April 2017 20:15
To: [hidden email]
Subject: Re: [Csnd] Is there a way to dynamically rename signals?
 
You need to use one instrument to receive notes on the wanted channel and then trigger (you can use the event opcode) all the synths you want from that instrument sending midi nn and amp to the instruments using p-fields.

It has annoyed me before that I couldn't just write
massign 1,3
massign 1,4
massign 1,10 
etc.

I vaguely remember there being a good reason for this, though I cannot recall what it was

On 5 April 2017 at 21:50, Rory Walsh <[hidden email]> wrote:
Good question. I've never figured this out myself. Maybe someone with a little more MIDI experience can help out. 

On 5 April 2017 at 19:56, chronopolis <[hidden email]> wrote:
Thanks Rory,

I figured out a workaround.

One other question: Is it possible to control 2 instruments with a single
MIDI channel? I tried Massign but it seems it can only be mapped to a single
destination. Basically, I have a synth and then an effect in another
instrument and I want them both to be polyphonic on the same MIDI channel.

Thanks.



--
View this message in context: http://csound.1045644.n5.nabble.com/Is-there-a-way-to-dynamically-rename-signals-tp5755489p5755521.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Mvh.

Bernt Isak Wærstad


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

Bernt Isak Wærstad
Oh yes! That's a much neater way :)

On 5 April 2017 at 22:59, Rory Walsh <[hidden email]> wrote:
subinstr, that's the one. In this way you don't have to worry about turning off a note. 

On 5 April 2017 at 21:42, Iain McCurdy <[hidden email]> wrote:

Or you can use subinstr. Sub-instruments will mirror the on and off behaviour of the instrument triggered by MIDI.


instr 1

icps cpsmidi

a1 poscil 0.2, icps

a3,a4 subinstr 2, icps

outs a1+a3,a1+a4

endin


instr 2

a1 poscil 0.2,p4*1.5

outs a1,a1

endin







From: A discussion list for users of Csound <[hidden email]> on behalf of Bernt Isak Wærstad <[hidden email]>
Sent: 05 April 2017 20:15
To: [hidden email]
Subject: Re: [Csnd] Is there a way to dynamically rename signals?
 
You need to use one instrument to receive notes on the wanted channel and then trigger (you can use the event opcode) all the synths you want from that instrument sending midi nn and amp to the instruments using p-fields.

It has annoyed me before that I couldn't just write
massign 1,3
massign 1,4
massign 1,10 
etc.

I vaguely remember there being a good reason for this, though I cannot recall what it was

On 5 April 2017 at 21:50, Rory Walsh <[hidden email]> wrote:
Good question. I've never figured this out myself. Maybe someone with a little more MIDI experience can help out. 

On 5 April 2017 at 19:56, chronopolis <[hidden email]> wrote:
Thanks Rory,

I figured out a workaround.

One other question: Is it possible to control 2 instruments with a single
MIDI channel? I tried Massign but it seems it can only be mapped to a single
destination. Basically, I have a synth and then an effect in another
instrument and I want them both to be polyphonic on the same MIDI channel.

Thanks.



--
View this message in context: http://csound.1045644.n5.nabble.com/Is-there-a-way-to-dynamically-rename-signals-tp5755489p5755521.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Mvh.

Bernt Isak Wærstad


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Mvh.

Bernt Isak Wærstad


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

chronopolis
This post was updated on .
Thanks guys.

Still having some trouble with this method though. When I combine the instruments into a single instrument I get the result I want but I want to keep things modular. I deleted the irrelevant code below (variables and such).

Each new note cuts the previous sound going through instrument 2 but I want it to be polyphonic. Instr 1 is polyphonic if I don't send the signal to instr 2.  Each time a new note is triggered it creates a new gSchannelName to send to instrument 2. Perhaps the channel sends are stopping each time?

instr 1

iNoteNum notnum

;; deleted all of the diskgrain params for the example

                a1, a2 diskgrain Sfilename, kenv, kfreq, kpitch, kgrsize, kstr, 1, iolaps
                                       
               
                gSchannelName1 = "" ;;;reset global channel name
                gSchannelName2 = ""
       
                gSchannelName1 strcat Sfilename, "_l"
                gSchannelName2 strcat Sfilename, "_r"
               
    chnset a1, gSchannelName1
    chnset a2, gSchannelName2
   
         aDelayL, aDelayR subinstr "pitchDelay"
         
         outs aDelayL, aDelayR
               
endin

instr pitchDelay, 2

        ain1 chnget gSchannelName1
        ain2 chnget gSchannelName2
        ;;;Deleted a bunch of vars here for example's sake.
        delayw    ain1 + (atapL * kfeedback)
        delayw    ain2 + (atapR * kfeedback)

        outs atapL, atapR

endin

instr 100; clear
          chnclear   gSchannelName1
          chnclear   gSchannelName2
  endin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

Steven Yi
Try using chnmix instead of chnset.
(http://csound.github.io/docs/manual/chnmix.html)

On Thu, Apr 6, 2017 at 4:11 PM, chronopolis <[hidden email]> wrote:

> Thanks guys.
>
> Still having some trouble with this method though. When I combine the
> instruments into a single instrument I get the result I want but I want to
> keep things modular. I deleted the irrelevant code below (variables and
> such). Each new note cuts out the previous sound processing through the
> instrument 2 delay. I want it to be polyphonic. Perhaps because I'm using
> channel sends? Each time a new note is triggered it creates a new
> gSchannelName to send to instrument 2.
>
> instr 1
>
> iNoteNum notnum
>
> ;; deleted all of the diskgrain params for the example
>
>                 a1, a2 diskgrain Sfilename, kenv, kfreq, kpitch, kgrsize, kstr, 1, iolaps
>
>
>                 gSchannelName1 = ""                     ;;;reset global channel name
>                 gSchannelName2 = ""
>
>                 gSchannelName1 strcat Sfilename, "_l"
>                 gSchannelName2 strcat Sfilename, "_r"
>
>                 chnset a1, gSchannelName1
>                 chnset a2, gSchannelName2
>
>          aDelayL, aDelayR subinstr "pitchDelay"
>
>          outs aDelayL, aDelayR
>
> endin
>
> instr pitchDelay, 2
>
>         ain1 chnget gSchannelName1
>         ain2 chnget gSchannelName2
>         ;;;Deleted a bunch of vars here for example's sake.
>         delayw    ain1 + (atapL * kfeedback)
>         delayw    ain2 + (atapR * kfeedback)
>
>         outs atapL, atapR
>
> endin
>
> instr 100; clear
>           chnclear   gSchannelName1
>           chnclear   gSchannelName2
>   endin
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Is-there-a-way-to-dynamically-rename-signals-tp5755489p5755538.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Is there a way to dynamically rename signals?

chronopolis
Thanks Steven - that did the trick!
Loading...