Skip to main content

generate

Function generate 

Source
pub fn generate(
    block: &PatternBlock,
    origin: i64,
    from: i64,
    to: i64,
    pending: &mut PendingOffs,
    out: &mut impl EventSink,
)
Expand description

Write every event one pattern produces between from and to.

Pure apart from pending, which is the caller’s note-off table: the same call with the same table produces the same events, which is why the bounce can run it once over a whole cycle and get what the audio thread produces over hundreds of callbacks.

origin is the tick the pattern’s step 0 is anchored to — 0 for a pattern playing on its own, and the start of the chain entry when a chain is running. Nothing here keeps a cursor: which step fires is derived from the tick, every time.