Filter blowouts: Is there a way to reset them?

Occasionally, using comb delays for a shroeder reverb or a rlpf filter, the audio gets so distorted a channel maxes out and I cannot hear any sound. Is there a reset function that can clear all the buffers and allows audio to restart?

You could conceivably use BufCombC and zero out the buffer (buffer.fill(0, buf.numFrames, 0), maybe buf.numFrames * buf.numChannels, I can’t verify right now) when a bad value is detected (see CheckBadValues, and also do a sig.abs > someThreshold) – the zeroing out won’t be instantaneous but it should be pretty quick.

The drawback is managing the delay buffers yourself. Also (should have checked the help), the server command reference for /b_fill says “This is only meant for setting a few samples, not whole buffers or large sections” so I’m not totally sure it would work.

CombC and its siblings have no reset capability.

hjh

Is the problem temporary until Cmd-., or permanent until scsynth restart? Also, are you on Mac? I remember experiencing problems where if a wacky value gets sent to CoreAudio, the application gets muted until I restart scsynth

If this is a result of DC build up, throwing in a HPF pre-filter should reduce the tendency to explode.

It’s temporary until a cmd . . And I do have a HPF in there to take out the DC offset. I’ll try shifting where the HPF is located. I’ll try putting in sane numbers first, the buffer idea sound good too. It’s the small region where the different filters go crazy that’s making interesting sounds.

I find all of these useful safety measures, especially when experimenting with close to the edge processes, feedback, etc:

  • mySig.tanh is a cheap way to limit the amplitude.
  • LeakDC.ar is a filter that removes DC offset.
  • mySig.sanitize / Sanitize.ar will replace any NaNs, infinities or denormals in the signal with zeros (or whatever you specify).

Best,
Paul

1 Like