hi all, here is an up-to-date tutorial to make an analog synth with a Raspberry Pi and pd :<div><br></div><div><div>1. installing raspbian on a SD card</div><div><br></div><div>see instruction :</div><div><a href="http://www.raspbian.org/">http://www.raspbian.org/</a></div>

<div><a href="http://elinux.org/RPi_Easy_SD_Card_Setup">http://elinux.org/RPi_Easy_SD_Card_Setup</a></div><div><br></div><div>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 :</div>

<div>- expand root</div><div>- change keyboard</div><div>- change password</div><div>- change local (fr utf8)</div><div>- change memory split : minimum allocated to video</div><div>- enable ssh</div><div>- boot : no desktop</div>

<div>- update</div><div><br></div><div>sudo apt-get update / upgrade</div><div>sudo reboot</div><div>log in and start graphical interface :</div><div>startx</div><div><br></div><div>2. installing puredata</div><div><br></div>

<div>sudo apt-get install git tk8.5-dev libasound2-dev subversion</div><div>downloading latest pd :</div><div><br></div><div>git clone git://<a href="http://pure-data.git.sourceforge.net/gitroot/pure-data/">pure-data.git.sourceforge.net/gitroot/pure-data/</a> pure-data</div>

<div>cd pure-data/src</div><div>autoconf</div><div>./configure CFLAGS=&quot;-mfpu=vfp -mfloat-abi=hard&quot;</div><div>make</div><div>sudo make install</div><div><br></div><div>It takes around 20min to build, be patient.</div>

<div>you can start pd using the « pd » command</div><div><br></div><div>3. optimising the system for pd :</div><div><br></div><div>sudo leafpad /etc/security/limits.conf</div><div>or try nano if you don’t start an X server</div>

<div>add</div><div>* - rtprio 99</div><div>* - memlock 1000000000</div><div>start pd and go to media &gt; preference &gt; startup</div><div>add the following flag in the startup flag field :</div><div>-rt -alsa -noadc -audiobuf 25</div>

<div><br></div><div>then apply and restart pd.</div><div><br></div><div>4. test</div><div><br></div><div>download analog synth emulation patch by Cyrille Henry here :</div><div>svn checkout <a href="https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/nusmuk/nusmuk-audio/">https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/nusmuk/nusmuk-audio/</a> ~/nusmuk-audio</div>

<div>cd ~/nusmuk-audio</div><div>make</div><div>cd examples</div><div>pd analog_synth_emulation.pd</div><div><br></div><div>5. Performance :</div><div><br></div><div>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.</div>

<div><br></div><div>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.</div>

<div><br></div><div>We tried to reduce latency without hearing click with the Cyrille’s patch, here are the results :</div><div>10 ms latency with USB soundcard</div><div>20 ms latency with integrated HDMI audio</div><div>

We also tried to input audio with USB soundcard but audio is crackly as soon as input is enable (with output too).</div><div><br></div><div>6. Getting data from real world</div><div><br></div><div>Most of MIDI-USB interface should work out-of-the-box.</div>

<div>With Edirol UM-1EX we get a MIDI loopback between 30 and 35ms.</div><div><br></div><div>HID works great.</div><div>svn checkout <a href="https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/hid/">https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/hid/</a> ~/hid</div>

<div>cd hid/</div><div>make</div><div>pd hid-help.pd</div><div><br></div><div>The Byron interface (<a href="http://www.1010.co.uk/org/byron.html">http://www.1010.co.uk/org/byron.html</a>) is one of the cheapest way to make a CV-to-computer interface.</div>

<div><br></div><div>A TCP loop on a local computer takes less than 1.5 ms.</div><div><br></div><div>7. Autologin</div><div><br></div><div>To enable auto login, we follow this : <a href="http://elinux.org/RPi_Debian_Auto_Login">http://elinux.org/RPi_Debian_Auto_Login</a>. 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 :</div>

<div>pd -nogui -audiodev 3 -open ~/nusmuk-audio/examples/analog_synth_emulation.pd</div>
</div>