Post by slmnv on Jul 28, 2019 15:19:37 GMT
This is a variation of boutique scene “Blue velvet” that is sending different messages from single button using double, triple pushes and long holds
I created this variation as original uses many channels to send midi events and I want this to use one channel.
I use it it to extend Irig blue board functionality. But more useful I found it to send commands from instrument to synth. I play guitar with software pitch to midi conversion and this scene is used to turn on/off different functions on the synth - delay, notes hold, change program ...
I created similar scene to monitor all notes but it is hard to use and configure.
So for simplicity here is code to monitor one note.
# For one MIDI note count consecutive on/off
# send on/off for note number = counter + offset
# on/off are counted if come no later than 250ms
# Еx . For a blue board button, offset=0
# if one push - sends note 1 with 250ms delay
# if two - 2, if three - 3
# for last long hold +5 is added
IF LOAD
ASS I0 = 1FF # timer limit to stop counting
ASS I1 = 00 00 # count on and off
ASS I3 = 9F 50 # MIDI note to catch
ASS I5 = 00 # offset added to counter
ASS IA = 98 # MIDI to send type and channel
END
8X = 9X XX 00
# detect timeout using injected sysex message
IF M0 == F0 1F 00 I1
MAT I6 = I5 + I2 # temp var
IF I1 != I2 # last down is without up
MAT I6 = I6 + 5
END
SND IA I6 7F
SND IA I6 00 +D100
ASS I1 = 0 0 # reset 2 counters
END
IF M0 == I3 I4 # expected note on
IF M2 != 0 # is down
MAT I1 = I1 + 1
SND F0 1F 00 I1 F7 +DI0 +I # inject sysex with delay
END
IF M2 == 0 # is up
IF I1 != 0 # count is going on
MAT I2 = I2 + 1
END
END
END
XX = XX +B