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

One melodic tone record: an ASCII name, a master level, and up to two partial parameter blocks. More...

#include <tabulasonora/tone.hpp>

Public Member Functions

int number () const noexcept
 The tone number this record was read from.
const std::string & name () const noexcept
 The tone's ASCII name, trailing padding removed.
int level () const noexcept
 Per-tone master level, header +0x0c.
const std::vector< PartialParameters > & partials () const noexcept
 The partials that are actually present, in slot order.
bool is_defined () const noexcept
 Whether this record holds a real tone.

Static Public Member Functions

static Tone read (std::span< const std::uint8_t > tone_table, int number)
 Reads a tone record out of the tone table.

Static Public Attributes

static constexpr int stride = 0x100
 Bytes per tone record.
static constexpr int header_size = 0x24
 Bytes of header before the first partial block.
static constexpr int partial_slots = 2
 Partial slots in a melodic tone record. The drum tone table has four.
static constexpr int name_length = 12
 Length of the ASCII name field.

Detailed Description

One melodic tone record: an ASCII name, a master level, and up to two partial parameter blocks.

Member Function Documentation

◆ read()

Tone ts::Tone::read ( std::span< const std::uint8_t > tone_table,
int number )
staticnodiscard

Reads a tone record out of the tone table.

The returned partials hold pointers into tone_table, which must outlive them.

◆ number()

int ts::Tone::number ( ) const
inlinenodiscardnoexcept

The tone number this record was read from.

◆ name()

const std::string & ts::Tone::name ( ) const
inlinenodiscardnoexcept

The tone's ASCII name, trailing padding removed.

◆ level()

int ts::Tone::level ( ) const
inlinenodiscardnoexcept

Per-tone master level, header +0x0c.

The engine copies it to voice+0x167, where it becomes the third attenuation in the TVA base-level chain.

◆ partials()

const std::vector< PartialParameters > & ts::Tone::partials ( ) const
inlinenodiscardnoexcept

The partials that are actually present, in slot order.

Empty slots are dropped rather than represented, so an index into this list is not necessarily the slot index — that matters when correlating against a voice dump.

◆ is_defined()

bool ts::Tone::is_defined ( ) const
inlinenodiscardnoexcept

Whether this record holds a real tone.

Unused records read back as short or empty names, so a name of fewer than two characters is treated as absent — the same rule the reference resolver applies.

Member Data Documentation

◆ stride

int ts::Tone::stride = 0x100
staticconstexpr

Bytes per tone record.

◆ header_size

int ts::Tone::header_size = 0x24
staticconstexpr

Bytes of header before the first partial block.

◆ partial_slots

int ts::Tone::partial_slots = 2
staticconstexpr

Partial slots in a melodic tone record. The drum tone table has four.

◆ name_length

int ts::Tone::name_length = 12
staticconstexpr

Length of the ASCII name field.


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