Here’s a little how-to for a project I started doing this year with my advanced classes. It’s a bit more complex than just the patch, but the soundboard is the most interesting part of the project.
Soundboard apps are one of the more common gimmick apps on the iPhone, so many students already understand what it’s supposed to do: You hit a button, it plays a sound. Simple, right?
Figure one: the thing that makes the noise
THE THING THAT MAKES THE NOISE
In PD, “tilde” objects are the ones that deal with sound. In our soundboard patch, the only two objects that directly deal with sound are tabplay~ (reads the sound buffer as audio) and dac~ (the final output to speakers). The button you see above tabplay~ is called a “bang” and it does what you think it does.
Figure two: the array, where sounds live
WHERE THE SOUND LIVES
In PD, sound lives in buffers called “arrays”. You have to both make the array, and tell PD to read the audio file into it. To get the sound into the array so that each time you load the patch it will be there is kind of dodgy – you have to hard code it. Meaning, you will ask PD to look in a specific location for the sound. I’ve noticed that some versions of PD hate filenames and folders with spaces in them, so try to avoid those if possible. Also, sound must be in an uncompressed format like wav or aif.
The sound loading routine – the “read” message is the only part of this patch that feels like actual programming.
You must get the read message box right or else your sound will not load. It goes like this: read is the command. “-resize” tells the array to be the same length as the sound file. Then, the file path. Finally the name of the array it’s going to land in. Make sense? Good.
Soundfiler takes the read message in as a command and makes it happen. You don’t need to connect it to anything.
Assuming you got this to work, you may have gotten your soundboard to work!
Making the soundboard useful is another task. In lieu of having a video game that’s interactive hook into the patch (a holy grail goal of mine for this project) I opted for an alternative. Live but digital foley.
Here’s how it works. I use a 2-3 minute video clip from a video game. The students make sound that are needed for that clip (jump, door opening, lasers, etc.) They make a PD soundboard that uses those sounds.
Then we use JACK to route the PD audio back into GarageBand where it can be recorded. I play the clip on my projector so the whole class can see it at once and they “perform” their clips from the patch into GB. Then, they take a low res version of the video and re-sync it so they can export it as a project. Possible extensions might be writing some BGM for it as well, but that might make the project take a bit too long.