Skip to content

Instantly share code, notes, and snippets.

@mu-lippy
mu-lippy / midipipe-youtube-midi-control-advanced-with-seek.applescript
Created February 2, 2018 04:42 — forked from nbogie/midipipe-youtube-midi-control-advanced-with-seek.applescript
Applescript (for Midipipe) to control playback of youtube, vimeo, netflix, etc (in chrome), via MIDI device. Allows control of playback position, volume, playback speed, as well as play/pause, from midi messages.
#returns true if the message represents a positive change of
# the given controller number, as will happen when depressing buttons a midi keyb.
# We ignore messages with value bytes 0, as those are sent on button releases.
on isMidiButtonPressed(msg, controllerNumber)
return (isControlChange(msg, controllerNumber) and (item 3 of msg > 0))
end isMidiButtonPressed
on isControlChange(msg, controllerNumber)
return ((item 1 of msg = 191) and (item 2 of msg = controllerNumber))
end isControlChange