Sample-timed events and automation¶
ravet_foundation::Event carries a frame offset and ravet_foundation::EventData. Offsets belong to the current block; they are not absolute timestamps or an instruction to wait for wall-clock time.
Translate a clip schedule into callback offsets¶
The offline helper keeps an absolute schedule. For each block beginning at start, it copies events before the block's exclusive end into fixed storage and subtracts start. An event exactly at end stays pending for the next block at offset zero. Only the occupied event slice is borrowed by ProcessBlock.
This preserves ordering even when two events share a frame. It also makes a sample at frame 72,007 independent of whether the renderer partitions its clip into 64-, 128- or 256-frame blocks.
Validate first, apply second¶
A valid event stream fits the prepared capacity and is in nondecreasing offset order. For a nonempty block, an offset equal to the frame count is outside the block. Zero-frame blocks accept offset-zero events without advancing sample state. Finite parameter values may still violate a particular processor's physical range.
The delay preflights every known parameter event before writing a ring or changing a target. If a later event is invalid, earlier events in that block are not committed. See ravet_foundation::ProcessConfig::validate_block and the offline scheduling helper.
Automation is not the same as smoothing¶
An event takes effect at its exact offset. A smoother determines the subsequent sample trajectory. ravet_signal::LinearSmoother advances once per frame, not once per channel. A target change starts from the current effective value; an identical target does not restart a ramp.
The example delay uses 20 ms for time and 5 ms for feedback, wet mix and ping-pong routing. Bypass is immediate. Moving the read position changes pitch briefly; it is not a crossfade between two stationary delays.
Native MIDI has a different timing boundary¶
The live example polls MIDI with a bounded budget and applies accepted short messages at the next processing block. It does not convert native arrival timestamps into sample offsets. The offline fixtures demonstrate sample timing; that does not establish sample-accurate live input timing.