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

The coefficient sets for the three GS send effects. More...

#include <tabulasonora/effect_presets.hpp>

Public Member Functions

const ReverbPresetsreverb () const noexcept
const ChorusPresetschorus () const noexcept
const DelayPresetsdelay () const noexcept
const EqPresetseq () const noexcept
 The EQ coefficient tables.
bool has_eq () const noexcept
 Whether EQ coefficients are available.

Static Public Member Functions

static const EffectPresetsdefaults ()
 The presets in use.
static void ensure_from (const RomImage &rom)
 Computes the presets from the DLL, unless a set is already in force.
static void use (EffectPresets presets)
 Supplies presets explicitly, for a host that manages its own data files.
static bool available ()
 Whether presets are available, without throwing.
static EffectPresets from_parts (ReverbPresets reverb, ChorusPresets chorus, DelayPresets delay, EqPresets eq={})
 Assembles a preset set from computed parts.
static EffectPresets parse (std::string_view json)
 Parses presets from a JSON document.

Static Public Attributes

static constexpr std::string_view path_variable = "TABULASONORA_PRESETS"
 Environment variable that overrides where presets are read from.

Detailed Description

The coefficient sets for the three GS send effects.

Computed from the DLL rather than fitted to audio: EffectProgrammer decodes the reverb and chorus coefficients out of the engine's own preset tables, and the delay presets come straight from its preset table. Within each effect the topology is identical across all types — only these numbers change, which is why one implementation runs every type unchanged.

Member Function Documentation

◆ defaults()

const EffectPresets & ts::EffectPresets::defaults ( )
staticnodiscard

The presets in use.

Throws std::runtime_error if none have been supplied and none could be found. Ordinarily nothing needs to be done: opening a NoteRenderer computes them from its ROM.

◆ ensure_from()

void ts::EffectPresets::ensure_from ( const RomImage & rom)
static

Computes the presets from the DLL, unless a set is already in force.

An explicit use, an environment override and a file beside the executable all take precedence — they exist so a host can pin a harvested set, and a computed set must not silently replace one. In the ordinary case none of those is present and this fills in the computed presets, which match a live harvest bit for bit — see EffectProgrammer.

◆ use()

void ts::EffectPresets::use ( EffectPresets presets)
static

Supplies presets explicitly, for a host that manages its own data files.

◆ available()

bool ts::EffectPresets::available ( )
staticnodiscard

Whether presets are available, without throwing.

◆ from_parts()

EffectPresets ts::EffectPresets::from_parts ( ReverbPresets reverb,
ChorusPresets chorus,
DelayPresets delay,
EqPresets eq = {} )
staticnodiscard

Assembles a preset set from computed parts.

◆ parse()

EffectPresets ts::EffectPresets::parse ( std::string_view json)
staticnodiscard

Parses presets from a JSON document.

Throws std::runtime_error if the document is not a well-formed preset set.

◆ reverb()

const ReverbPresets & ts::EffectPresets::reverb ( ) const
inlinenodiscardnoexcept

◆ chorus()

const ChorusPresets & ts::EffectPresets::chorus ( ) const
inlinenodiscardnoexcept

◆ delay()

const DelayPresets & ts::EffectPresets::delay ( ) const
inlinenodiscardnoexcept

◆ eq()

const EqPresets & ts::EffectPresets::eq ( ) const
inlinenodiscardnoexcept

The EQ coefficient tables.

These are read from the DLL and are not part of the JSON round trip, unlike the other three: there is nothing to harvest, because the engine stores every setting rather than deriving it. A set parsed from a pinned presets.json therefore carries no EQ, and is_present says so — the EQ stage passes audio through untouched rather than pretending to be flat.

◆ has_eq()

bool ts::EffectPresets::has_eq ( ) const
inlinenodiscardnoexcept

Whether EQ coefficients are available.

Member Data Documentation

◆ path_variable

std::string_view ts::EffectPresets::path_variable = "TABULASONORA_PRESETS"
staticconstexpr

Environment variable that overrides where presets are read from.


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