{"id":13659978,"url":"https://github.com/konsumer/pdpi","last_synced_at":"2025-09-07T03:35:26.017Z","repository":{"id":142068084,"uuid":"67239744","full_name":"konsumer/pdpi","owner":"konsumer","description":"A raspberry pi based synthesizer that uses puredata","archived":false,"fork":false,"pushed_at":"2021-06-08T01:07:06.000Z","size":454,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T16:21:50.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konsumer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-02T16:51:46.000Z","updated_at":"2025-01-31T17:28:54.000Z","dependencies_parsed_at":"2024-01-14T17:01:27.915Z","dependency_job_id":"8deb8af1-eda4-4a27-b7d8-86b26fc31b70","html_url":"https://github.com/konsumer/pdpi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fpdpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fpdpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fpdpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fpdpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konsumer","download_url":"https://codeload.github.com/konsumer/pdpi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247662608,"owners_count":20975275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T05:01:14.509Z","updated_at":"2025-04-07T13:35:06.030Z","avatar_url":"https://github.com/konsumer.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# pdpi\n\nThis is a raspberry pi puredata synth.\n\n[![intro video](https://img.youtube.com/vi/vhotjWj_JhU/0.jpg)](https://www.youtube.com/watch?v=vhotjWj_JhU)\n\nThis project is unrelated to [this other pdpi](http://pd-la.info/pdpi/), which I found after I named it. If anyone has any suggestions for a better name, I'm so in!\n\nIt uses Puredata vanilla 0.46.2 (the version available in debian repos.)\n\nThe basic idea is that you can run it headless, and use your MIDI keyboard to control every aspect of it. The modules that get loaded for different `PROGRAM_CHANGE` MIDI messages are located in `modules/`.\n\nSo far, I have a simple demo `phasor~`, `osc~`, a bass-synth (like a 303,) a rhodes-like fm synth, and a super-saw washy witch-house type synth.\n\nMaking instruments is meant to be very simple.  There are 2 inlets and 2 outlets. top-left inlet is a note-pair (note-number and velocity) and the right inlet is mapped control pair messages (eg \"knob1 100\".) Knob values are MIDI scale (0-127) and buttons are 0 or 127 (127 when pressed.)\n\nMIDI control messages are mapped, so you can make your own instrument map (knobs and buttons) for controls to make it easier to use with your MIDI controller. Open up `control_map.pd` in puredata to make a map for your own MIDI controller. I made one for my Oxygen 25.\n\nThese are the control-types I currently have:\n\n```\nmod - 0-127 modulation wheel\nvolume - 0-127 slider that makes sense to control main volume\nknob1 - 0-127 basic instrument parameter\nknob2 - 0-127 basic instrument parameter\nknob3 - 0-127 basic instrument parameter\nknob4 - 0-127 basic instrument parameter\nknob5 - 0-127 basic instrument parameter\nknob6 - 0-127 basic instrument parameter\nknob7 - 0-127 basic instrument parameter\nknob8 - 0-127 basic instrument parameter\nbutton1 - 0/127 - trigger switch\nbutton2 - 0/127 - trigger switch\nbutton3 - 0/127 - trigger switch\nbutton4 - 0/127 - trigger switch\nbutton5 - 0/127 - trigger switch\nbutton6 - 0/127 - trigger switch\n```\n\nThese are just the controls that made sense for my controller, but I'm happy to add more so they become a standard that others can depend on in their layout for their instrument modules. I try to use sensible defaults, so synths will sound good without having the parameter control available on any given hardware.\n\nTo use the synth, get MAIN.pd running on boot, and send it a `PROGRAM_CHANGE` message to switch instruments.\n\nOpen up the patch in puredata from `modules/{PROGRAM NUMBER}/main.pd` to see how it works.\n\nIf you don't have a MIDI keyboard handy, you can open `modules/vcontroller.pd` to send messages using your computer keyboard.\n\n## module details\n\n### 1. simple saw-wave synth\n\nThis is just a simple `[phasor~]`. It's made to load 8-voice polyphony, so you can see how that works.\n\n### 2. simple sine-wave synth\n\nThis is just a simple `[osc~]` with 1 voice.\n\n### 3. bass synth\n\nThis is sort of like a 303. It's an analog bass synth with 1 voice.\n\n```\nknob1 - filter cutoff\nknob2 - filter resonance\nknob3 - envelope mod\nknob4 - rect width\nknob5 - glide\nbutton1 - select SAW wave\nbutton2 - select SQR wave\nbutton3 - select TRI wave\nbutton4 - select SIN wave\nbutton5 - enable an additional highpass filter\n```\n\n### 4. rhodey\n\nSort of like a rhodes, with 4 voice polyphony.\n\n```\nmod - modulation depth\nknob1 - tone\nknob2 - decay\nknob3 - vibe frequency\nknob4 - vibe depth\n```\n\n### 5. super-saw\n\nBadass phat saw sound. Based on [this](http://www.ghostfact.com/jp-8000-supersaw/) rad breakdown. Setup with 4 voice polyphony.\n\n```\nknob1 - detune\n```\n\n## Installing on the raspberry pi\n\n* Install [minibian](https://minibianpi.wordpress.com/download/). I am on a Mac, so I used [Apple Pi Baker](http://www.tweaking4all.com/software/macosx-software/macosx-apple-pi-baker/), but here are [instructions for others](https://www.raspberrypi.org/documentation/installation/installing-images/). Make a blank file in the root of the SD called `ssh` (with no extension,) the contents don't matter.\n* If you don't have a monitor/keyboard, make a simple network with [just a cable](https://pihw.wordpress.com/guides/direct-network-connection/)\n* Login with `root` (password: `raspberry`)\n* `apt update \u0026\u0026 apt install raspi-config` and resize your partition with `raspi-config --expand-rootfs`\n* Reboot and login to pi\n* `apt upgrade`\n* `apt install nano unzip alsa-utils git`\n* Run `git clone https://github.com/konsumer/pdpi.git /pdpi`\n* Run `apt install puredata gem puredata-utils puredata-extra puredata-import pd-3dp pd-arraysize pd-aubio pd-bassemu pd-beatpipe pd-boids pd-bsaylor pd-chaos pd-comport pd-csound pd-cxc pd-cyclone pd-earplug pd-ekext pd-ext13 pd-fftease pd-flite pd-freeverb pd-ggee pd-hcs pd-hid pd-iemambi pd-iemlib pd-iemmatrix pd-iemnet pd-jmmmp pd-libdir pd-list-abs pd-lua pd-lyonpotpourri pd-mapping pd-markex pd-maxlib pd-mjlib pd-moonlib pd-motex pd-osc pd-pan pd-pddp pd-pdogg pd-pdp pd-pdstring pd-plugin pd-pmpd pd-purepd pd-readanysf pd-sigpack pd-smlib pd-unauthorized pd-vbap pd-wiimote pd-windowing pd-zexy`\n\n\n\u003e **TODO**: Base all this on [pre-built pi debs](https://github.com/agraef/purr-data/wiki/Installation#linux)\n\nI tested sound like this:\n\n```\nwget http://www.kozco.com/tech/piano2.wav\naplay piano2.wav\n```\n\nI heard a nice piano sound through the headphone jack.\n\nAfter all this, let's get puredata running our `MAIN.pd` on boot. `nano /etc/rc.local` and make it look like this:\n\n```\n#!/bin/sh -e\n#\n# rc.local\n#\n# This script is executed at the end of each multiuser runlevel.\n# Make sure that the script will \"exit 0\" on success or any other\n# value on error.\n#\n# In order to enable or disable this script just change the execution\n# bits.\n#\n# By default this script does nothing.\n\n/usr/bin/printf \"         My IP address is\\033[0;31m `/sbin/ifconfig | grep \"inet addr\" | grep -v \"127.0.0.1\" | awk '{ print $2 }' | awk -F: '{ print $2 }'` \\033[0m\\n\" \u003e /dev/console\n\n/usr/bin/printf \"         Starting PdPi...\\n\" \u003e /dev/console\n/usr/bin/pd -nogui -noadc -midiindev 1 /pdpi/MAIN.pd \u0026\n\nexit 0\n```\n\nIf you have a Pi 3, you can [setup wifi \u0026 bluetooth](https://minibianpi.wordpress.com/how-to/rpi3/), if you want. I didn't do this because I want it to boot faster, and I can plug it in when I need networking.\n\n\n## additional plugins\n\nAbove, I instructed you to install `pd-plugin` which can load LADSPA plugins (using `plugin~` in puredata,) many of which are awesome building blocks for extremely complicated and efficient synth/effect modules. If you'd like a whole bunch of LADSPA plugins installed, run `apt install vco-plugins wah-plugins zam-plugins swh-plugins tap-plugins ste-plugins mcp-plugins omins liquidsoap-plugin-ladspa invada-studio-plugins-ladspa fil-plugins cmt caps bs2b-ladspa blop blepvco autotalent amb-plugins rev-plugins wah-plugins fil-plugins`. After this, you can run [this script](https://gist.github.com/konsumer/84ebf8837cdd80fde839) to generate some nice commented patches all ready for pdpi! You will probably have to tweak some of them a bit to make work right (toggle might be better than slider, range might not be good)but for the most part they just work.\n\nHere is how to get it on the pi and run it:\n\n```\ncd /pdpi/lib\nwget https://gist.githubusercontent.com/konsumer/84ebf8837cdd80fde839/raw/ca79c60c8a54f053f3c117b06392b0956f9cbdc3/wrap_ladspa.py\nmkdir ladspa\napt install python\npython wrap_ladspa.py\n```\n\nNow you can add `[ladpsa/whatever]` to your patches.\n\n## speed tweaks\n\nGet the fastest microSD card you can find. You can also make the pi boot faster by editing some files (with `nano`):\n\n### /boot/config.txt\n\nYou can overclock. Here is what it looks like for a pi 2:\n\n```\narm_freq=900\n```\n\nand here is a pi 3:\n```\ngpu_mem=16\narm_freq=1300\nover_voltage=5\ngpu_freq=500\n\n# sdram overclock\nsdram_freq=500\nsdram_schmoo=0x02000020\nover_voltage_sdram_p=6\nover_voltage_sdram_i=4\nover_voltage_sdram_c=4\n```\n\nYou may be able to get it higher. Check out [this for pi 3](https://www.raspberrypi.org/forums/viewtopic.php?f=66\u0026t=138123) and [this for pi 2](https://haydenjames.io/raspberry-pi-2-overclock/). I managed to use these settings without a heatsink, or any change in the hardware.\n\n### /boot/cmdline.txt\n```\ndwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootflags=commit=120,data=writeback elevator=deadline noatime nodiratime data=writeback rootwait quiet\n```\n\n### /etc/sysctl.conf:\n```\nvm.dirty_background_ratio = 20\nvm.dirty_expire_centisecs = 0\nvm.dirty_ratio = 80\nvm.dirty_writeback_centisecs = 1200\nvm.overcommit_ratio = 2\nvm.laptop_mode = 5\nvm.swappiness = 10\n```\n\nI also sped it up a little, and disabled the wait for network with this in my `/etc/network/interfaces`:\n\n```\n# The loopback network interface\nauto lo\niface lo inet loopback\n\n# The primary network interface\nallow-hotplug eth0\niface eth0 inet dhcp\n```\n\n## remote editing\n\nYou can install Xwindows on your desktop computer and edit puredata patches remotely (running on pi.) This ensures that you know exactly what puredata extensions are available. If `-X` doesn't work on OSX or Linux, try `-YC`.\n\n### On Linux\n\nIn a terminal, run `ssh -X root@YOURPI pd -noadc -alsa -midiindev 1`\n\n### On Mac\n\nInstall [XQuartz](https://www.xquartz.org/)\n\nNow, in a terminal, run `ssh -X root@YOURPI pd -noadc -alsa -midiindev 1`\n\n### On Windows\n\nInstall [Xming](http://www.straightrunning.com/XmingNotes/) and [putty](http://www.putty.org/). Ssh into your pi and run `pd -noadc -alsa -midiindev 1`. I don't have a Windows box handy, so I'd appreciate a Windows-person documenting this.\n\n\n## non-pi usage\n\nThe pdpi was designed to be a cheap \u0026 easy computer-based synth, but you might have an old computer laying around that you're not using, and it'd be cheaper to run it there than buy a new pi. We got you covered! Install [debian](https://www.debian.org/distrib/) or [ubuntu server](http://www.ubuntu.com/download/server), Install puredata and extensions, as above, download this project to `/pdpi` the same as above, and edit `/etc/rc.local` the same as above, and you should be good to go!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsumer%2Fpdpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonsumer%2Fpdpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsumer%2Fpdpi/lists"}