Easter egg - Making a Pd sound design tool


I was reading an article about the sound of Ghost of Tsushima and the amazing world created by the Sucker Punch sound team and something Josh Lord (Senior Sound Designer) said caught my attention. While talking about the UI/UX sounds he said a particular tool was very useful: he created a Max/MSP patch for processing the source, something like a “happy accidents” generator that had the ability of printing out something that happened while he was tweaking the sound. I thought it sounded like a really interesting and useful sound design tool so I decided to try making my own Pd tool that would do something similar. I’m going to show you how it looks like and then we’ll see a little about what is going on inside.
Fig.1 - Easter egg

Easter egg demo


The main things I needed for this project, the way I interpreted it, were:
1 - a way to open my source file 2 - a way to print out “x” seconds from buffer into a file 3 - some fx to manipulate the source

OPENING SOURCE FILE


As I mentioned, first I had to create a way to open my source file and store it into an array to work with it, I used [openpanel] and [soundfiler] for that. The left outlet of [soundfiler] will output the number of samples - you need to divide this number by your sample rate to get the original playback speed and feed it to [phasor].
openpanel-easteregg Fig.2 - Opening your sample
I used the phasor rate information and sent it to an HSlider to manipulate playback speed and added a bang to reset to original speed and another one to set it to 0. There is a tutorial by Dr.Rafael Hernandez (cheetomoskeeto) that teaches you something similar, definitely check it out if you are interested or not following this very well - I will add it to the references section.
tabread-easter Fig.3 - Reading the table
Now that you have set the phasor speed, multiply it by the sample size and read the table. I have an [outlet~] because this is a subpatch. I am graphing the controls to the main patch so everything looks organized and usable.
gui-openpanel Fig.4 - Controls for audio source subpatch
The array “original” is in the main patch so I can visualize the waveform.
waveform-table Fig.5 - Source waveform
After this, I wanted to make an fx chain, so I could have different ways of modifying my audio. I added ring modulation, 2 delays, chorus, reverb, low pass filter and a noise generator. I might add other things to the chain, but for now this allows me to play around quite a bit. The order of effects can be changed in any way you want.

FX CHAIN


The effects are not the main focus here so I won’t be into a lot of the details, however, I will show you how I implemented them. All the effects are subpatches, so you will see an [inlet~] and [outlet~] on them so the audio passes through.
Here’s how the two different delays work:
delay-subpatch Fig.6 - Delay subpatch
slapback-delay Fig.7 - Slapback delay
For reverb I used [freeverb~], a Schroeder/Moorer reverb external that uses 8 comb filters. We have dry/wet and room size controls, those are freeverb~ messages. For more details, chech the help patch on [freeverb~].
reverb-subpatch Fig.8 - Using freeverb~
The chorus is produced by reading 3 copies of the delay line at a slightly different pitch and phase than the other. In other words, we have an input and the signal is distributed in 2 ways: one goes directly to the output and a copy goes to the delay line, then I can create 3 different LFO’s that will read from a single delay line.
chorus-sub Fig.9 - Chorus subpatch
Then I added a simple low-pass filter using [lop~].
lpf-subpatch Fig. 10 - Low-pass filter subpatch
And ring modulation multiplying the [inlet~] by a modulator [osc~].
easter-ring Fig.11 - Ring modulation

OUTPUT


On my master output I send the signal to a VU meter so I can monitor my levels sendtovu Fig.12 - Sending levels to VU meter
metering Fig.13 - Metering the output levels
Finally, this is one of the most important parts of this patch, because it defines how I got the last seconds of audio that I wanted to catch. So I have an [inlet~] that receives signal from the end of the chain and then I have to delay the input by defining a delay line that will be read later before [writesf~]. I used a counter before [makefilename] so I could have an incremental file name: my audio files will look like this “easter-egg0.wav”, “easter-egg1.wav” and so on… Then, I need pd to work a few steps so I used the [trigger] object or as you can see in the patch, [t b b b a] and this helps with the operation order, remember that trigger outputs from right to left so it will: create the file, then read delay line, start recording, wait “x” seconds and then stop.
buttons-catch-done Fig.14 - Receiving signal
catch-audio-sub Fig.15 - Subpatch to print out last 15 seconds of audio
catch-contrls Fig.16 - Controls for the subpatch
I had a lot of fun doing this and I believe it’s very easy to adapt to whatever needs I have in the future. There is still room for a lot of improvements. If you wish to try and use the patch, please feel free to download it from my github repository.
================================================================================ References

Crafting Ghost of Tsushima’s Tremendous Sound https://www.asoundeffect.com/ghost-of-tsushima-sound/


Freeverb~ https://puredata.info/downloads/freeverb


Cheetomoskeeto tutorial https://www.youtube.com/watch?v=boX0v54SqtU&list=PL12DC9A161D8DC5DC&index=24


Easter egg github https://github.com/n1n4-303/pd-patches/tree/master/easter-egg