Logo loophole letters

Audio DSP Level 2

code

This is level 2 of my DSP journey. Be sure to read level 1 first

Exponential Saws

An exponential saw works like this:

It can either be used as an oscillator, or as a modulator, e.g. as an envelope:

Hihat

We can create a simple hihat with noise and an exponential saw as envelope:

Snare

Similarly, a snare can be created with noise + a low sine oscillator:

Kick

Let’s add a kick:

It’s just a sine wave that starts fast and exponentially gets slower. Try tweaking the numbers to get a feel for the different sounds you can get. There are a lot more possibilities for kick synthesis, but let’s keep it simple for now.

Kick + Hihat + Snare:

Note that the hihat uses t+.25 to shift the hihat to the offbeat! Similarly, the snare is shifted with +.5.

Let’s add the bass from the last level on top:

Clock

So far, we had to pass t to every oscillator function.. We can instead create a clock function that sets t for all functions to use:

The dsp function is now much more concise and readable! I found this trick in one of the wavepot tunes

End of Level

If you’ve followed along, congrats for completing this level. The next level will follow soon.

❤️ 2024 Felix Roos | mastodon | github