Play The Room – Third Class

Imagine this.  You sit before a humble, MIDI keyboard.  It looks like a truncated piano.  You can’t help but notice the colored wires spewing from a small box behind it to places scattered around the room.  The walls.  The ceiling.  You press down a key, and involuntarily clench as a clang from overhead rings out, as a solenoid’s core slams into the ventilation duct.  You hit the key again.

We at the Play the Room class are getting there, and quickly.  By the end of this week’s class, we had a fully functional proof of concept–a solenoid controlled by MIDI keyboard.  Check out the schematic.

A MIDI cable carries the performance information from the source, whether it is a computer sequencer (Ableton Live in the video below) or a keyboard, into the Arduino.  The software in the Arduino detects the incoming MIDI message, and sends a pulse of power to the solenoid, which then strikes whatever is before it.  The software in the Arduino must be able to filter out irrelevant MIDI information (there are many kinds of messages useless to us in this context), and as we add more solenoids to be controlled, the software must send a voltage pulse to the correct solenoid depending on the MIDI note that is received.  That is, when you hit different notes on the keyboard, it plays different solenoids.  Both of these goals are easily achieved in software.

Issues we will consider in future classes include the design of a robust mounting scheme and velocity control.  Ideally, the solenoids and their control mechanism will remain intact and usable for decades, or until our neighbors tire of the noise.  And if you were to hit the key on the keyboard softly (or strike it proudly with vigor), wouldn’t it be great if the solenoid responded with appropriate force?  To be continued…


Arduino Code (thank you Alden!)

byte incomingByte;

void setup () {
pinMode(11, OUTPUT);

void loop () {
if (Serial.available() > 0) {
incomingByte =;
if (incomingByte > 143 && incomingByte < 160) {
//note on
digitalWrite(11, HIGH);
} else if (incomingByte > 127 && incomingByte < 144) {
//note off
digitalWrite(11, LOW);


Leave a Reply

Your email address will not be published. Required fields are marked *