|
Post by mo13 on Sept 13, 2021 8:06:18 GMT
! just recently got streambyter and got the basics running, just can't figure out how to only pass one note on one channel and block everything else, I have a device that sends out notes on all 16 channels and I want only C-1 to come through on Ch.10 and block all other notes+channels. Thanks for this super tool and help would be much appriciated!
|
|
nic
Soapbox Supremo  
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 13, 2021 15:50:34 GMT
Hi mo13 , To filter out everything except one note in Stream Byter it is probably easier to block everything and clone what you want. Compact way: N9 0C = XX +C # clone C-1 on channel 10 XX = XX +B # block everything elseMore verbose way if MT < A0 # is it a note? if MC == 9 # is it on channel 10? if M1 == ^C-1 # is it C-1? send M0 M1 M2 # clone it end end end block # block everythingRegards, Nic.
|
|
|
Post by mo13 on Sept 13, 2021 16:22:43 GMT
ah so that's what clone does, thanks Nic very helpful!
|
|
|
Post by mo13 on Sept 16, 2021 17:24:56 GMT
hey Nic,
I have another one if I may, I'm trying to map CC127 to act as a toggle switch to turn on/off a channel in Apematrix, would it be possible to do that from a single CC? Apematrix responds to value 0 = off 1 = on, I tried cloning and putting a delay on one of the values but without luck and that possibly being a wrong approach.. would be glad to know if something like this is possible at all!
|
|
nic
Soapbox Supremo  
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 17, 2021 19:50:57 GMT
Hi mo13 , To change a CC to a toggle, you need to trap when the CC goes ON and alternate between rewriting to ON and OFF each time. This code will do it: if load # CC channel + number to toggle assign K0 = B0 $127 # toggle flag (ON to start) assign L0 = 7F end
# trap toggle CC if M0 = K0 K1 if M2 == 7F # send toggle version of CC if ON send K0 K1 L0 calc L0 = L0 ^ 7F end block end
Regards, Nic.
|
|
|
Post by mo13 on Sept 18, 2021 11:16:43 GMT
[SOLVED] ![]()
|
|
|
Post by uncledave on Nov 15, 2021 18:58:25 GMT
hey Nic, I have another one if I may, I'm trying to map CC127 to act as a toggle switch to turn on/off a channel in Apematrix, would it be possible to do that from a single CC? Apematrix responds to value 0 = off 1 = on, I tried cloning and putting a delay on one of the values but without luck and that possibly being a wrong approach.. would be glad to know if something like this is possible at all! I'd just like to point out that the last 8 CC#s (120-127) are special Channel Mode commands with pre-defined meanings. They're meant to control the way the channel works. CC 127 turns out to be Poly Mode On. So it would be better to avoid them, in case some component grabs them instead of passing them on as normal CCs. Just sayin'.
|
|
|
Post by mo13 on Jan 4, 2022 11:14:00 GMT
thanks for pointing that out uncledave, is it possible to adjust this script so it traps all incoming CC's on Ch.3 to ON/OFF ? XX didn't work for me and probably for obvious reasons.. if load # CC channel + number to toggle assign K0 = B2 $127 # toggle flag (ON to start) assign L0 = 7 end # trap toggle CC if M0 = K0 K1 if M2 == 7F # send toggle version of CC if ON send K0 K1 L0 calc L0 = L0 ^ 7F end block end
|
|
|
Post by uncledave on Jan 4, 2022 13:47:01 GMT
This should do the trick:
#ToggleCCs
If load Alias 77 maxCC # higher CCs are channel controls
# toggle memories, initialized to OFF. # +P means they are saved with any host preset. Ass L00 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L10 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L20 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L30 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L40 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L50 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L60 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L70 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L80 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L90 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LA0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LB0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LC0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LD0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LE0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LF0 = 0 0 0 0 0 0 0 0 +P End # Initialization ———————————————————————————
# process all CC on ch. 3. Message ch. is one less. If M0 == B2 If M1 <= maxCC # only modify valid CC If M2 == 7F # process button press Mat LM1 = LM1 ^ 7F # toggle saved value Ass M2 = LM1 # replace message value Else Block # ignore release End End End
|
|
|
Post by mo13 on Jan 4, 2022 14:17:31 GMT
that's great! I am using these for midi controller LED feedback, just switched to another software and realised that this one also accepts Note ON/OFF from the controller (which only sends 127 CC's out) would it make more sense to convert the full CC range to note ON/OFF then ? assuming that way it will not intrefere with CC 120-127 anymore?
|
|
|
Post by uncledave on Jan 4, 2022 15:23:07 GMT
that's great! I am using these for midi controller LED feedback, just switched to another software and realised that this one also accepts Note ON/OFF from the controller (which only sends 127 CC's out) would it make more sense to convert the full CC range to note ON/OFF then ? assuming that way it will not intrefere with CC 120-127 anymore? Of course. Make sure you expand the initialization of LF0 to 16 zeros, and change maxCC to 7F.
|
|
|
Post by mo13 on Jan 4, 2022 17:42:36 GMT
thanks, I'm almost there I think, getting no errors but no notes are coming through with this edit :
If load Alias 77 7F #
Ass L00 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L10 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L20 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L30 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L40 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L50 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L60 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L70 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L80 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass L90 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LA0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LB0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LC0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LD0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LE0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P Ass LF0 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +P End #
If M0 == B2 If M1 <= 7F If M2 == 7F Mat LM1 = LM1 ^ 7F Ass M2 = LM1 Else Block # End End End
a last correction on this would be much apprciated!
|
|
|
Post by uncledave on Jan 4, 2022 18:06:46 GMT
You're still passing the message through as a CC. If I understand correctly, you want a CC ON value on MIDI channel 3 to toggle the saved value, and transmit Note On if the value is set, and Note Off if the value is clear. The output channel is 3 and the note number matches the CC#. This ought to work:
If M0 == B2 If M1 <= 7F If M2 == 7F Mat LM1 = LM1 ^ 7F Ass M2 = LM1 If M2 == 7F Ass M0 = 92 Else Ass M0 = 82 End Else Block End End End Leave the initialization unchanged and replace the logic block with this. Just for reference, M0 holds the message type and channel, M1 holds the CC# or note #, M2 holds the CC value or note velocity. The interpretations of M1 and M2 depend on the message type. When we use LM1, we're accessing position number M1 in the L data array. This is called an indexed or indirect array reference in other languages. It lets us remember the state of all 127 toggles, and easily select the one corresponding to the CC#. And by the way, each message enters SB, is broken up into the M array, we modify the values in M, and SB sends it on. SB does all this automatically, so all we need to provide is the logic to modify the values.
|
|
|
Post by mo13 on Jan 4, 2022 18:39:19 GMT
hats off once more uncledave  still miles away here but picking up alot from the explanations!
|
|
|
Post by uncledave on Jan 4, 2022 19:08:23 GMT
hats off once more uncledave  still miles away here but picking up alot from the explanations! Hah! Just trying to clarify. There's really no magic in this. It's fundamentally very simple. Cheers.
|
|