Interfaces 1 β MIDI
Interactive systems with MIDI in Processing
import themidibus.*; //Import the library that lets us talk to MIDI devices
MidiBus myBus; // Create a variable that will connect to our MIDI controller
void setup(){
size(400, 400); // Create a window that is 400 pixels wide and 400 pixels tall
MidiBus.list(); // Show all MIDI devices connected to the computer in the console
myBus = new MidiBus(this, "MIDI Mix", "MIDI Mix"); // Connect to a device called "MIDI Mix"
// The first "MIDI Mix" is for input (receiving messages)
// The second "MIDI Mix" is for output (sending messages)
}
void draw(){
background(255); // Fill the window with white color (255 means white)
// This happens 60 times per second to keep the window clear
}
void controllerChange(int channel, int number, int value) {
// This function runs automatically when you move a fader or dial on the MIDI controller
println("Fader/dial: channel "+channel+", number "+number+", value "+value);
// Print information about which control was moved and its new value
// channel = which group the control belongs to
// number = which specific fader or dial was moved
// value = position of the control (0-127, where 0 is all the way down/left and 127 is all the way up/right)
}
void noteOn(int channel, int pitch, int velocity) {
// This function runs automatically when you press a button on the MIDI controller
println("Button on: channel "+channel+", number "+pitch+", velocity "+velocity);
// Print information about which button was pressed
// pitch = which button was pressed
// velocity = how hard the button was pressed (usually 127 for full press)
}
void noteOff(int channel, int pitch, int velocity) {
// This function runs automatically when you release a button on the MIDI controller
println("Button off: channel "+channel+", number "+pitch+", velocity "+velocity);
// Print information about which button was released
}Passing MIDI on via OSC
Interactive systems with MIDI in TouchDesigner



Example: AV System


Last updated