Saturday, December 18, 2010

SEGA Master System Emulator Controlled Via Ableton MIDI

As a follow up to a previous post, I decided to try and control a SEGA Master System emulator via virtual keystrokes triggered by MIDI notes in Ableton Live.

Here is the AppleScript trigger code for this set up:

on runme(message)

if (item 1 of message = 144) and (item 2 of message = 60) and (item 3 of message > 0) then
tell application "System Events"
key down "w"
delay 0.05
key up "w"
end tell

else if (item 1 of message = 144) and (item 2 of message = 62) and (item 3 of message > 0) then
tell application "System Events"
key down "s"
delay 0.05
key up "s"
end tell

else if (item 1 of message = 144) and (item 2 of message = 64) and (item 3 of message > 0) then
tell application "System Events"
key down "a"
delay 0.05
key up "a"
end tell

else if (item 1 of message = 144) and (item 2 of message = 65) and (item 3 of message > 0) then
tell application "System Events"
key down "d"
delay 0.05
key up "d"
end tell

else if (item 1 of message = 144) and (item 2 of message = 67) and (item 3 of message > 0) then
tell application "System Events"
key down "k"
delay 0.05
key up "k"
end tell

else if (item 1 of message = 144) and (item 2 of message = 69) and (item 3 of message > 0) then
tell application "System Events"
key down "l"
delay 0.05
key up "l"
end tell

end if
end runme







1 comments:

www.camobel.org said...

In my opinion everyone must browse on this.