Loading...
Searching...
No Matches
Media::Step::step_node Class Referencefinal

Plays the steps of one of several sequences. More...

Inheritance diagram for Media::Step::step_node:

Detailed Description

Plays the steps of one of several sequences.

A step lasts duration seconds, or when synced a fraction of a whole note, so that it follows the tempo. Either way the steps are counted from the start of the process: its first step plays as it starts, wherever that falls on the bars. A sequence asked for on sequence_select starts at its first step at the next point of the switch_quantification grid (Patternist's convention: 0 is at once, 1 a bar, above 1 a fraction of a whole note).

Public Member Functions

std::string label () const noexcept override
 
void request_sequence (int idx) noexcept
 
void set_duration (const ossia::value &v) noexcept
 A plain number is seconds; {value, mode}: mode 0 seconds, else synced.
 
void read_controls () noexcept
 
void run (const ossia::token_request &tk, ossia::exec_state_facade st) noexcept override
 
double step_quarters (const ossia::token_request &tk) const noexcept
 
void follow_jump (const ossia::token_request &tk) noexcept
 
void play_steps (const ossia::token_request &tk, double ratio, int64_t tick_start, bool rewinding, int64_t from, int64_t to) noexcept
 Plays the steps whose sample falls in [from; to[.
 
void play_step (int64_t sample, bool rewinding) noexcept
 

Public Attributes

ossia::value_inlet sequence_select
 
ossia::value_inlet switch_quantification
 
ossia::value_inlet duration
 
ossia::value_outlet out
 
std::vector< ossia::float_vector > sequences
 
int current_sequence {}
 
int pending_sequence {-1}
 Sequence the next quantification point switches to; -1 when none waits.
 
double switch_rate {1.}
 
double step_duration {0.0625}
 Seconds, or a fraction of a whole note when synced.
 
bool synced {true}
 
int current {}
 The step that plays next.
 
std::atomic_int last {-1}
 The step that played last; read by the UI thread.
 
double origin {}
 
int64_t next_date {std::numeric_limits<int64_t>::min()}
 Where the next tick starts if time goes on; anything else is a jump.
 

Member Function Documentation

◆ follow_jump()

void Media::Step::step_node::follow_jump ( const ossia::token_request &  tk)
inlinenoexcept

The process started, or the transport moved it: count the steps from its start again, and play on from the step the position falls in.

◆ step_quarters()

double Media::Step::step_node::step_quarters ( const ossia::token_request &  tk) const
inlinenoexcept

Length of a synced step, in quarter notes: as the quantification grid, a bar or more counts in bars.

Member Data Documentation

◆ origin

double Media::Step::step_node::origin {}

Musical position, in quarter notes, of the start of the process: synced steps are counted from it.

◆ sequences

std::vector<ossia::float_vector> Media::Step::step_node::sequences

The values to send, already mapped to [min; max]. The whole list, so that a switch moves an index rather than copying, on the audio thread.


The documentation for this class was generated from the following file: