Decimator Wobble Bass
In the first of what I hope will be many Supercollider posts, I’m dissecting a fairly straightforward wobble bass snippet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | { var trig, numSmp, rate, freq, wobble,out,note,mod; freq = (140/60)/3; // It's not dubstep if it's not at an integer multiple of 140bpm. trig = Impulse.kr(freq); // Main tempo pulse note = Demand.kr(trig, 0, Dseq([40, 43, 47, 47, 40, 49-12, 43, 40-12], inf)); note = Slew.kr(note, 300, 20); // Pitch changes are slewed, faster up than down numSmp = SampleRate.ir / freq; rate = 2pi / numSmp; rate = rate * Demand.kr(trig, 0, Dseq([1/2, 6, 6, 6*2, 2, 8, 6, 6*2], inf)) / 2; // Choose random "wobble" tempo wobble = Phasor.ar(trig, rate, pi, 2pi ).cos; // Phasor is used to index cosine. Just sweeps through a half of a full wave. out = VarSaw.ar(note.midicps, width: wobble.range(0.45,0.55)) // Tone to be filtered. Notice modulation of width param. + SinOsc.ar(note.midicps/2, mul: wobble.range(0,1)).dup; // Subbass. out = Decimator.ar(out, 20000, wobble.range(1.2,8)); // Sampling resolution is decreased in time with the wobble. out = MoogLadder.ar(out, wobble.range(note.midicps,25000), wobble.range(0.03,0.1)).dup; // Emulated Moog Low Pass. out = out * 0.25; // Turn it down a bit to prevent clipping. out = [DelayC.ar(out, 1, wobble.range(0,0.0012)), DelayC.ar(out, 1, wobble.range(0.0012,0))]; // Spatialization out = out * Linen.kr(trig, 0.01, 0.7, 1.3/freq, doneAction: 0); // Simple Envelope }.play; |
This sample was generated from the code above, which uses Demand UGens to sequence notes/wobble rates on lines 5 and 9. Line 6 adds a bit of slew to the pitch signal, so it glissandos (slides) from note to note, faster up than down for heightened drama.
The signal path for the sound runs: initial synthesis, distortion, filtering, a simple spatialization effect and amplitude enveloping.
The tone is initially made up of a VarSaw oscillator whose width parameter (0 = downward sawtooth, 0.5 = triangle, 1 = upward sawtooth) is “wobbled” by the LFO (line 11). A pure sine wave an octave lower is added to this (line 12). The Decimator UGen distorts this signal by rounding values to an arbitrary degree of precision (i.e. 8-bit, 2-bit, 3.2-bit) as modulated by the LFO. This produces the higher-frequency content of the signal for the filter to do it’s magic on.
The result is a bit like that seething “filthy” sound that’s so popular these days. I’ll probably do a dedicated post on it later, but the trick seems to be several square wave oscillators frequency modulating one another in turn, all through a band-pass filter.
Now that everything is sufficiently noisy it’s run through a nice emulation of the Moog ladder lowpass filter on line 14.
Line 16 splits what has until now been a monophonic signal in to two channels, each of which has a separate delay on it, the values for which are LFO-modulated out of phase with one another (so when one maximally delayed, the other has no delay). This gives the sound some (subtle?) “width” when played with stereo separation, but if you were to play this on a real rig (in mono), there would be destructive and likely undesirable interference muddying up the low end. To dodge this, you could split the signal around 65Hz and only apply delays to the high end before reconstituting it.
The triggered LFO is specified on lines 7-10. Worth noting are the phase angle bounds the Phasor UGen is sweeping through: pi to 2pi – only half of a full sine wave before resetting. Playing with these bounds can produce some interesting variations on the standard wobble.
I’ve really exaggerated the distortion to highlight the character of the sound on headphones or monitors. If you were to produce a track for dance floor use, you’d want to either generate sub-bass separately, possibly raising the line synthesized with decimation an octave or two, or ease up on the distortion; as it stands, this would be kind of weak. Try commenting out line 14 (the filter) before tweaking any parameters.