The Most High never said such a thing but he said, “Apart from me you can do nothing.”
Now here are some code snippets as examples of the AppleScript Trigger plugin and some of the midi protocols. But I need to know how to use this syntax to code in tunings. I don’t fully understand how it is working.
tell application "MidiPipe"
activate
repeat with counter from 0 to 127
MIDISend toPort "MidiPipe AppleScript Input" withData {192, counter}
MIDISend toPort "MidiPipe AppleScript Input" withData {144, counter, 64, 144, 127 - counter, 64}
delay 0.1
MIDISend toPort "MidiPipe AppleScript Input" withData {128, counter, 0, 128, 127 - counter, 0}
end repeat
end tell
-- this script filters out all Note On messages on channel "fromChannel" to "toChannel" with a velocity value less than "minvelocity"
property fromChannel : 1
property toChannel : 6
property minvelocity : 17
on runme(message)
if ((item 1 of message ≥ (143 + fromChannel)) and (item 1 of message ≤ (143 + toChannel))) then
if (item 3 of message > 0) then
-- note on
if (item 3 of message ≥ minvelocity) then
return message
end if
else
-- note off
return message
end if
else
-- message on different channel
return message
end if
end runme
property channel : 1
property keymap : {{space, 0}, {"a", 0}, {"a", command down}, {"MidiPipe", 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
on runme(message)
if (item 1 of message = (143 + channel)) then
if (item 3 of message > 0) then
-- note on
tell application "TextEdit"
activate
end tell
tell application "System Events"
tell process "TextEdit"
keystroke item 1 of (item ((item 2 of message) + 1) of keymap) using item 2 of (item ((item 2 of message) + 1) of keymap)
end tell
end tell
end if
end if
end runme
-- this script transposes every note message on channel 1 up 12 keys if its on velocity is above 105
property channel : 1
property velocity : 105
property transpose : 12
property keydown : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
on runme(message)
if (item 1 of message = (143 + channel)) then
if (item 3 of message > 0) then
-- note on
if (item 3 of message > velocity) then
-- remember key
set item (item 2 of message) of keydown to 1
-- transpose
set item 2 of message to ((item 2 of message) + transpose)
else
-- safety for avoiding hanging notes
if (item (item 2 of message) of keydown) = 1 then
-- double note on (missing note off) -> transpose too
set item 2 of message to ((item 2 of message) + transpose)
end if
end if
return message
else
-- note off
noteoff(message)
return message
end if
else
if (item 1 of message = (127 + channel)) then
-- note off
noteoff(message)
return message
else
-- message on different channel
return message
end if
end if
end runme
on noteoff(message)
if (item (item 2 of message) of keydown) = 1 then
-- forget key
set item (item 2 of message) of keydown to 0
-- transpose
set item 2 of message to ((item 2 of message) + transpose)
end if
end noteoff
These are all examples of what can be done in the AppleScript Trigger plugin but I wouldn’t know how to follow this syntax to create tunings since there is no example of that I can find. But maybe someone here knows how to code in a tuning through this.
Here is a link to the protocols for the Midi Messages which are being used in these snippets:
https://www.midi.org/specifications-old/item/table-3-control-change-messages-data-bytes-2
I’m not sure how to connect the syntax of this AppleScript Trigger plugin with the RPN Tuning messages at the bottom and how it would actually work.
And this is a quick tutorial on the basics of Midi messages but again I don’t understand how it would work with this:
http://www.music-software-development.com/midi-tutorial.html