nathanielvirgo's code

Band-limited hard sync oscillator

09 Oct'15 04:19 in analogue

I've always wanted a band limited version of the SyncSaw UGen. After taking a look at [1], I realised it's actually quite easy to implement this in SuperCollider. The paper uses a series of band-limited impulses and then integrates them, but since the integral of an impulse is a sawtooth wave, we can just use All we need to do is sum up a variable number of them with the appropriate phases and amplitudes. Since doesn't have a phase control, I implemented the phase offsets using delays. (Using BufDelay means that they all share the same buffer, so keeps memory use down.) As in, syncFreq is the frequency of the master oscillator (i.e. the pitch) and sawFreq the frequency of the slave. minFreq is the minimum value of syncFreq (used to set the length of the delay line) and maxRatio is the maximum value of sawFreq/syncFreq, used to set the number of waves that are added together. (If you go over this you will get an incorrect waveform.) You can try replacing the with a in the definition of ~syncSaw. The resulting waveform does not resemble a hard-synced pulse oscillator, but it sounds good. [1]


5 3
26 Aug'11 09:05 in tweetssctweets

A hopefully more-or-less comprehensive collection of all the sctweets I've posted to

Guitar feedback emulation

26 Aug'11 08:35 in feedbackguitar

A simulation of holding an electric guitar up to the amplifier, creating feedback. Press the mouse button to activate the whammy bar :)

Frequency modulated pulse

26 Aug'11 08:17 in analoguefmpulse

The standard Pulse UGen doesn't sound very good when its pitch is modulated at audio frequencies. This example shows how to produce a band-limited pulse wave that can be modulated at audio rate, producing a better approximation to the kind of FM effects that an analogue modular synth can produce. Requires sc3-plugins.


Putting FreqShift in a feedback loop to produce sound effects in the style of the BBC Radiophonic Workshop. Requires Feedback quark.