Your Raspberry Pi makes a superb media center. It can go to into orbit. You might even have used it to develop some music based projects in the past. After all, it’s the perfect size, and has ideal connectivity, to stream music to, and output through a loudspeaker.
But have you considered using it to actually create new music?
After all, the device is a computer. It has a GPIO and USB for adding original and custom hardware. Using Python (or another language), you can get to grips with outputting sound. Why wouldn’t you attempt to make music with the Raspberry Pi?
This credit card-sized computer never stops surprising us. Here are five musical instruments you can build using a Raspberry Pi.
1. Sonic Pi
No list of Raspberry Pi musical projects can be complete without a mention of Sonic Pi. This now comes pre-installed with Raspbian Stretch, but you can easily install it on your Pi with:
sudo dpkg -i sonic-pi_1_3.0.1-armhf.deb sudo apt-get install -f
Sonic Pi has proven so successful that it is also available for Windows, macOS, and x86/x64 Linux computers.
You have several reasons to use Sonic Pi. Live coding is probably the most well-known use, enabling you to use Python to change the music as it plays. This is a totally new phase for synthesized music that many people are embracing.
Daunted by Sonic Pi? Worry not: the device has an excellent starter guide published by MagPi, which you can download from their website for free! Sonic Pi is the simplest way to turn your Raspberry Pi into a musical instrument: try it today! Head to Sonic-Pi.net to find out more.
Invented in 1920 by Russian scientist Lev Theremin, the Theremin is a fascinating instrument. You may know its sound from various classic sci-fi movies, the Beach Boys’s Good Vibrations, or the long-running TV detective series Midsomer Murders.
What is most notable about the electronic magic of the Theremin is that it is played without any physical contact. Here it is in action:
Several Theremin projects have been developed for the Raspberry Pi. Most notable is the ultrasonic theremin, which requires the Sonic Pi software (included with Raspbian Stretch, the latest official Raspberry Pi operating system) and python-osc. This Open Sound Controller protocol library makes it possible for computers, synths and other multimedia audio devices to communicate. As such it’s pretty important!
Meanwhile, this alternative Pi theremin ingeniously uses a camera rather than an ultrasonic distance sensor to detect motion. This is also a more ambitious synthesizer:
3. Build a MIDI Synth
Several synthesizer projects are available for the Raspberry Pi. This one, by Andrew Dotnich, requires you to connect a USB/MIDI controller such as the Behringer U-CONTROL UMX-25 or Midiplus AKM320), establish a connection, and install some software. Full instructions can be followed in Dotnich’s guide.
The end product might look something like this, a Mellotron emulator:
What you’ve got here, then, is a MIDI keyboard connected to a Raspberry Pi (presumably a version 2 or 3). Audio is reportedly untouched, played directly from the Pi’s output, with reverb part of the synth’s settings.
Don’t be limited by that video (the uploader links to Andrew Dotnich’s project as a demonstration). Instead, use the tutorial and video as a starting point. Go ahead and create your own awesome synthesizer!
4. Guitar Effects Pedal-Pi
Not strictly an instrument, of course, but effects pedals are a vital part of electric guitar playing; performance wise, certainly. However, they can be expensive, so building your own makes sense.
So, what part can a Raspberry Pi play in all of this?
The Pedal-Pi uses a Raspberry Pi Zero as its brain, and is fully open source, software and hardware. Take a look at it in action above.
Effects can be coded into the pedal in C language, while various ready-made effects are available to download from the forum. While there isn’t a tutorial, there is a full bill of materials used in building such a pedal, along with the code. If this seems like too much work, you can order the full kit for under $50.
5. The JoyTone
Now here is a curious machine. Based on a Raspberry Pi with a number of thumbsticks arranged in a hexagon design, the JoyTone is capable of stunning orchestral choruses. It appears (although I haven’t tried it) to be perhaps the most natural hand-controlled musical instrument ever created.
Designed by Dave Sharples and David Glanzman, the JoyTone has a “hexagonally isomorphic layout.” But what exactly does this mean? Well, it’s about their arrangement on the hexagonal grid, and their identical physical size and shape.
“They also have the same musical relationships to each other — if you move to the right by one thumbstick, that corresponds to going up a perfect fourth musically, and this is true no matter where you start on the grid. This means that musical structures like a major chord or a minor scale are always the same shape, no matter which note you start on.”
The result is an instrument that is easy to play, and expressive. Here’s the JoyTone in action, courtesy of David Glanzman, Sharples’s project teammate:
Details of the JoyTone from Dave Sharples’s blog have sadly been lost to time, as the URL seems to have expired. However, we’ve managed to find it via the Internet Archive and suggest you read it to find out more.
How Musical Is Your Raspberry Pi?
As you can see, these five projects demonstrate excellent uses of the Raspberry Pi as a musical instrument or synthesizer. My own personal favorite is the Theremin, although I suspect if I were to attempt any, it would be the guitar effects pedal.
If you’re more into listening to music than making it, then why not check out our tutorial on creating a Pi music server?
Which is your favorite instrument? Which one do you plan to build? Or have you developed your own Raspberry Pi-based musical device? Tell us in the comments below!