Filter envelope

I defined a new envlpf effect for myself as follows:

~dirt.addModule('dirt_env_lpf', { |dirtEvent|
	dirtEvent.sendSynth('dirt_env_lpf' ++ ~dirt.numChannels,
		[
			env_lpf_freq: ~env_lpf_freq,
			env_lpf_dur: ~env_lpf_dur,
			env_lpf_attack: ~env_lpf_attack,
			env_lpf_resonance: ~env_lpf_resonance,
			out: ~out
		]
	)
}, { ~env_lpf_freq.notNil  }); // play synth only if at least one of the two was given

SynthDef("dirt_env_lpf" ++ ~dirt.numChannels, { |out, env_lpf_freq = 440, env_lpf_resonance = 0, env_lpf_dur = 1, env_lpf_attack = 0, env_lpf_curve = -4|
	var signal = In.ar(out, ~dirt.numChannels);
	var env_lpf = Env.perc(env_lpf_attack, env_lpf_dur - env_lpf_attack, env_lpf_freq - 20, env_lpf_curve).ar + 20;
	signal = RLPF.ar(signal, env_lpf, env_lpf_resonance.linexp(0, 1, 1, 0.001));
	ReplaceOut.ar(out, signal)
}, [\ir, \kr, \kr, \kr, \kr, \kr]).add;

and in Tidal I defined the function:

    envlpf freq dur att = pF "env_lpf_freq" freq # pF "env_lpf_dur" dur # pF "env_lpf_attack" att

and use it:

d1
$ n "0..7"
# s "juno"
# envlpf 2000 0.1 0.01

I find this effect useful for many cases, like creating pluck sounds or shaping percussive samples.

8 Likes