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

The engine's pan law: an exact 128-entry table, not a computed curve. More...

#include <tabulasonora/interpolator.hpp>

Public Member Functions

 PanLaw (const TableSet &tables)
 Creates the pan law over a loaded table set, which must outlive it.
std::pair< double, double > gains (int pan) const noexcept
 The left and right gains for a pan position, 0 to 127, with 64 centred.

Static Public Attributes

static constexpr int centre = 64
 Pan value that sounds centred.

Detailed Description

The engine's pan law: an exact 128-entry table, not a computed curve.

Left reads T[127 - p] and right reads T[p - 1], so both land on index 63 at the centre and pan 64 is exactly symmetric at 75/127 ≈ 0.5906 — neither the 0.707 of a constant-power law nor the 0.5 of a linear one. Recovered by sweeping the controller through the engine and reading per-channel RMS, and it reproduces that sweep to within 0.00037.

Constructor & Destructor Documentation

◆ PanLaw()

ts::PanLaw::PanLaw ( const TableSet & tables)
inlineexplicit

Creates the pan law over a loaded table set, which must outlive it.

Member Function Documentation

◆ gains()

std::pair< double, double > ts::PanLaw::gains ( int pan) const
nodiscardnoexcept

The left and right gains for a pan position, 0 to 127, with 64 centred.

Pan 0 is fully left: the right channel is silent, not merely attenuated.

Member Data Documentation

◆ centre

int ts::PanLaw::centre = 64
staticconstexpr

Pan value that sounds centred.


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