Last active
April 8, 2020 18:39
-
-
Save hsitz/0bf046d646a6e38ba69212315eac7e29 to your computer and use it in GitHub Desktop.
save all midi note offs until last key's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OnLoad | |
counter = 0 | |
fillarray noteoffs, 20, 0 | |
fillarray channels, 20, 0 | |
suppressed = 0 | |
@END | |
@OnMidiNoteOn | |
inc counter | |
sendmidithru | |
@END | |
@OnMidiNoteOff | |
dec counter | |
if counter = 0 | |
if suppressed > 0 | |
cnt = 0 | |
while noteoffs[cnt] > 0 | |
chan = channels[cnt] | |
note = noteoffs[cnt] | |
sendmidinoteoff chan, note, 0 | |
inc cnt | |
endwhile | |
fillarray noteoffs, 20, 0 | |
fillarray channels, 20, 0 | |
suppressed = 0 | |
endif | |
sendmidithru | |
else | |
noteoffs[suppressed] = midibyte2 | |
channels[suppressed] = midibyte1 | |
inc suppressed | |
endif | |
@END | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment