Analog dream

Csound works fine for analog synthesis! Here´s a set of instruments useful to emulate your beloved old analog synths. At the end I´ve included my own Roland bassline TB-303 emulator to see some of them in practice.

The oscillators

Aliasing free band-limited analog waveforms (to be used as audio signals)

Square wave
Sawtooth wave
PWM (pulse width modulation)
Triangle wave
Ramp/saw modulation

Geometrically generated analog waveforms (to be used as control signals, e.g. LFO´s etc.)

Square wave / Sawtooth wave / Triangle wave : the static waveform is stored in a table
PWM (pulse width modulation) / Ramp/saw modulation : for those instruments the duty cicle is updated every cycle

Note: use te subaudio generators with care. Those with discontinuities (square, saw, PWM) cause clicks in the example. At lower frequencies, modulating other timbral parameters and even applying a k-rate filter to them can greatly reduce this effect.

The filters

Comb filters

IIR & FIR comb filters implemented at low level, to add some character to the sound. Very interesting if used with a broadband signal, like white noise. You can tune them to a fairly high frequency for resonance like effects, or to the fundamental frequency of the expected timbre in white noise.

Special  filters

A 24 dB filter plus a reson at fco, a comb filter with a reson in the feedback loop (a sort of resonant filter), and a low pass-comb filter.

That Resonant Lowpass filter...

The classical 24 dB low pass filter with resonance.There are some other notable designs around there, particularly those from Hans Mikelson. This one sounds quite well and can even self-oscillate to give funny acid efects. For the perfeccionist use a fairly high sample rate (say 96000 Hz) and then downsample with a good anti-alias filter, like that included in Sound Forge 4. Here´s a sample of what you can do with it, filtering a bandlimited pulse wave (generated with buzz) and applying the same envelope to the resonance and the filter cutoff frequency (it sounds much better without that mp3 compression):

Roland TB 303 emulator

The same controls as the real thing, given the initial and final settings as p-fields in the score. The patterns are stored in tables also chosen in the score, so you only have to trigger the instrument and the sequencer works alone. The code is full of comments so you should be able to understand it.

Josep M Comajuncosas