|
Post by lukesleepwalker on Jan 15, 2019 20:24:46 GMT
Hi there, I have successfully converted incoming notes to program changes that can be used to remotely control Stream Byter modules by using IF/SND with +I attached. I tried to do the same with an IF statement that contains a CC number, but it doesn't seem to be working. What is the correct syntax for the M0== statement that will convert CC 26 (any value above 0) to a PC?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 15, 2019 20:45:10 GMT
Hi lukesleepwalker Something like this (assumes CC and PC on channel 1) IF M0 == B0 1A IF M2 > 0 SND C0 12 +I END ENDRegards, Nic.
|
|
|
Post by lukesleepwalker on Jan 15, 2019 21:55:54 GMT
The good news is that I had it right (I must be learning how this all works!); the bad news is that I had the hex value wrong. Thanks for setting me straight.
|
|
|
Post by lukesleepwalker on Jan 31, 2019 19:30:18 GMT
Anyone know how to make this work with a note instead of a CC? So, I tried this as an example:
IF M0 == 90 2D IF M2 > 0 SND CF 10 +I END END
And it doesn't work. Help a brotha out?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 31, 2019 21:16:30 GMT
Hi lukesleepwalker, Maybe your A1 is not hex 2D? Try tapping A an octave above or below. Code looks right to me. Regards, Nic.
|
|
|
Post by lukesleepwalker on Feb 1, 2019 3:59:56 GMT
Ah yes, should have checked the octaves. Thanks.
A new puzzle that I am working on involving multiple controllers sending notes that I want to create conditional states for. So let’s make the “filter” notes F2, G2, A2, B2. Every time I press A2, I then press C1 and it ischanged to C5. Every time I press G2, I want C1 to be played as D5. Every time I press B2, I want C1 to be changed to E5. And I press F2, C1 becomes F5.
For the same four filter notes I want D1 to be transformed as such: press A2 — D1 becomes C6 press G2 — D1 becomes D6 press B2 — D1 becomes E6 press F2 — D1 becomes F6
Easiest way to accomplish?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 4, 2019 15:05:13 GMT
Hi lukesleepwalker , Sorry for only joining the party at this late stage. I have a feeling that you have already gotten this working? If not, let me know and I can share some code snippets. Regards, Nic.
|
|
|
Post by lukesleepwalker on Feb 4, 2019 16:15:08 GMT
Hi nic, Actually, I have had a few suggestions but no good direction has been established. If you could share a couple of code snippets to get me rolling, it'd be great! Thanks.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 5, 2019 9:46:41 GMT
Hi lukesleepwalker , OK, so let's break this down: First, let's setup some data at the top. We will store the current state (a number from 1 to 4 which changes depending upon which trigger note was last pressed) and also a little lookup table of note numbers to state numbers for the 4 trigger notes: IF LOAD ASS L0 = 1 # default state 1 ASS K39 = 1 # A2 is state 1 ASS K37 = 2 # G2 is state 2 ASS K3B = 3 # B2 is state 3 ASS K35 = 4 # F2 is state 4 END
Now, we handle when one of your trigger notes comes in: # handle triggers # is it note on? 9X XX 00 = 8X IF MT == 90
# is it one of our trigger notes? IF KM1 != 0
# yes, so set the state ASS L0 = KM1
END END
At this stage L0 will contain a number from 1 to 4 that indicates which of the 4 states we are in. Finally, you just need to put in your mappings for each of the 4 states: # A2 (state 1) IF L0 == 1 NX 26 = XX 60 # map D1 to C6 END
# G2 (state 2) IF L0 == 2 NX 26 = XX 62 # map D1 to D6 END
# B2 (state 2) IF L0 == 3 NX 26 = XX 64 # map D1 to E6 END
# F2 (state 4) IF L0 == 4 NX 26 = XX 65 # map D1 to F6 END
That's pretty well it. Be aware that I am using this note to hex table to map the notes. This assumes note 0 is C-2 and note 127 is G8. If your idea of A2, G2, F2, B2 and so on is different from this then you'll need different hex codes for the notes throughout the script. You can add as many mappings inside each IF L0 == X clause as you like of course. Regards, Nic.
|
|
|
Post by lukesleepwalker on Feb 5, 2019 21:56:15 GMT
Haven't tried it yet, but I read it over and it all make sense. Thanks for pointing me in the right direction.
|
|
|
Post by lukesleepwalker on Feb 7, 2019 3:37:43 GMT
I did some work to modify your code snippets and it works like a charm, Nic. I can do things with SB that I never dreamed possible--I hatch these crazy ideas and you help me make them real. Thank you!
|
|