[PD] Few steps further on analog synth emulation on RPi

Antoine Villeret antoine.villeret at gmail.com
Mon Sep 17 00:38:01 CEST 2012


hi all, here is an up-to-date tutorial to make an analog synth with a
Raspberry Pi and pd :

1. installing raspbian on a SD card

see instruction :
http://www.raspbian.org/
http://elinux.org/RPi_Easy_SD_Card_Setup

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 / upgrade
sudo reboot
log in and start graphical interface :
startx

2. installing puredata

sudo apt-get install git tk8.5-dev libasound2-dev subversion
downloading latest pd :

git clone git://pure-data.git.sourceforge.net/gitroot/pure-data/ pure-data
cd pure-data/src
autoconf
./configure CFLAGS="-mfpu=vfp -mfloat-abi=hard"
make
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
add
* - 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
https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/nusmuk/nusmuk-audio/~/nusmuk-audio
cd ~/nusmuk-audio
make
cd examples
pd analog_synth_emulation.pd

5. Performance :

The analog output is very poor now. Some (like Miller) are working on
improving it (thanks for their work). The signal to noise ratio is low and
there is also some quantization distorsion.

On the other hand, one 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
https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/hid/~/hid
cd hid/
make
pd hid-help.pd

The Byron interface (http://www.1010.co.uk/org/byron.html) 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 :
http://elinux.org/RPi_Debian_Auto_Login. And to start pd at startup, we
follow the steps on the same page but replace startx by ~/autostart.sh wich
is a script like this :
pd -nogui -audiodev 3 -open
~/nusmuk-audio/examples/analog_synth_emulation.pd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20120917/43d9e457/attachment.htm>


More information about the Pd-list mailing list