Cabbage Logo
Back to Cabbage Site

How to use a lowpass2 opcode to filter a vco2 signal

Hi,

I´m trying to lowpass a vco2 signal using the lowpass2 opcode like this:

;omitted variable settings
kEnv madsr iAtt, iDec, iSus, iRel 
aOut vco2 iAmp, iFreq, iShape

;ommited variable settings again --> new attack, new decay, new sustain and new release variables

kEnvF madsr iAttF, iDecF, iSusF, iRelF
aLp lowpass2 aOut, iCutOff, iRes

outs aLp * kEnvF, aLp* kEnvF

With this configuration, I can only apply ADSR values on AMP using kEnvF variable values. How I can apply the other variable KEnv ADSR values to create a ADSR FILTER effect?

Hello,
I am not guru, but I think you should use kvalues in your lowpass2 filter. .

aOut lowpass2 ain, kEnvF*kCutOff, kQ

You can also use a lfo.

kLfo lfo 50,  4  ; amplitude 50 at 4hz
kLfo =(kLfo+50.001)*0.5 ; this avoids crossing  value 0 and in case of cut-off initial value below 50, cut-off value will always be positive. 

aOut lowpass2 ain, kEnvF*(kLfo+kCutOff) , kQ

The cut-off will change from cut-off init value and cut-off init value + 50 … Four times per sec

You can have a look at this post for inspiration if you wish :

1 Like

Hello @Karamel1

Thanks for your response.

I got it! I did a

aOut lowpass2 ain, (kEnvF*kCutOff) + 0.00001 , kQ

And the things started to work as I wish! But sometimes I didn´t heared nothing before add + 0.00001 after the cutoff value… Do you know why? Is because of the crossing value discribed in comment above?

Well, i suspect that

aOut lowpass2 ain, 0, kQ 

is out of the bounds of the filter… what is a filter cut off frequence of 0 ? Maybe, it means cut them all… meaning no sound.

Try a LFO with it… it is really fun .

BTW, you can also apply enveloppe to the kQ factor , as well as a lfo.

1 Like

A lowpass cutoff of 0 should block all signals from coming through. Some Csound filters seem to handle negative frequencies but not all of them. In order to keep everything positive you can also use the abs opcode which always returns a positive number.