Last active
March 7, 2023 01:59
-
-
Save benschmaus/022808b63a0c44077d15e8c76f60ffaa to your computer and use it in GitHub Desktop.
How NoteInputs, filter masks, and onMidi callbacks work in Bitwig controller scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadAPI(1); | |
host.defineController("Script Lab", "NoteInput Testing", "1.0", "d5a765f7-647a-488e-938f-dcb653742457"); | |
host.defineMidiPorts(1, 0); | |
var input; | |
function init() | |
{ | |
var mi = host.getMidiInPort(0); | |
mi.setMidiCallback(onMidi); | |
// MIDI input with default MIDI message filter | |
input = mi.createNoteInput(""); | |
println("initialized"); | |
} | |
function onMidi(status, data1, data2) | |
{ | |
var command = status & 0xf0; | |
var channel = (status & 0x0f) + 1; | |
println("channel=" + channel + ", command=" + command + ", data1=" + data1 + ", data2=" + data2); | |
} | |
function exit() { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment