rill_patchbay/sequencer/mod.rs
1//! # Parameter-lock step sequencer
2//!
3//! A sample-accurate, telemetry-driven sequencer for scheduling parameter
4//! changes over time. Supports parameter-lock (p-lock) style programming:
5//! each step specifies exactly which parameters change and to what value;
6//! unlisted parameters are untouched.
7//!
8//! ## Concepts
9//!
10//! - [`ParameterTarget`] — a single (node, param, value) lock
11//! - [`SequenceStep`] — a set of p-locks + duration
12//! - [`Pattern`] — a sequence of steps with a playback mode
13//! - [`Snapshot`] — a named collection of p-locks (convenience presets)
14//! - [`SnapshotSequencer`] — tick-driven state machine
15//!
16//! ## Clock source
17//!
18//! The sequencer is designed to be driven by the audio thread's `CLOCK_TICK`
19//! telemetry events. Each tick carries `(sample_pos, sample_rate, tempo)`,
20//! which the sequencer uses to determine step boundaries with sample accuracy.
21//!
22//! ## Integration
23//!
24//! Use [`Patchbay::attach_sequencer`](crate::engine::Patchbay::attach_sequencer)
25//! to spawn the sequencer task and start listening for clock ticks.
26//! A [`SequencerHandle`] is returned for external control (start/stop/pattern
27//! select).
28
29mod engine;
30mod pattern;
31mod snapshot;
32mod step;
33
34pub use engine::{SequencerCommand, SequencerHandle, SnapshotSequencer};
35pub use pattern::{Pattern, StepPlayMode};
36pub use snapshot::{ParameterTarget, Snapshot};
37pub use step::SequenceStep;