MASAAEOADS # 5: Env Follow

SuperCollider has many UGens* for analysing real-time audio signals. Amplitude is one such UGen, which can act as an envelope follower.

The advantages of performing this task digitally are that separate values may be given for the up and down lag (or slew) times, and I can have as many of them as my soundcard has hardware inputs. (Doepfer’s A-119 looks great, but if I want 8 envelope followers, that’s 64 units of rack space and 520 euros down the drain. 8 lines of code is somewhat more economical.)

Here is my envelope following patch:

SynthDef(\ampToCV, { |audioInBus = 99, outLo = 0.0, outHi = 1.0, lagU = 0.0, lagD = 0.0, audioOutBus = 99|

var audioIn = SoundIn.ar(audioInBus);

var cvOut = Amplitude.ar(audioIn).range(outLo, outHi).lagud(lagU, lagD);

Out.ar(audioOutBus, cvOut);

}).send(s);

The lag up and down times can actually be provided to the Amplitude UGen directly, but I make the lag explicit as a personal preference.

It’s possible that even if you know nothing about programming, you can follow what happens here: an audio input is generated, the amplitude of this input is analysed, a lag is applied and this “signal” is mapped to a new range (perhaps only positive values, or whatever range proves useful.) Then this control signal is sent to a hardware audio out, to be put into the control input of a synth module.

Here are some audio demos:

The envelope is used to modulate the frequency of a resonating filter: first positively, then negatively:

Env Follow to Frequency, Positive and Negative

The negative and positive signals are used with two different resonating filters:

Dual Env Follow to Frequency

The output of one filter additionally modulates a CV input of the other.

Dual Env Follow Frequency Modulation

The envelope is used to control the delay time of the Doepfer A-188-1X BBD module, as the signal is put through its audio input. Various combinations of positive / negative CV control and positive / negative feedback are selected, and the delay time manually adjusted:

Env Follow to BBD Delay Time

Finally, a low frequency saw is added to this control signal:

Env Follow to BBD plus Saw

* (unit generators, or chunks of code which generate, filter or analyse audio)

This entry was posted in code, music and tagged , , , . Bookmark the permalink.

Leave a Reply