pub struct SequenceStep {
pub parameters: Vec<ParameterTarget>,
pub duration_notes: f64,
}Expand description
A single step in a sequencer pattern.
Each step carries zero or more parameter locks (p-locks): specific
parameter values that are sent when the step becomes active. Parameters
not listed in parameters keep their current value — they are not
reset or cleared.
§Duration
duration_notes expresses the step length in quarter-note units at the
current tempo:
duration_notes | Musical duration |
|---|---|
| 4.0 | whole note |
| 2.0 | half note |
| 1.0 | quarter note |
| 0.5 | eighth note |
| 0.25 | sixteenth note |
| 1.5 | dotted quarter |
| … | any value >= 0 |
Fields§
§parameters: Vec<ParameterTarget>Parameter target locks for this step.
duration_notes: f64Step duration in quarter-note units.
Implementations§
Source§impl SequenceStep
impl SequenceStep
Sourcepub fn new(parameters: Vec<ParameterTarget>, duration_notes: f64) -> Self
pub fn new(parameters: Vec<ParameterTarget>, duration_notes: f64) -> Self
Create a new step with the given p-locks and duration.
Sourcepub fn single(
node_id: impl Into<NodeId>,
param: impl Into<String>,
value: f32,
duration_notes: f64,
) -> Self
pub fn single( node_id: impl Into<NodeId>, param: impl Into<String>, value: f32, duration_notes: f64, ) -> Self
Create a single-parameter step (convenience constructor).
Sourcepub fn duration_samples(&self, tempo: f32, sample_rate: f32) -> u64
pub fn duration_samples(&self, tempo: f32, sample_rate: f32) -> u64
Return the step duration in audio samples for the given tempo and sample rate.
quarter_note_samples = (60.0 / tempo) * sample_rate
Trait Implementations§
Source§impl Clone for SequenceStep
impl Clone for SequenceStep
Source§fn clone(&self) -> SequenceStep
fn clone(&self) -> SequenceStep
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SequenceStep
impl RefUnwindSafe for SequenceStep
impl Send for SequenceStep
impl Sync for SequenceStep
impl Unpin for SequenceStep
impl UnsafeUnpin for SequenceStep
impl UnwindSafe for SequenceStep
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more