Smoothing control moves

When you jump a level or a Mix, these effects walk the output to the new setting over 20 ms instead of stepping there, so the jump doesn’t click. That covers a patch change’s levels, a MIDI value that leaps, and a host setting Mix from 0.3 to 1.0 in one call: Bitcrusher, Chorus, CombFilter, Compressor, DeEsser, Distortion, DynamicEQ, Exciter, Fuzz, MultibandCompressor, Overdrive, Phaser, Saturation, Tremolo and Vibrato, with the exceptions below. The Mix of DigitalDelay and PingPongDelay and SlapbackDelay’s Level walk too, since their delay node does, and so do the Mix of Flanger and Reverb.

A few moves still step. Some filter corners move at once, and so do a switch and a patch change that rebuilds part of a graph. LadderFilter’s Cutoff, Resonance, Drive and Passband Comp walk over the same 20 ms as its Mix. Until the rest walk too, send such a jump as small steps, one a block: the delays’ own tests show Mix moved in 127 steps, one a block, steps the output by less than one and a half times the steepest step of the tone going through it. The rest is on the roadmap.

Which controls ramp, and for how long

Every control that scales a signal ramps: Mix, Level, Volume, Output and Makeup, a band’s gain, a wet or dry gain, and a modulation depth. A move walks in a straight line over 20 ms, the time audioecho.FeedbackDelay already takes for its wow depth. That is short enough to sound like the knob you turned, and the lifecycle matrix’s step property (below) holds it to not clicking.

Mix 0 is still your signal, byte for byte. An effect that hands you the source itself there walks its graph to the dry first and switches once the walk has landed, and walks back in from the dry when Mix leaves 0. AirSpace, PitchShifter and ShimmerHall build their graph only when Mix first leaves 0, and empty it on each return; either way the graph comes in at the source’s levels and walks to Mix’s from there. DeEsser’s Range 0 works the same way, and Tremolo’s Depth 0 walks there and back too. PitchShifter’s shifted voice starts from an empty line, so it arrives a window, about 20 ms, after Mix leaves 0; its input fades in over 20 ms, so the voice arrives faded in.

A delay’s Time is not ramped here: it already glides, at the rate its Glide control sets. A filter corner that jumps steps the output too, more quietly than a level does. LadderFilter’s node walks its cutoff, in octaves, and its other settings across the same 20 ms; the corners that still jump come next, the same way. LowPass, BandPass and Notch sit on audiobiquad.Biquad, which walks its corner, Q and shape over 20 ms. When Q drops, a notch or a band-pass keeps its level through the walk rather than swelling past its input. On a narrow or resonant setting the walk still sweeps the filter across what you play, the way a fast turn of the knob would.

A switch, or a patch change that rebuilds part of a graph, will crossfade from the old graph to the new over the same 20 ms instead of cutting.

Where the ramp lives

In the nodes, in audiodsp. A ramp has to move once a sample to be smooth, and an effect class runs Python only when a control is called, never while its output is pulled. A ramp stepped from Python moves once a block at best, and only if the host calls something every block. Built into the node, the ramp costs a multiply a sample, runs on every interpreter and every board, and reaches anyone using the bare nodes too, CircuitPython users included.

The nodes that walk are audiomixer.Mixer’s voice levels (its level_ramp), the Waveshaper’s mix and post_gain, the Biquad’s and the AllPass’s mix, the Dynamics node’s makeup, the FeedbackDelay’s and audioverb.Tank’s mix, audiodelays.Flanger’s mix (its mix_ramp, which is 0 unless a class sets it) and audiomath.Multiply’s mix. An audioroute.Port told play(source, after=frames) keeps playing what it plays until a walk has landed, which is how Mix 0 switches to the source without a cut.

When it is done

The plan is done when the lifecycle matrix’s step property (P5 in tests/support/LIFECYCLE.md) holds for every class with no exception declared for a control that jumps, and each class’s docstring drops the sentence that says a jump steps the output.