Cabbage Logo
Back to Cabbage Site

LFO Problem

Hey Rori,
I keep working with my Synth, now im on the LFO section. The problem is that i searched for the lfo op code, and its relativily easy to understand, but when i want to use lfo type 0,1 and 2, the sound crashes and make weird things. This when the LFO is controlling a LPF. With the HPF is even worse, It only works 1.
At the same time the options 7 and 8 from the LFO combobox, donest work too.
Do you know why maybe this is due to?

I pass you the code, is better testing this with a single square signal with maximum pitch (24), activating the LPF or HPF for this oscilator. I dont really know why this is caused.

Thank you Rory! :smiley:

Synth.csd (23.3 KB)

Can you prepare a simple example? There’s quite a lot going on here. Off the top of my head I remember having issues before when passing negative values as filter cut-off frequencies, could that be the issue here? If you prepare a simple version I can take a look. But I don’t really have time to dissect this right now as is…

I did a new simply code based on one you upload time ago. The problem is when i try to change the type of filters, some of them work and some of them no. When Lfo types dont work the program sound crashes. i dont know if it is due to my audio card or what. From the 8 LFO types, in my computer only work the 4,5,6 (klfotype == 4… 5…6) Any suggestion??

Test.csd (2.4 KB)

It’s because of the reason i gave you yesterday. You’re passing negative values to the moogladder filter. Some filters in Csound don’t seem to mind this, but I’ve found moogladder to be different Just swap this line:

aLP moogladder aOut, kLFO*kCutOff, kRes

with

aLP moogladder aOut, abs(kLFO)*kCutOff, kRes

It works fine for me when I do that.