pub struct Latch {
pub name: String,
pub arm: Expr,
pub fire: Expr,
pub hold: f32,
}Expand description
One [latch] entry, compiled (ADR-0137): a gate armed on one condition and
fired by the first rising edge of another inside the arming window.
Its slot is its position in Preset::latches, and that is the only
place the mapping exists: the loader resolved the author’s name onto a
reserved variable slot while compiling the bindings, so nothing per-frame
looks a latch up by name. The same reasoning that keeps [smoothing] off
Preset as a table — a fact about the preset, resolved once, and the
preset does not change while it renders.
The two expressions are compiled without any latch name in scope, so a latch cannot read a latch. That is not a restriction waiting to be lifted: it is what makes “evaluate every latch, then the params that read them” a complete order rather than one with a dependency graph inside it.
Fields§
§name: StringThe author’s name for it, which its bindings reference.
arm: ExprWhile this holds (> 0.5), the latch is armed. Its fall re-arms.
fire: ExprThe rising edge that fires an armed latch.
hold: f32How long the fired latch reads 1.0, in seconds. 0 is one frame.