Skip to content
mxmxmx edited this page Nov 29, 2014 · 45 revisions

almost there / final steps

  • on the pd end of things, we just need to put together the elements from before, and make things start up on start-up. in terms of i/o we need [netreceive] and [route] for the inputs, [tt_gpio] and [dac~] for the outputs. a (the most) basic patch, not really doing anything much at all, would look like so:

  • the [loadbang] object on the top left puts out a bang when the patch is loaded and turns on the dsp. a little delay is required, thus [delay 300]. it also turns on the [metro object] on the bottom right, which then just sends messages to the [tt_gpio] object, turning it on and off every other second. (that's one way of doing it. [pipe 200] determines the pulsewidth: 200 ms in this case). you have to call it with sudo because of the GPIO/SPI access:

sudo puredata -nogui -noadc x.pd or, in case you're using pd-extended,

sudo pd-extended -nogui -noadc x.pd

  • the -nogui and -noadc flags do what they say: we need no graphical user interface and have no audio input.

  • finally, we need some kind of start-up script(s), in which we launch pd, adc2FUDI and which takes care of a few other things as well. an example can be found here: https://github.com/mxmxmx/terminal_tedium/blob/master/software/pdpd . it simply calls a patch called pv.pd located in the folder /home/pi/PD/ . adjust the name of the patch to whatever you're using, and/or if using pd-extended. more complex things (like changing patches) is possible of course, but requires some more complex little programs running in the background.

  • put that script in a folder of your choice, say 'PD' (that what the example is using: /home/pi/PD/). make it executable - sudo chmod 755. entering /home/pi/PD/pdpd in the terminal should launch pd. next, we need to edit rc.local so that the script will run automatically at start-up. you can do so with sudo nano /etc/rc.local. simply add the line /home/pi/PD/pdpd. reboot. your terminal tedium should be booting up now with both pd/your patch and the ADC running.

  • last. optimisations etc. there's lots of room for improvement/experimentation. you might consider using a different distribution, there's realtime kernels or using jack (not ALSA). you're on your own here though. some simple/basics things can be found in this script: https://github.com/mxmxmx/terminal_tedium/blob/master/software/rt_start (in particular, note the line echo -n performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor). you can simply add it to rc.local, too, before the pd script (and after chmod 755-ing it). ie:

sudo /home/pi/PD/rt_start

/home/pi/PD/pdpd

Clone this wiki locally