Learn creative coding writing simple programs

123. Controlling Processing using MidiBus, part 1

A MIDI controller allows us to change values by turning knobs, moving sliders or pressing buttons on a hardware device. This is a great way to explore visual effects without having to modify programs and re-start them multiple times.

In this episode we use the MidiBus library to receive Control Change messages from a MIDI device. Each message contains three numbers: the channel, which lets you distinguish between devices when you use more than one device, the number of the knob or slider (you probably want different things to happen depending on which knob or slider you touch), and the value, which indicates how much a knob is rotated, how far a slider is moved, or if a button is up or down.

In part 1 we do a simple program that draws either lines or circles depending on which knob we turn.

Tags: midi, controlchange, midibus, controller

Code editor

You can make changes to the code below. Then
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