Troubleshooting
Change dinamically midi channel from Switches object
Started by ecce_cello on .
Sign in or create an account to join the conversation.
hallo,
how can i change channel out of "Switches1" object using a "Switches2" object? When "Switches2" is ON, "Switches1" outputs CC in channel 1, when "Switches2" is off, "Switches1" outputs CC in channel 2.
i hope this is easier and clearer, the other thread i wrote is just a mess (i had never tried to solve something in a forum, and had so many fail attempts and misunderstandings in a single post!).
one thousand thanks.
david
Switches Change Channel.jzml
how can i change channel out of "Switches1" object using a "Switches2" object? When "Switches2" is ON, "Switches1" outputs CC in channel 1, when "Switches2" is off, "Switches1" outputs CC in channel 2.
i hope this is easier and clearer, the other thread i wrote is just a mess (i had never tried to solve something in a forum, and had so many fail attempts and misunderstandings in a single post!).
one thousand thanks.
david
Switches Change Channel.jzml
If you look at the last example for the On/Off switch, you see the script where you make the midiout (ctlout(1,c,x*127,1)). The last "1" is the Midi Channel.
So, you can declare a variable called midichannel ("decl midichannel;") beforehan then make another "if clause" asking for the state of Switch3: if (Switch3.x==0) {midichannel=1;}else{midichannel=2;}.
Then you go ctlout(1,c,x*127,midichannel) so that the midiout channel is determined by the setting of Switch3.
So, you can declare a variable called midichannel ("decl midichannel;") beforehan then make another "if clause" asking for the state of Switch3: if (Switch3.x==0) {midichannel=1;}else{midichannel=2;}.
Then you go ctlout(1,c,x*127,midichannel) so that the midiout channel is determined by the setting of Switch3.