# How to use a lowpass2 opcode to filter a vco2 signal

**URL:** <https://forum.cabbageaudio.com/t/how-to-use-a-lowpass2-opcode-to-filter-a-vco2-signal/625>\
**Category:** Csound Noobs\
**Created:** [20 July 2017 16:04 UTC](https://forum.cabbageaudio.com/t/how-to-use-a-lowpass2-opcode-to-filter-a-vco2-signal/625 "2017-07-20T16:04:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreyestevao](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@andreyestevao](https://forum.cabbageaudio.com/u/andreyestevao)\
**Post date:** [20 July 2017 16:04 UTC](https://forum.cabbageaudio.com/t/how-to-use-a-lowpass2-opcode-to-filter-a-vco2-signal/625/1 "2017-07-20T16:04:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [21 July 2017 15:31 UTC](https://forum.cabbageaudio.com/t/how-to-use-a-lowpass2-opcode-to-filter-a-vco2-signal/625/2 "2017-07-21T15:31:23Z")

</div>

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 :

> [@Csound filters demonstration](http://forum.cabbageaudio.com/t/csound-filters-demonstration/192):
>
> Anton Kholomiov posted some nice instruments to the Csound list today that show the subtle differences between Csound’s filters. I’ve ported his ‘dub-step’ filters examples it as a Cabbage instrument which you can try out here. It’s really quite interesting to hear the differences between the filters. I plan to port his other instruments when I get a chance. [CsoundFiltersWobble.csd](https://forum-next.cabbageaudio.com/uploads/default/original/1X/b55dbcfc68bf06efcaf85c8353ca108a979d781c.csd) (4.1 KB) Here are some short sound files demonstrating the various filters. [dub-moogvcf.mp3](https://forum-next.cabbageaudio.com/uploads/default/original/1X/eed5c8191060865cc16277a9faee5412f631b059.mp3) (706.1 KB) [dub-svfil…](https://forum-next.cabbageaudio.com/uploads/default/original/1X/9bddef1b777d5780d4e8952e5b392ad0663e19e1.mp3)

---

<div class="post-metadata">

**Author:** ![andreyestevao](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@andreyestevao](https://forum.cabbageaudio.com/u/andreyestevao)\
**Post date:** [21 July 2017 17:23 UTC](https://forum.cabbageaudio.com/t/how-to-use-a-lowpass2-opcode-to-filter-a-vco2-signal/625/3 "2017-07-21T17:23:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [21 July 2017 17:29 UTC](https://forum.cabbageaudio.com/t/how-to-use-a-lowpass2-opcode-to-filter-a-vco2-signal/625/4 "2017-07-21T17:29:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [24 July 2017 12:59 UTC](https://forum.cabbageaudio.com/t/how-to-use-a-lowpass2-opcode-to-filter-a-vco2-signal/625/5 "2017-07-24T12:59:45Z")

</div>

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](http://csound.github.io/docs/manual/abs.html) opcode which always returns a positive number.
