Cabbage Logo
Back to Cabbage Site

Expression Pedal Filter

Hello!

Noob’s first time posting here.

I’m working on a real-time synth that has two LP filters, one is controlled by an envelope (expsegr), the other is controlled by an expression pedal.

My problem is that the expsegr does not update the cutoff frequency in the middle of a note. It uses i-rate variables so the sustain level frequency that is set at the start of the note cannot update mid note. I would like to be able to swell the cutoff frequency with the foot pedal higher than the expsegr sustain value, if that makes sense. Like, an envelope that is scaled at k-rate corresponding to the expression pedal values.

Are there any envelope generators that use k-rate variables? Or should I be looking for a different solution?

While I’m at it, any resources on reducing latency? I find that the exponential envelopes sound better than the linear ones but so far they introduce more latency, if I’m not wrong.

Thanks so much for your time and help.

Sam

I hope my patch makes sense.

mono saw Foot CC Forum.csd (1.8 KB)

Can you use the value from the expression pedal to scale the expsegr output (it outputs either a-rate or k-rate) to get the values you want?

I’m imagining that heel down could be the normal output from expsegr (scale by 1) and toe down would scale up by some factor.

Pseudocode:
alpha = 1 ; scaling factor for doubling the envelope in toe down. Figure out what works
kEnvelope_combined = (1+alpha*kExpression) * (kExpsegr_env)

I was going to suggest the same. :slight_smile:

With regards to the latency, reduce your ksmps to 32 for a start. And you can go lower if your hardware can handle it. Exponential envelopes shouldn’t have any direct effect on latency, but I guess the fact that have a non lineaer fade in might lead one to think they do.