Tabula Sonora 0.1.0
A native C++20 implementation of the Roland Sound Canvas VA synth voice
Loading...
Searching...
No Matches
ts::ChannelMask Class Reference

Per-channel mute and solo. More...

#include <tabulasonora/render_options.hpp>

Public Member Functions

bool is_audible (int channel) const noexcept
 Whether a channel should sound.
bool is_muted (int channel) const noexcept
bool is_soloed (int channel) const noexcept
bool any_soloed () const noexcept
void set_muted (int channel, bool muted) noexcept
void set_soloed (int channel, bool soloed) noexcept
void reset () noexcept
bool is_default () const noexcept
 Whether nothing is muted or soloed, so every channel sounds.

Static Public Attributes

static constexpr int channel_count = 64
 Parts the mask covers: sixty-four, port * 16 + channel.

Detailed Description

Per-channel mute and solo.

Read live so a mixer can change it while sound is running, and read where the engine mixes rather than where it starts notes: a part goes quiet on the next block and comes back on the one after, and a muted part goes on consuming polyphony exactly as an audible one does.

The flags are atomic because this is the one place in the library where two threads meet: a UI thread sets them while the render thread reads them on every note-on. Relaxed ordering is enough – each flag stands alone, nothing is published through it, and the only requirement is that a change is eventually seen and never seen half-written. That is what the reference build's Volatile bought too.

Member Function Documentation

◆ is_audible()

bool ts::ChannelMask::is_audible ( int channel) const
nodiscardnoexcept

Whether a channel should sound.

Solo wins: once anything is soloed, only soloed channels are audible regardless of mutes.

◆ is_muted()

bool ts::ChannelMask::is_muted ( int channel) const
nodiscardnoexcept

◆ is_soloed()

bool ts::ChannelMask::is_soloed ( int channel) const
nodiscardnoexcept

◆ any_soloed()

bool ts::ChannelMask::any_soloed ( ) const
nodiscardnoexcept

◆ set_muted()

void ts::ChannelMask::set_muted ( int channel,
bool muted )
noexcept

◆ set_soloed()

void ts::ChannelMask::set_soloed ( int channel,
bool soloed )
noexcept

◆ reset()

void ts::ChannelMask::reset ( )
noexcept

◆ is_default()

bool ts::ChannelMask::is_default ( ) const
nodiscardnoexcept

Whether nothing is muted or soloed, so every channel sounds.

Member Data Documentation

◆ channel_count

int ts::ChannelMask::channel_count = 64
staticconstexpr

Parts the mask covers: sixty-four, port * 16 + channel.

Sixteen for as long as the engine had one port. A four-port file addresses sixty-four parts and every one of them has to be mutable, or the mixer would silently refuse to touch three quarters of a score. Files that use one port only ever index the first sixteen.


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