Skip to content

Instantly share code, notes, and snippets.

@hsitz
Last active April 8, 2020 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsitz/0bf046d646a6e38ba69212315eac7e29 to your computer and use it in GitHub Desktop.
Save hsitz/0bf046d646a6e38ba69212315eac7e29 to your computer and use it in GitHub Desktop.
save all midi note offs until last key's
@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