Thomas Royal

Composer | Pianist | Technologist

Writings


Rapid Instrument Development with Raspberry Pi

May 09, 2014

Note that this writing details things that happened a year ago.

Rapid Instrument Development with the Raspberry Pi

Recently, I bought a Raspberry Pi to make musical instruments.

What makes the Raspberry Pi particularly promising for people interested in creating new digital musical instruments is that, unlike a laptop computer, it is very small. Further, unlike the Arduino, it is capable of running Linux, meaning it can output complex audio. This is especially true if one uses Satellite CCRMA, a distibution of linux created to allow the Raspberry Pi (and BeagleBoard) to run audio applications like Audacity and Pd. While it is not as easy to connect sensors to the Pi (due to the lack of a2d convertors) is is easy enough to connect an Arduino.

This is not bad for a device that costs around $40.

The advantage to using the Raspberry Pi over a combination of Arduino and laptop is that one is able to create instruments or interactions that are not limited by the form factor of the laptop or the limited synthesis capabilities of the Arduino.

A rapidly build Raspberry Pi instrument. (Only a few hours.)

To see what the Raspberry Pi was capable of, I decided to see how fast I could build an instrument.

I decided to make a triangular block that, when one moved their hand near one side of the of the block, a harp sound occurs. This harp sound modified by an echo effect. An led flashes each time a harp sound is heard.

First, I soldered together three short range infrared range finders to ribbon cable. I did the same for three LED's.

Picture of Ribbon Cable

Next, I attched these sensors and LED's to the Arduino's analog in and analog outs (respectively) via a bread board.

Picture of Circuit with Arduino, sensors, and LED's.

I then attached the Aruino to the Pi using a USB cable, pluged the Pi in to a wall outlet and plugged speakers into the Pi's mini audio plug. I then stuffed everything into a triangular block made out of cardboard. Here is a picture before I put the top on:

Instrument, interior view

And here it is with the top put on. What is compelling, to me, is that there is such a small form factor without the need to sacrifice ease of configurability an and advanced sound production capabilities:

Instrument, full view

If it looks a bit hacky, that is because this is a hack.

The End Result of My First Raspberry Pi Insturment

The video below shows the end result. It is difficult to see exactly what is going on here due to the poor camera work. However, I am happy with the harp sounds and with the fact that I don't need to attach a laptop to get them.

The Raspberry Pi creates many options for the fashioning of new digital music instruments. It will be interesting to see what happens when it gets adopted in a more widespread manner.