Learn creative coding writing simple programs

101. Control Processing using a MIDI controller

This time we learn no new programming concepts, but find out how to install a MIDI library in Processing to be able to control program parameters using an external hardware device. MIDI controllers are often used together with music programs to do things like changing volumes or effect amount. But they are a great tool for experimenting with your programs, because they allow you to change numbers without having to restart your program. You just turn a knob or move a slider and see the graphics change.
Unfortunately in this episode you won't see anything moving since the library does not work with my setup. But don't worry, in the next episode we will try another approach which works fine.
The basic usage of the promidi library is quite simple. You import the library, declare a variable that will hold your MIDI connection and use getInstance() to start the MIDI connection. Next you add one or more calls to plug(). This will tell Processing that certain functions must be executed every time a MIDI message arrives. Then you have to decide what do you want to do with the numbers you receive: you can move or create objecs, change colors or other properties, etc.

Tags: midi, promidi, controller

Code editor

You can make changes to the code below. Then
Reference
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus