Skip to content

Instantly share code, notes, and snippets.

@jhorology
Last active August 29, 2015 14:17
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 jhorology/11c57f245de6cf4e7364 to your computer and use it in GitHub Desktop.
Save jhorology/11c57f245de6cf4e7364 to your computer and use it in GitHub Desktop.
Bitwig Controller script for my Yamaha P-120
loadAPI(1);
host.defineController("Yamaha", "P-120", "1.0", "E1F63546-558B-4744-825F-3D197386C344");
host.defineMidiPorts(1, 1);
host.addDeviceNameBasedDiscoveryPair(["Scarlett 6i6 USB"], ["Scarlett 6i6 USB"]);
function init() {
// using only note on/off & dumper pedal
var midiIn = host.getMidiInPort(0),
noteInput = midiIn.createNoteInput("Yamaha P-120", "8?????", "9?????", "B?40??");
noteInput.setShouldConsumeEvents(true);
// midiIn.setMidiCallback(onMidi);
// midiIn.setSysexCallback(onSysex);
// stop MIDI clock
sendSysex("F0 43 73 75 03 F7");
}
function onMidi(sts, d1, d2) {
printMidi(sts, d1, d2);
}
function onSysex(data) {
}
function flush() {
}
function exit() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment