|
Post by alfredr on Apr 6, 2018 8:36:52 GMT
Hi Nic,
I need some help. On my ewi I have this contact button that now sends a continuous stream of cc 64. I want to convert this into a toggling cc 66, when cc 64 = 127 is reached.
Actualy I could do the toggling in my daw with pizmidi. But maybe you have some clever way
I am using streambyter in midifire.
Tia, Alfred
|
|
nic
Soapbox Supremo  
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Apr 6, 2018 9:05:15 GMT
Hi alfredr, This will do that: IF LOAD # K: CC+chan, CC64, CC66 ASS K0 = B0 40 42
# assume CC66 starts at off ASS L0 = 7F END
# check if CC64 is at 127 IF M0 == K0 K1 7F
# toggle CC 66 SND K0 K2 L0 IF L0 == 0 ASS L0 = 7F END IF L0 == 7F ASS L0 = 0 END ENDRegards, Nic.
|
|
|
Post by alfredr on Apr 6, 2018 9:21:35 GMT
Hi Nic,
It took me some time to comprehend what you did there. Wow streambyter 2 is advanced :-)
Thank you, Alfred
|
|
|
Post by alfredr on Apr 6, 2018 10:27:44 GMT
Hi Nic,
There was a little problem with the code. Only the first time it works. After that cc66 is always 0. I rewrote the toggling part like this:
IF L0 == 0 ASS L1 = 7F END IF L0 == 7F ASS L1 = 0 END ASS L0 = L1
|
|
nic
Soapbox Supremo  
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Apr 6, 2018 10:33:19 GMT
Good find! I've been bitten by that one many times before. Can't teach an old dog new tricks.
Edit: What I should have done to toggle is use the ^ (XOR) operator:
L0 = L0 ^ 7F
No need for IF clauses...
Regards, Nic.
|
|