Note stealing

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Is there any clever way to make note stealing unnoticeable so that the stolen note, when it ends abruptly, doesn't make a clicking sound?

Imagine extreme case if we had polyphony of one and had to steal the one and only note we could use:
- First the note is playing regularly.
- We steal the note: the waveform has 0 samples time to finish off playing so the waveform is cutoff immediately.
- A new note starts playing using that same voice instance.

Does anyone have any clever tricks to minimise these kinds of issues or is the only way to save extra hidden voices for note stealing situations?

Post

You can create a short buffer containing 'smooth transitions to zero' so that when an oscillator cuts off you then add an appropriately scaled transition (scaled by the oscillator's final value) to be mixed in with subsequent output - a bit like the MinBlep technique except you're aiming for something smooth and as inaudible as possible. The transitions could be linear or exponential decaying values, or something higher order if you prefer.

Alternatively you can just store the final ouput value of the oscillator in a variable and let it exponentially decay by multiplying by something just under 1 each sample (or linearly decay by moving towards 0 by a small fixed amount), adding the value of that decay variable to the output on each subsequent sample. It isn't perfect but it's much less audible than an abrupt cutoff.

I guess if you wanted to get really fancy, and depending on the osc type, you may be able to generate a buffer containing a short burst of 'future oscillator output' and apply a rapid decay to it, then mix that in with the future output.

Post

I'm trying to avoid having to render the whole voice on top of the next one, so I'll first try if I can get good enough results using the first method you mentioned. Sounds plausible. I'll report back here sometime next week when I have time to test it out.

Thanks! :)

Post

Kraku wrote: Fri Mar 17, 2023 12:49 pm I'm trying to avoid having to render the whole voice on top of the next one, so I'll first try if I can get good enough results using the first method you mentioned. Sounds plausible. I'll report back here sometime next week when I have time to test it out.
Actually I'd rather suggest the second method... because you actually only need one shared decay for all killed voices: you have one-pole mixed to output that decays.. and when you kill the voice you take the last sample it generated (after envelopes and all) and you add that to your decaying one-pole's state. Thanks to the magic of addition a single one-pole can now fade out any number of voices.. sort of.

Another trick for analog (and VA, but the point is this can be done with real analog) synthesis specifically is to just restart your envelopes from whatever value they had rather than resetting to zero. This works particularly well if you don't reset anything else in the voice either, rather just let it transition into a different note, but it does feel a bit different from "we're pretending we have infinite polyphony" so it's a design decision that depends on what you're going for.

Post

I tried using the method of "fade out the oscillator's last sample over a period of time". That didn't give me satisfactory results. I have to try something else then. I'll try tweaking it some more and see if it works or not. I used exponenially decaying curve.

EDIT:
I take that back. I had to use much more longer decay than I thought to actually get any descent results. This might actually work.

Post

Final verdict:
It worked well. No clicks nor pops anymore.

Thank you both of you! :)

Post Reply

Return to “DSP and Plugin Development”