-
Notifications
You must be signed in to change notification settings - Fork 29
software, pd
-
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, a pd patch typically will use
[terminal_tedium_adc]
(for the CV inputs),[tedium_input]
for the gates and switches; and[tedium_output]
for gate outputs;[dac~]
for the audio outputs; and[adc~]
for the audio inputs (wm8731 only, of course). a most basic patch would look like so -- not really doing anything much at all:
- 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] for the ADC; you have to call it with sudo because of the GPIO/SPI access. note that [dac~] and [adc~] aren't pictured.
==============================================================================================================
- finally, we need some kind of start-up script(s), in which we launch pd and possibly a few other things as well. an example can be found here. it simply calls a patch called
nameofpatch.pd
located in the folder/home/pi/
:
#!/bin/bash
## start pd
sudo puredata -nogui -noadc -rt /home/pi/nameofpatch.pd &
- note this uses the
-noadc
flag; for wm8731, it'll look like:
#!/bin/bash
## start pd
sudo puredata -nogui -rt /home/pi/nameofpatch.pd &
-
(more complex things (like changing patches) is possible of course, but requires some more complex little programs running in the background. see the OSC client for some pointers.)
-
put that script in a folder of your choice, say
/home/pi
(that what the example is using). make it executable -sudo chmod 755
. entering/home/pi/pdpd
in the terminal should launch pd. -
next, we need to edit rc.local so that the script will automatically run at start-up. you can do so with
sudo nano /etc/rc.local
(or your editor of choice). simply add the line/home/pi/pdpd
. then reboot. your terminal tedium should be booting up now with pd/your patch running
-
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/rt_start
/home/pi/pdpd
- in terms of audio latency, the best results (with pcm5102a) i got is with something like:
sudo puredata -noadc -nogui -rt -r 44100 -audiobuf 5 [yourpatch].pd
; though this is unlikely to run stable. you'll have to experiment with the size of the audio buffer.
- as the wm8731 codec runs at a fixed clock, use 48k:
sudo puredata -noadc -nogui -rt -r 48000 -audiobuf 5 [yourpatch].pd