Loading...
Searching...
No Matches
Nodes::Looper::pass_stack< Store, Pass, MaxLayers > Struct Template Reference
Inheritance diagram for Nodes::Looper::pass_stack< Store, Pass, MaxLayers >:
Nodes::Looper::tagged_pass_stack< midi_loop, midi_pass, 32 > Nodes::Looper::tagged_pass_stack< value_loop, tagged_pass, 32 > Nodes::Looper::tagged_pass_stack< Store, Pass, MaxLayers > Nodes::Looper::midi_loop Nodes::Looper::value_loop

Detailed Description

template<typename Store, typename Pass, int MaxLayers>
struct Nodes::Looper::pass_stack< Store, Pass, MaxLayers >

The passes of a loop, one over the other, whatever they hold.

A pass is the first recording or an overdub on top of it. Undo hides the newest one and redo shows it again; erase takes one out for good; mute keeps one but does not hear it; a pass past Max layers is merged with another, or takes the place of one, which is set aside for undo to put back. The stack does the bookkeeping of all of it, the same for every looper: which passes are heard and which redo brings back, the length each one repeats with, the length of the loop before and after each one, which ones are muted, the layer set aside and the merge undo can take apart.

Pass holds, besides what the looper keeps of its own for a pass (a buffer, a gain...), period, loop_before, loop_after and muted, and is copied whole as the passes move. What a pass recorded may instead be kept apart, each piece tagged with the index of its pass and with the passes that replace it, e.g. MIDI events: Store moves those along as the passes move, through these hooks, which tagged_material below implements for any such piece:

void passes_changed(); // what is heard of the passes changed bool may_remove(int k) const; // pass k can be erased or set aside now void muting(int k); // pass k is about to be muted or unmuted void removing(int k); // pass k is about to be erased or set // aside: the passes over it move down void erased(int k); // pass k is erased: its material goes void aside_taken(int k); // pass k goes to the side void aside_returned(int k); // the pass set aside comes back at k void aside_forgotten(); // the pass set aside is gone for good void redo_dropped(bool aside); // passes from count on are gone for // good, the one set aside kept if aside void unmerge_dropped(); // the last merge cannot be undone now void unmerged(int at); // the last merge, of at and the pass // over it, is undone void cleared(); // every pass is gone void undoing(); // undo or redo is about to act

Classes

struct  aside_state
 
struct  unmerge_state
 

Public Member Functions

bool empty () const noexcept
 
Pass * top () noexcept
 
int64_t period_of (const Pass &l) const noexcept
 
int64_t period_of (int pass) const noexcept
 
int64_t merged_period (const Pass &a, const Pass &b) const noexcept
 The period two passes merged into one repeat with.
 
bool extend (int64_t unit, int64_t max_length, bool top_open=true) noexcept
 
bool set_muted (int k, bool m) noexcept
 Mutes or unmutes pass k, k being heard.
 
void clear () noexcept
 
Pass & begin_first_pass () noexcept
 Forgets every pass for a recording: its pass, the first one.
 
Pass & push_pass () noexcept
 Adds a pass over the ones heard, room having been made for it.
 
void drop_redo () noexcept
 
void forget_aside () noexcept
 Forgets the layer set aside.
 
void drop_unmerge () noexcept
 Undo is not to take the last merge apart: what it kept for that goes.
 
void set_aside (int k) noexcept
 
int returns_on_undo () const noexcept
 Undoing the top pass puts back the layer it replaced: where it goes.
 
int leaves_on_redo () const noexcept
 
void put_back () noexcept
 
bool undo () noexcept
 
bool redo () noexcept
 
bool erase (int k) noexcept
 
void begin_merge () noexcept
 A merge is about to be worked out: what it would make stale goes.
 
void merged (int at, const Pass &merged, bool undoable, const Pass &a, const Pass &b) noexcept
 
Pass merged_pass (const Pass &a, const Pass &b) const noexcept
 
bool replaced (uint64_t by, int self_pass, bool taking) const noexcept
 

Static Public Member Functions

static int64_t period_in (const Pass &l, int64_t loop_length) noexcept
 The length a pass repeats with in a loop of loop_length frames.
 

Public Attributes

std::array< Pass, max_passes+1 > layers {}
 The passes heard, then the ones redo brings back.
 
int count {}
 Passes heard.
 
int total {}
 Passes kept, the ones past count being what redo brings back.
 
int64_t length {}
 Frames in the loop.
 
uint64_t pushes {}
 
struct Nodes::Looper::pass_stack::unmerge_state unmerge
 
struct Nodes::Looper::pass_stack::aside_state aside
 
merge_log merged_passes
 

Static Public Attributes

static constexpr int max_layers = MaxLayers
 Most layers kept: Max layers is at most this.
 
static constexpr int max_passes = max_layers + 1
 A pass past Max layers is one more until it is merged.
 

Member Function Documentation

◆ drop_redo()

template<typename Store , typename Pass , int MaxLayers>
void Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::drop_redo ( )
inlinenoexcept

Drops what redo would bring back. A layer set aside is kept, for undo, unless it is back.

◆ erase()

template<typename Store , typename Pass , int MaxLayers>
bool Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::erase ( int  k)
inlinenoexcept

Takes pass k out of the loop, k being heard and not the only one heard: the passes over it and the ones redo brings back move down a place, and the loop keeps its length.

◆ extend()

template<typename Store , typename Pass , int MaxLayers>
bool Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::extend ( int64_t  unit,
int64_t  max_length,
bool  top_open = true 
)
inlinenoexcept

The top pass goes on past the end of the loop: the loop grows by unit frames, and the passes under it play again over the new part. False when the loop would be longer than max_length. Without top_open, the pass going on is not in the stack yet: every pass plays again.

◆ leaves_on_redo()

template<typename Store , typename Pass , int MaxLayers>
int Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::leaves_on_redo ( ) const
inlinenoexcept

Redoing the pass that replaced a layer takes that layer out again: the one that goes.

◆ merged()

template<typename Store , typename Pass , int MaxLayers>
void Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::merged ( int  at,
const Pass &  merged,
bool  undoable,
const Pass &  a,
const Pass &  b 
)
inlinenoexcept

Pass at and the one over it, a and b as they were, are now one pass, merged, in the place of at. With undoable, undo takes b out again as long as nothing else changes the passes.

◆ merged_pass()

template<typename Store , typename Pass , int MaxLayers>
Pass Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::merged_pass ( const Pass &  a,
const Pass &  b 
) const
inlinenoexcept

The pass a and b heard one over the other become, before what the looper keeps of its own for it: a muted pass merged with one that is not is lost, and both muted, the merged pass is muted.

◆ put_back()

template<typename Store , typename Pass , int MaxLayers>
void Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::put_back ( )
inlinenoexcept

The layer set aside goes back to its place, the passes from there on, the ones redo brings back included, moving up a place.

◆ replaced()

template<typename Store , typename Pass , int MaxLayers>
bool Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::replaced ( uint64_t  by,
int  self_pass,
bool  taking 
) const
inlinenoexcept

One of the passes of by replaces material of pass self now: it is heard, not muted, and not the pass being taken in when taking, which replaces as it goes. The material's own pass, for a pass made of two merged ones, replaces it whatever.

◆ set_aside()

template<typename Store , typename Pass , int MaxLayers>
void Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::set_aside ( int  k)
inlinenoexcept

Takes pass k out of the passes heard for a pass about to start, keeping it for undo: the passes over it move down a place.

Member Data Documentation

◆ pushes

template<typename Store , typename Pass , int MaxLayers>
uint64_t Nodes::Looper::pass_stack< Store, Pass, MaxLayers >::pushes {}

Counts the passes added over the ones heard: whether a pass asked for got a place.


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