pub enum SampleTimeSpec {
Periodic {
period: f64,
offset: f64,
},
Variable,
}Expand description
How a CScript/PyBlock/PyFunction/OctFunc block’s own execution is scheduled, independent of
the circuit’s own resolved step (see each BlockKind variant’s own sample_time field).
Variants§
Periodic
A fixed sample period period (from ts=/freq=), with an optional phase offset
(from to=, required to satisfy 0.0 <= offset < period) delaying when the first hit
lands. Every hit after the first is spaced by exactly period.
Default, when to= is omitted: offset == 0.0 — this preserves the exact
pre-existing behavior every ts=/freq=-using netlist already had before this field
could carry an offset at all: dae-runtime seeds its own per-instance accumulator so the
first evaluate_blocks call a block participates in is always due, unconditionally,
regardless of period’s own value (verified directly against dae-runtime’s own
construction code, not assumed) — i.e. the pre-existing behavior already was “no
offset,” not “one period’s delay” as it might look at first glance. An explicit to=X
(0 < X < period) genuinely delays the first hit to t=X instead.
Fields
Variable
The block computes its own next execution time itself, every time it runs (ts=variable
in the netlist) — for a block whose own next event is known analytically at runtime (a
modulator’s own scheduled switching instant) rather than fixed at parse time. Requires
the backing .so/.py to export the corresponding optional next-sample-hit
function/symbol; see cscript_ffi’s/pyblock_ffi’s own module doc comments. Not
available for BlockKind::PyFunction/BlockKind::OctFunc (rejected at parse time) —
a stateless function call has no instance to remember a requested next-hit time against.
Trait Implementations§
Source§impl Clone for SampleTimeSpec
impl Clone for SampleTimeSpec
Source§fn clone(&self) -> SampleTimeSpec
fn clone(&self) -> SampleTimeSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more