|
Post by lukesleepwalker on Jan 19, 2019 18:27:56 GMT
Is there an easy way to send PC previous and next messages to a synth?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 21, 2019 9:05:53 GMT
Hi lukesleepwalker , This code will use program change/chan1 0 as previous and program change/chan1 1 as next: IF LOAD # prev/next trigger ASS K0 = C0 00 01
# current pc number ASS L0 = 0 END
# handle prev trigger IF M0 == K0 K1 # cycle prev MAT L0 = L0 - 1 IF L0 > 7F ASS L0 = 7F END
# send prev & block trigger SND K0 L0 XX = XX +B END
# handle next trigger IF M0 == K0 K2 # cycle next MAT L0 = L0 + 1 IF L0 > 7F ASS L0 = 0 END
# send next + block trigger SND K0 L0 XX = XX +B ENDRegards, Nic.
|
|
|
Post by lukesleepwalker on Jan 21, 2019 21:28:34 GMT
Wunderbar, it is a thing of beauty, Nic. I am pasting a new version below because you missed one commenting symbol that causes an error. I also added in a couple of CC inputs at the top (that get converted to PC messages). I suspect others will have this use case too so I am making it plug n play with this version.
#converts CC27 to PC0, Ch1 IF M0 == B0 1B IF M2 > 0 SND C0 1 END END
#converts CC28 to PC1, Ch1 IF M0 == B0 1C IF M2 > 0 SND C0 0 END END
# next section starts the prev/next PC messages IF LOAD # prev/next trigger ASS K0 = C0 00 01
# current pc number ASS L0 = 0 END
# handle prev trigger IF M0 == K0 K1 # cycle prev MAT L0 = L0 - 1 IF L0 > 7F ASS L0 = 7F END
# send prev & block trigger SND K0 L0 XX = XX +B END
# handle next trigger IF M0 == K0 K2 # cycle next MAT L0 = L0 + 1 IF L0 > 7F ASS L0 = 0 END
# send next + block trigger SND K0 L0 XX = XX +B END
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 21, 2019 21:36:55 GMT
Hi lukesleepwalker , Good find on the missing '#' - obviously I did that on purpose just to test you. ;-) (have fixed in my code) Are you sure in your top rewrite rules that you shouldn't be using an ASS command rather than a SND? SND C0 1to ASS M0 = C0 01I presume you want to trigger the next/prev using those CC's? Regards, Nic.
|
|
|
Post by lukesleepwalker on Jan 23, 2019 0:44:49 GMT
Yessir. Thanks for the good catch.
|
|
|
Post by razmataz on May 4, 2019 22:24:58 GMT
Hi , My first code I edit. I'm trying to use your code unsuccesfully.
only CC 58 work. CC59 change to 000
what was i doing wrong?
Stream byte -PC up down 2
#converts CC58 to PC0, Ch1
IF M0 == B0 3A
IF M2 > 0
ASS M0 = C0 01
END
END
#converts CC59 to PC1, Ch1
IF M0 == B0 3B
IF M2 > 0
SND C0 0
END
END
# next section starts the prev/next PC messages
IF LOAD
# prev/next trigger
ASS K0 = C0 00 01
# current pc number
ASS L0 = 0
END
# handle prev trigger
IF M0 == K0 K1
# cycle prev
MAT L0 = L0 - 1
IF L0 > 7F
ASS L0 = 7F
END
# send prev & block trigger
SND K0 L0
XX = XX +B
END
# handle next trigger
IF M0 == K0 K2
# cycle next
MAT L0 = L0 + 1
IF L0 > 7F
ASS L0 = 0
END
# send next + block trigger
SND K0 L0
XX = XX +B
END
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on May 5, 2019 8:59:22 GMT
Hi razmataz , Yes, you need to change this: SND C0 0to: ASS M0 = C0 00Regards, Nic.
|
|