Skip to content

Instantly share code, notes, and snippets.

@JavascriptMick
Created January 7, 2023 13:15
Show Gist options
  • Save JavascriptMick/b0ed0e8947dd28551eeace650b2d653c to your computer and use it in GitHub Desktop.
Save JavascriptMick/b0ed0e8947dd28551eeace650b2d653c to your computer and use it in GitHub Desktop.
MidiPipe Apple script for fixing problematic 'All Notes Off' midi signals from older keyboards
— My Keyboard was 'enveloping' each Note On message with an 'All Notes Off' message
— This resulted in shitty results, especially chords which were morphed into single notes
— This Script ignores the initial 'All Notes Off' message and morphs the second one into an appropriate 'Note Up' message
property noteonchannel : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
on runme(message)
if (item 2 of message = 123) then — All Notes Off
copy ((item 1 of message) - 175) to channel
if (item channel of noteonchannel > 0) then
set item 1 of message to (127 + channel)
set item 2 of message to (item channel of noteonchannel)
set item 3 of message to 0
set item channel of noteonchannel to 0
return message
end if
else if (item 1 of message >=143 and item 1 of message <= 159) then — Note On
set item ((item 1 of message) - 143) of noteonchannel to (item 2 of message) —save off the key pressed
return message
else
return message
end if
end runme
@JavascriptMick
Copy link
Author

@JavascriptMick
Copy link
Author

Screen Shot 2023-05-17 at 7 47 46 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment