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

Namespaces

namespace  formats
namespace  sequence_builder
 Turns a flat event list into per-part controller timelines and a note list.
namespace  smf
 A dependency-free Standard MIDI File reader.
namespace  wav
 Writes 16-bit stereo PCM WAV files.

Classes

struct  AllpassStage
 One allpass stage: a read tap, a write tap and the two coefficients around them. More...
struct  AlternateEntry
 An entry of the alternate-articulation table. More...
class  ChannelMask
 Per-channel mute and solo. More...
class  Chorus
 The GS chorus: a modulated delay line with two anti-phase taps. More...
struct  ChorusPreset
 Coefficients for one GS chorus type. More...
struct  ChorusPresets
 The eight GS chorus types plus the power-on default. More...
class  ControllerTimeline
 A controller's value over time, as breakpoints. More...
struct  ControlMatrix
 The GS controller assignment matrix (40 2x): six sources, each with eleven depths. More...
struct  ControlUpdate
 One parameter set by one message. More...
class  DcBlocker
 The engine's DC blocker: one design, instantiated once on each effect input. More...
struct  DecodedWave
 A wave decoded from the ROM, with everything playback needs. More...
struct  DelayParameters
 Compiled coefficients for one GS delay type. More...
struct  DelayPresets
 The ten GS delay types and the two published conversion tables. More...
struct  DllIdentity
 Identity of the SCCore.dll build every offset in the manifest is pinned to. More...
struct  DrumKey
 One drum key's settings within a kit. More...
class  DrumKeyOverrides
 Per-part coarse-pitch and panpot overrides, set by NRPN. More...
class  DrumKitTable
 The drum kit records: for each of 128 keys, which tone sounds and how it is levelled, tuned, panned and grouped. More...
class  Effect
 A stereo send effect fed from one mono bus. More...
class  EffectPresets
 The coefficient sets for the three GS send effects. More...
class  EffectProgrammer
 Computes the reverb, chorus and delay coefficient sets from the DLL's own preset tables — the managed re-implementation of the engine's start-up register program. More...
struct  EfxRecord
 One record of the DLL's own insertion-effect directory. More...
class  EngineNoise
 The engine's shared pseudo-random generator. More...
class  EnvelopeMachine
 The segment-rate and segment-shape machine shared by the TVA, TVF and pitch envelopes. More...
struct  EqBand
 One shelving band: H(z) = (b0 + b1·z⁻¹) / (1 − a1·z⁻¹). More...
struct  EqPresets
 The four-band EQ block's coefficient tables — two bands, two corner frequencies each. More...
class  Equalizer
 The GS four-band EQ: a low shelf and a high shelf, in series, on a stereo bus. More...
class  FrameRing
 A lock-free single-producer, single-consumer ring of interleaved stereo frames. More...
class  InsertionEffect
 The GS insertion EFX block: one stereo effect ahead of the send network. More...
class  Interpolator
 The sampler's 4-tap FIR resampler — the single most timbre-defining element of the engine. More...
struct  LfoConfig
 One LFO's static configuration. More...
class  LfoEngine
 The two LFO engines that modulate every partial. More...
class  LfoRunner
 One LFO's running state: phase, delay and fade-in accumulators, stepped a control tick at a time. More...
struct  LiveRegion
 A region read straight from the DLL at render time rather than cached to a .bin file — the two wave-ROM banks and the drum-kit lookup tables. More...
struct  MidiEvent
 One scheduled MIDI message. More...
struct  MultisampleZone
 A key range within a multisample and the wave it selects. More...
struct  NoteRecord
 One note, with every parameter latched as it was at note-on. More...
class  NoteRenderer
 Renders one note by assembling the whole voice chain: sampler, pitch, filter, amplitude and pan. More...
class  PanLaw
 The engine's pan law: an exact 128-entry table, not a computed curve. More...
class  Part
 One of the sixteen parts: the channel state a running engine keeps between events. More...
class  PartialParameters
 A zero-copy typed view over one 0x6e-byte partial parameter block inside a tone record. More...
struct  PartModifiers
 The GS part modify offsets, as the synthesis chains consume them. More...
struct  PartTimelines
 Per-channel controller timelines. More...
class  PatchDirectory
 The static patch directory: resolves a program change and a played note to the waves that sound, entirely from ROM tables with no engine involved. More...
class  PitchChain
 The pitch side of a voice: key-follow, transposition, the pitch envelope, and bend. More...
struct  PitchEnvelope
 The pitch envelope's decoded segment targets and timings. More...
class  PitchEnvelopeRunner
 Walks a pitch envelope one control tick at a time. More...
class  PitchRamp
 The per-voice pitch ramp that glides the sampler's read rate across a control block. More...
struct  ProgramReference
 A (map, bank, program) triple that resolves through the same three-level lookup. More...
struct  RenderedNote
 One rendered note: stereo output plus the pre-pan mono the send buses are fed from. More...
struct  RenderOptions
 How a sequence should be rendered. More...
struct  RenderResult
 A finished render. More...
struct  ResolvedPartial
 One partial that sounds for a given note and velocity. More...
struct  ResolvedTone
 The waves that sound for one tone at a given note and velocity. More...
class  Reverb
 The GS reverb: a Schroeder/Dattorro tank transcribed from the engine. More...
struct  ReverbPreset
 Coefficients for one GS reverb type. More...
struct  ReverbPresets
 The eight GS reverb types plus the power-on default. More...
struct  ReverbTank
 One reverb tank. More...
class  RomIdentityError
 Thrown when the supplied SCCore.dll is not the build the table offsets are pinned to. More...
class  RomImage
 Read-only access to SCCore.dll as a data file. More...
struct  RomLocation
 Where a front end looked for the ROM, and what it found. More...
struct  RxSwitches
 The GS receive switches, one per message class the module can be told to ignore. More...
class  Sampler
 Wave playback: decode, then resample at a moving rate while honouring the loop. More...
class  SegmentEnvelope
 A four-segment envelope with a release, evaluated at any sample position. More...
struct  Sequence
 A parsed sequence: controller timelines, notes, and the global effect selections. More...
class  SequencePlayer
 Drives a running engine from a MIDI event list. More...
class  StateVariableFilter
 The engine's filter: a Chamberlin state-variable filter, with all four responses taken as different taps of the same two-integrator loop. More...
class  SystemDelay
 The GS system delay: three taps off one feedback line, behind a fixed input pre-delay. More...
struct  TableEntry
 One static table sliced byte-for-byte out of the DLL. More...
class  TableManifest
 The machine-readable map of everything the engine needs out of SCCore.dll: the pinned build identity, every static table's byte-exact offset, and the live ROM/directory regions. More...
class  TableSet
 The static tables the engine needs, loaded from SCCore.dll or from a directory of extracted .bin slices. More...
struct  TankAllpasses
 The two nested allpasses inside each tank. More...
struct  TankTaps
 One reverb tank's eight ring offsets, resolved from their names once. More...
class  Tone
 One melodic tone record: an ASCII name, a master level, and up to two partial parameter blocks. More...
class  ToneGenerator
 The real-time engine: MIDI in, audio out, rendered a block at a time. More...
struct  ToneGeneratorOptions
 How a running engine should behave. More...
struct  ToneZone
 One key zone of a tone, expressed in MIDI note numbers. More...
class  TvaChain
 The amplitude side of a voice: the level chain that turns static bytes into a gain, and the four-segment envelope that moves it. More...
class  TvfChain
 The filter side of a voice: the cutoff chain that turns static bytes into the two coefficients the state-variable filter needs, and the envelope that moves the cutoff over time. More...
struct  Voice
 A handle to one voice slot: an index into the pool's parallel arrays plus the control-rate operations that act on it. More...
class  VoicePool
 The voice allocator. More...
struct  WaveDescriptor
 One entry of the wave-descriptor table: where a sample lives in the wave ROM, how it is tuned, and how it loops. More...
class  WaveRom
 The 24 MB wave ROM embedded in SCCore.dll — the literal Sound Canvas hardware mask ROM, two banks addressed in 1 MB regions. More...
struct  WaveStreams
 The two raw streams that make up one wave: a signed delta per sample, and a shift exponent per 16-sample block packed two to a byte. More...
struct  XgAddress
 An XG message split into the parts a front end needs to act on it. More...

Enumerations

enum class  ControlTarget {
  volume , expression , pan , modulation ,
  damper , reverb_send , chorus_send , delay_send ,
  bank , bend_range , vibrato_rate , vibrato_depth ,
  vibrato_delay , tvf_cutoff , env_attack , env_decay ,
  env_release , velocity_depth , velocity_offset , channel_pressure ,
  matrix_modulation_pitch , matrix_pressure_pitch , eq_low_frequency , eq_low_gain ,
  eq_high_frequency , eq_high_gain , eq_enabled
}
 Every part parameter a MIDI message can set to a value. More...
enum class  XgMessage {
  none , system_on , all_parameter_reset , system_parameter ,
  effect1 , multi_part , drum_setup
}
 What an XG message is, for a caller deciding whether it has the machinery to act. More...
enum class  LfoDestination { pitch , tvf , tva }
 Which parameter an LFO's depth applies to. More...
enum class  ToneMap {
  sc55 = 1 , sc88 = 2 , sc88pro = 3 , sc8820 = 4 ,
  xg = 0x77
}
 Which vintage's tone map a program change resolves against. More...
enum class  RomVerification { full , quick , none }
 How strictly RomImage::open checks that the file is the pinned build. More...
enum class  SamplerMode { one_shot , loop , ping_pong }
 Which sampler variant plays a wave. More...
enum class  MidiEventKind { channel , sysex }
 What kind of message an event carries. More...
enum class  FilterTap {
  bypass , low_pass , band_pass , high_pass ,
  notch
}
 Which output of the state-variable filter a partial takes. More...
enum class  VoiceState { free , held , releasing }
 What a voice slot is currently doing. More...

Functions

std::optional< ControlUpdatedecode_control_change (int channel, int controller, int value) noexcept
 Which parameter a Control Change writes, if it writes one.
std::optional< ControlUpdatedecode_gs_sysex (std::span< const std::uint8_t > bytes, int port=0) noexcept
 Which parameter a Roland GS DT1 message writes, if it writes one.
bool gs_checksum_ok (std::span< const std::uint8_t > bytes) noexcept
 Whether a GS DT1 message is well formed and its checksum folds to zero.
XgAddress decode_xg_sysex (std::span< const std::uint8_t > bytes) noexcept
 Classifies an XG message and remaps its part number, without deciding what to do about it.
std::optional< ControlUpdatedecode_xg_multi_part (const XgAddress &address) noexcept
 Which parameter an XG Multi Part message writes, if it writes one this vocabulary covers.
const std::vector< std::pair< std::string, int > > & tone_map_choices () noexcept
 The tone maps a command line accepts, by name and by the module's own selector value.
std::string_view tone_map_name (ToneMap map) noexcept
 The name of a tone map, for a UI to display. Empty for a value that names none.
RomLocation locate_rom (const std::string &explicit_path)
 Finds the ROM, preferring what the caller asked for over what the environment pins.
std::string rom_not_found_message (const RomLocation &location)
 The message to print when nothing was found.

Variables

constexpr const char * rom_path_variable = "TS_SCCORE_DLL"
 The environment variable that pins the ROM path.

Enumeration Type Documentation

◆ ControlTarget

enum class ts::ControlTarget
strong

Every part parameter a MIDI message can set to a value.

This is the vocabulary the two front ends share. It deliberately covers only the messages whose whole effect is "store this number against this part" — the ones where both paths were writing the same knowledge into different files. Messages that do something (note on and off, the pedals' release behaviour, the channel-mode messages, program change and its bank resolution) stay with the front end that has the machinery to act on them, because there is nothing to share there but a switch label.

Enumerator
volume 
expression 
pan 
modulation 
damper 
reverb_send 
chorus_send 
delay_send 
bank 
bend_range 
vibrato_rate 
vibrato_depth 
vibrato_delay 
tvf_cutoff 
env_attack 
env_decay 
env_release 
velocity_depth 
velocity_offset 
channel_pressure 
matrix_modulation_pitch 

The control matrix's pitch routes, one per source.

matrix_pressure_pitch 
eq_low_frequency 

The system EQ block, which is global rather than per part.

eq_low_gain 
eq_high_frequency 
eq_high_gain 
eq_enabled 

Per-part EQ enable (40 4x 20).

◆ XgMessage

enum class ts::XgMessage
strong

What an XG message is, for a caller deciding whether it has the machinery to act.

XG is a second SysEx dialect, not an extension of GS: the module keeps a mode flag and swaps its whole parameter parser when XG System On arrives. These are the blocks that reach anything.

Enumerator
none 

Not XG, or an XG address this engine does nothing with.

system_on 

00 00 7E — switch every part onto the XG map and reset.

all_parameter_reset 

00 00 7F — All Parameter Reset.

system_parameter 

00 00 00-03 master tune, 04 master volume, 06 transpose.

effect1 

02 01 pp — reverb and chorus type, time and return.

multi_part 

08 nn pp — a Multi Part parameter.

drum_setup 

3n rr pp — a Drum Setup parameter.

◆ LfoDestination

enum class ts::LfoDestination
strong

Which parameter an LFO's depth applies to.

Enumerator
pitch 

Pitch, in milli-semitones.

tvf 

Filter cutoff, in the same units as the runtime cutoff.

tva 

Amplitude, as a fraction of 0x7f00 applied multiplicatively.

◆ ToneMap

enum class ts::ToneMap
strong

Which vintage's tone map a program change resolves against.

The value is the module's own map selector, so these index the first lookup level directly and a new map needs no code beyond its name. xg is not a vintage: XG System On switches every part onto it, and it selects a separate melodic layout — 45 bank-LSB variations over 534 presets, where the bank LSB picks the variation rather than the MSB.

Enumerator
sc55 
sc88 
sc88pro 
sc8820 
xg 

◆ RomVerification

enum class ts::RomVerification
strong

How strictly RomImage::open checks that the file is the pinned build.

Enumerator
full 

Verify size, PE timestamp and the full SHA-256. The default, and the only safe choice.

quick 

Verify size and PE timestamp but skip the SHA-256. Faster; use only in tight loops.

none 

Perform no checks at all. For experimenting with a different build; offsets will be wrong.

◆ SamplerMode

enum class ts::SamplerMode
strong

Which sampler variant plays a wave.

Enumerator
one_shot 

Plays once and stops. The predictor is zeroed at the end.

loop 

Forward loop. Rewinds the delta index and keeps the predictor.

ping_pong 

Bidirectional. Walks up to the end, turns around, and walks back to the loop point.

◆ MidiEventKind

enum class ts::MidiEventKind
strong

What kind of message an event carries.

Enumerator
channel 

A channel voice message.

sysex 

A system-exclusive message, including the leading F0.

◆ FilterTap

enum class ts::FilterTap
strong

Which output of the state-variable filter a partial takes.

Enumerator
bypass 

The partial bypasses the filter entirely.

low_pass 

Lowpass — the low integrator.

band_pass 

Bandpass — the band integrator.

high_pass 

Highpass — in - q*band - low.

notch 

Notch — low - high.

◆ VoiceState

enum class ts::VoiceState
strong

What a voice slot is currently doing.

Enumerator
free 

Unused and available.

held 

Sounding with the key still down.

releasing 

Sounding through its release after note-off.

Function Documentation

◆ decode_control_change()

std::optional< ControlUpdate > ts::decode_control_change ( int channel,
int controller,
int value )
nodiscardnoexcept

Which parameter a Control Change writes, if it writes one.

CC#10's zero is folded to one here rather than at each call site: the wheel cannot reach the random pan position, and only the GS SysEx panpot can write a true zero.

◆ decode_gs_sysex()

std::optional< ControlUpdate > ts::decode_gs_sysex ( std::span< const std::uint8_t > bytes,
int port = 0 )
nodiscardnoexcept

Which parameter a Roland GS DT1 message writes, if it writes one.

Takes the whole message including F0 and the checksum. Returns nothing for a message that is malformed, fails its checksum, or addresses something outside this vocabulary — a caller that needs those cases handles them itself, and both do.

◆ gs_checksum_ok()

bool ts::gs_checksum_ok ( std::span< const std::uint8_t > bytes)
nodiscardnoexcept

Whether a GS DT1 message is well formed and its checksum folds to zero.

Exposed because both front ends drop a bad message and neither should be spelling the fold out for itself.

◆ decode_xg_sysex()

XgAddress ts::decode_xg_sysex ( std::span< const std::uint8_t > bytes)
nodiscardnoexcept

Classifies an XG message and remaps its part number, without deciding what to do about it.

Takes the whole message including F0 and F7. XG carries no checksum — the length and the terminator are the whole of its validity — so this checks the frame and nothing else.

part may exceed any given configuration's part count — XG addresses nn up to 0x3F, and the caller range-checks it against the parts it actually has. Out of range must be ignored: the module wraps it into a heap overflow, and folding it onto a part that does exist would be audible and wrong.

◆ decode_xg_multi_part()

std::optional< ControlUpdate > ts::decode_xg_multi_part ( const XgAddress & address)
nodiscardnoexcept

Which parameter an XG Multi Part message writes, if it writes one this vocabulary covers.

Only the parameters whose whole effect is "store this number against this part" appear. Bank and program, part mode, receive channel, note shift, detune, the receive switches and the scale tuning all do something, and stay with the front end that can do it.

◆ tone_map_choices()

const std::vector< std::pair< std::string, int > > & ts::tone_map_choices ( )
nodiscardnoexcept

The tone maps a command line accepts, by name and by the module's own selector value.

Shared so the four front ends spell the same thing the same way, and so a bad value is refused rather than cast to a selector that resolves to nothing. xg is 0x77 because that is the number the module uses, not a label invented here.

◆ tone_map_name()

std::string_view ts::tone_map_name ( ToneMap map)
nodiscardnoexcept

The name of a tone map, for a UI to display. Empty for a value that names none.

◆ locate_rom()

RomLocation ts::locate_rom ( const std::string & explicit_path)
nodiscard

Finds the ROM, preferring what the caller asked for over what the environment pins.

The order is: an explicit path, then TS_SCCORE_DLL, then SCCore.dll beside the working directory. An explicit path always wins and is never second-guessed – a pinned environment must not silently redirect a command that names a file, or comparing two DLL builds becomes a matter of remembering what the shell was set to.

A path that was given explicitly is returned whether or not it exists, so the caller reports "cannot open that file" rather than "no ROM found anywhere", which is the more useful error.

◆ rom_not_found_message()

std::string ts::rom_not_found_message ( const RomLocation & location)
nodiscard

The message to print when nothing was found.

Variable Documentation

◆ rom_path_variable

const char* ts::rom_path_variable = "TS_SCCORE_DLL"
inlineconstexpr

The environment variable that pins the ROM path.

Every front end honours it, so the path is typed once per shell rather than once per command.