cosinekitty / sapphire

Sapphire - free modules for VCV Rack 2
GNU General Public License v3.0
24 stars 3 forks source link

Gravy - bug or design issue at high resonance #73

Open DaveBenham opened 5 hours ago

DaveBenham commented 5 hours ago

High intensity input into Gravy with high resonance can result in some type of clipping, where the output suddenly goes to 0V for a short period of time, and then returns to normal - it really detracts from the otherwise wonderful output. It seems to happen when the cutoff frequency is tuned to match one of the components of the input, and it swells out of control, then slams shut (0V), then swells again, etc.

I first noticed this while experimenting with the Benjolin Oscillator pinging Gravy. The output is glorious. It may be my favorite VCF for the Benjolin if this can be fixed.

Maybe introduction of some tanh saturation clipping can help?

cosinekitty commented 4 hours ago

It sounds like you are hitting Gravy's 100V limit where it automatically resets itself. It will drop to 0V output for a quarter second, then start working normally again (at least until another reset). I was concerned about the stability of the filter, especially with high resonance settings. Before I added auto-reset, there were cases where the filter would spiral out of control (NAN or INF) and get stuck there until I manually re-initialized it, which caused it to lose all its parameter settings too.

I am open to multiple modes, which could include a tanh (or bicubic) limiter, the existing auto-reset, or maybe something else too? Or maybe 100V is just too small a limit? (I thought 100V was rather large and would not be encountered by many people.)

In the meantime, maybe try a lower setting on the GAIN control? This might not be a satisfactory workaround, but it could help prevent the auto-resets until I get something new released.

DaveBenham commented 4 hours ago

Yeah, I was just looking at the code and found the 100V limit. I agree, that should be more than enough.

The problem with gain adjustment is the inputs and cutoff frequency are constantly changing. Most of the time the output level is perfect, but then every now and then out of control resonance kicks in. I don't see a way to mitigate that other than to introduce a limiter within the module. A saturation limiter might actually be a nice feature, beyond solving this problem.

cosinekitty commented 3 hours ago

I'm working on using the same automatic gain control (AGC) that I use for Tube Unit and Elastika. It is an adaptive limiter that should work well. @DaveBenham I'll post back here to let you know when I have a test build for you to play with.