Project 2 Experiment 6 – MIDI and OSC

The sixth experiment revolved around making programs talk to each other. For the second Creation and Computation I want to use a MIDI keyboard controller (an Akai MPK Mini) to send messages to various softwares at the same time. I tried to connect the controller to the computer and opened two softwares to receive incoming midi messages, but only one software was able to receive it. As far as I know, the only way to have many softwares receiving midi messages from a single controller is by having a main program that sends those messages via a communication protocol.
After looking online for a communication protocol I could use, OSC seemed like the protocol of choice for music and midi applications. Max/MSP with its visual programming environment was chosen to be the main program from where midi messages would be spread to other softwares. Getting the MIDI data was pretty straightfoward, only a midiin and ctlin objects were needed to receive midi note numbers and velocity and the values received from the 8 knobs. Sending that data to other softwares via OSC was trickier. Tried to do what was suggested on the documentation and online forum posts but was having some dificulty until Hector showed me the correct way to write the OSC message. Then it was possible to estabilish OSC communication from Max/MSP to processing. Had to do a series of if statements on both Max and Processing to separate the values comming from each one of the 8 knobs. Max has objects to handle lists and that would help in this situation but I still haven’t used them and felt using a series of ifs would be easier at this point. Receiving OSC messages in ChucK involved a similar process. ChucK has native support for OSC and didn’t need a library as processing did. The final result had Max sending 8 knob values that range from 0 to 127 to Processing and midi note numbers to ChucK.