Analog synth emulation with puredata on Raspberry Pi

Here is a step by step on how to make a analog synth emulation with an RPi :-) :

1. installing raspbian on a SD card

see instruction :

connect a keyboard, a mouse, an HDMI screen and an ethernet cable with DHCP (to get internet access) and boot on the SD card to configure the OS :
- expand root
- change keyboard
- change password
- change local (fr utf8)
- change memory split : minimum allocated to video
- enable ssh
- boot : no desktop
- update

sudo apt-get update
sudo apt-get upgrade
sudo reboot

install rpi-update and update the firmware (needed to improve sound quality !!)
(instruction here :

sudo wget -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
sudo reboot

log in and start graphical interface :

2. installing puredata

sudo apt-get install git tk8.5-dev libasound2-dev subversion autoconf libtool gettext

downloading latest pd :

git clone git:// pure-data
cd pure-data/src
./configure CFLAGS="-mfpu=vfp -mfloat-abi=hard"
sudo make install

It takes around 20min to build, be patient.
you can start pd using the “pd” command

3. optimising the system for pd :

sudo leafpad /etc/security/limits.conf
or try nano if you don’t start an X server
* - rtprio 99
* - memlock 1000000000

Start pd and go to media > preference > startup
add the following flag in the startup flag field :
-rt -alsa -noadc -audiobuf 25

then apply and restart pd.

4. test

download analog synth emulation patch by Cyrille Henry here :
svn checkout ~/nusmuk-audio
cd ~/nusmuk-audio
cd examples
pd analog_synth_emulation.pd

5. Performance :

The analog output of RPi has been improved but it is still quite noisy. Man can output some audio through HDMI. We use an HDMI display to convert audio and to send it to good quality loudspeaker. We later tried a USB soundcard (Edirol UA-1A) which works out-of-the-box.

We tried to reduce latency without hearing click with the Cyrille’s patch, here are the results :
10 ms latency with USB soundcard
20 ms latency with integrated HDMI audio
We also tried to input audio with USB soundcard but audio is crackly as soon as input is enable (with output too).

6. Getting data from real world

Most of MIDI-USB interface should work out-of-the-box.
With Edirol UM-1EX we get a MIDI loopback between 30 and 35ms.

HID works great.
svn checkout ~/hid
cd hid/
pd hid-help.pd

The Byron interface ( is one of the cheapest way to make a CV-to-computer interface.

A TCP loop on a local computer takes less than 1.5 ms.

7. Autologin

To enable auto login, we follow this : And to start pd at startup, we follow the steps on the same page but replace startx by ~/ wich is a script like this :
pd -nogui -audiodev 3 -open ~/nusmuk-audio/examples/analog_synth_emulation.pd