I figured it out. The following version let's me toggle the Arpeggiator on/off.
Changing to a different performance can put the value in L0 out of synch with the MODX, but that is no big deal .. I just need to remember to press the pedal a couple of times before starting to play the song so that StreamByter and the MODX are both back in synch.
# start/stop Arpegiator if M0 == B0 $30 $127 if L0 == 0 # Stop Arpeggiator Send F0 43 10 7F 1C 07 30 47 03 00 F7 ass L0 = 1 block exit end
You beat me to it. You need to keep track of the current state (which you are now doing using L0) to do a toggle.
If the process of switching to another performance (I assume in the softstep) generates a MIDI message, you could wait for that message and reset L0 to sync?
I would probably write the code differently, but if your code works then I would not suggest you change anything - what you are doing is functional and not going to be any performance issues, so not worth losing sleep over.