Let's get started with a fresh, updated copy of Raspbian. I'm running the latest version of Stretch. Be sure to visit our guide on how to update and install Raspbian on your Raspberry Pi. Usually it’s just a matter of running the following code:
sudo apt-get update && sudo apt-get upgrade --yes
Follow the update with a nice reboot.
Pure Data is an awesome piece of open source software. You can find all sorts of expansions and add ons to really make the most of your synth projects. But today, we'll keep things simple by using vanilla PD. To install the basic PD package, run the following code:
sudo apt-get install puredata
Follow the prompts to ensure the package installs. As a general rule of thumb, I restart my Raspberry Pi after a new software install.
We need to install sound tools to connect our MIDI keyboard to Pure Data. ALSA tools has everything we need to create the connection. AconnectGUI will provide us with a pretty user interface to work with. If you don't want to use the GUI, the operations can be performed via command line.
Run the following to install both ALSA tools and aconnectGUI.
sudo apt-get install alsa-base alsa-utils sudo apt-get install aconnectgui
Follow the prompts to complete the installation and restart the Raspberry Pi.
I'm running Pure Data on a Raspberry Pi with a screen. It is possible to run PD headless, you can find a complete list of Pure Data command line functions here. There are a few ways to launch Pure Data. It can be found under the start menu folder
Sound & Video.
However, I'll be launching PD via command line so it starts with admin privileges. I'm also including the tag
-alsamidi so Pure Data launches with ALSA set as default. Run the following to launch Pure Data from a terminal.
sudo pd -alsamidi
Next we need to open virtual ports within Pure Data. We'll use these ports to connect our MIDI keyboard. ALSA should be set as default if you opened PD via terminal in the last step. To be sure, Open Media from the top PD window menu.
ALSA-MIDI should be selected. If it's not, left click to select it.
Open Media once again and choose
MIDI settings... from the drop down menu. A small window will appear with text fields next to
In Ports: and
Out Ports:. These text fields each need to be set to
1. Click OK. This will activate the Pure Data MIDI ports we need.
Plug your MIDI Keyboard into a USB port on the Raspberry Pi and turn the keyboard on. I will be using the aconnectGUI to complete the connection. You can find aconnect GUI under the start menu
Sound & Video folder. The application will say
ALSA Sequencer at the top of the window.
There are two buttons at the top of the window: scissors and a cable. Click the cable button to enable the connection mode. Locate your MIDI keyboard in the list then drag and drop the arrows to connect it to the Pure Data ports we opened.
Now it's time for the fun part! Pure Data uses files called patches. Starting your PD synthesizer journey only takes an afternoon. I found several useful resources along my way and want to pass them off to you to help you get started.
If you're ready to jam now, download this MIDI patch I created and start playing immediately. Note: Patch files are built on existing patch files. The github link contains a zipped folder with 8 patch files. To launch the MIDI control module, unzip the folder and open
This patch was made with the help of LWM Music tutorials on lwmusic.com. Dr. Lawrence W. Moore has a series of videos available on YouTube as well. The series is very well paced and thoroughly covers the basics of Pure Data. If you're looking to build a solid foundation, this is a great place to start.
I recommend looking into different PD functions to implement them into your own patches. Additive Synthesis, for example, is a way of combining two waveforms to create unique wave patterns.
Congratulations! Your Raspberry Pi is now a funky fresh MIDI controlled synthesizer machine.