pub struct PendingOffs { /* private fields */ }Expand description
Every note this track is holding, oldest first.
Oldest-first is maintained by removing with a shift rather than a swap, which is what makes “overflow forces off the oldest” a one-line operation on a table of thirty-two. The shift is at most 32 moves of 24 bytes.
Implementations§
Source§impl PendingOffs
impl PendingOffs
pub const fn new() -> Self
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Forget everything without sounding an off. For a panic, where the instruments are being reset underneath us anyway.
Sourcepub fn hold(
&mut self,
lane: usize,
note: u8,
due: Option<i64>,
now: i64,
out: &mut impl EventSink,
)
pub fn hold( &mut self, lane: usize, note: u8, due: Option<i64>, now: i64, out: &mut impl EventSink, )
Note that note is sounding on lane.
When the table is full the oldest note is turned off at now and its
slot reused. Never drops the new note: a note with no off in the table
is a note nothing will ever stop.
Sourcepub fn end_lane(&mut self, lane: usize, at: i64, out: &mut impl EventSink)
pub fn end_lane(&mut self, lane: usize, at: i64, out: &mut impl EventSink)
Turn off everything held on lane, at at.
Called immediately before a lane’s next onset, which is what ends a tied note and what keeps a gate longer than a step from running over its own next hit.
Sourcepub fn emit_due_before(&mut self, tick: i64, out: &mut impl EventSink)
pub fn emit_due_before(&mut self, tick: i64, out: &mut impl EventSink)
Turn off everything whose off is due before tick, each at its own
due tick.
Trait Implementations§
Source§impl Clone for PendingOffs
impl Clone for PendingOffs
Source§fn clone(&self) -> PendingOffs
fn clone(&self) -> PendingOffs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more