Portable gain product¶
ravet_gain::parameter_schema() describes gain (ID 1, 0 through 4, default 1)
and bypass (ID 2, boolean 0/1, default off). GainProcessor::parameter_state()
captures both requested values. restore_parameters revalidates against the
product schema before changing either value and snaps smoothing to restored gain.
Call it only from the thread that owns the processor, after receiving a complete
snapshot. For cross-thread state transfer, use the snapshot mailbox,
retain old data on contention, and apply accepted restores at callback boundaries.
The processor does not own a cross-thread restore mailbox.
state::encode_parameters writes a 32-byte version-two complete record using
the existing RAVETGN\0 identity. decode_parameters reads version two or
explicitly migrates the existing 20-byte version-one gain record with bypass off.
The legacy GainState encoder/decoder remain version one. CLAP now advertises
both gain and stepped bypass, saves version two and loads both versions. Its
product control bridge provides committed-edit gestures and
meter reads; a default macOS embedded gain GUI now supplies graphical controls. See gain session
state for the coherent host restore protocol.
Bypass parameter events switch before their sample. Values below 0.5 mean off; values at or above 0.5 mean on. Nonfinite values reject the whole event stream. Bypass copies dry input, with no crossfade, latency compensation or tail policy. Gain smoothing continues while bypassed, so leaving bypass uses the gain reached at that point. Zero-frame events update parameters without advancing smoothing. Reset and reprepare preserve bypass; reset snaps gain and clears meter readings. Abrupt bypass changes can click.