35[[nodiscard]]
const std::vector<std::pair<std::string, int>>&
tone_map_choices() noexcept;
103 [[nodiscard]]
int tone_count() const noexcept {
return tone_count_; }
109 [[nodiscard]]
int wave_count() const noexcept {
return wave_count_; }
115 [[nodiscard]] std::optional<WaveDescriptor>
wave(
int wave_number)
const;
118 [[nodiscard]] std::optional<Tone>
tone(
int tone_number)
const;
142 [[nodiscard]] std::optional<int>
multisample_wave(
int multisample,
int transposed_key)
const;
145 [[nodiscard]]
int zone_level(
int multisample,
int key,
int key_center)
const;
155 [[nodiscard]] std::optional<std::string>
tone_zones(
int tone_number,
156 std::vector<ToneZone>& zones)
const;
175 [[nodiscard]] std::optional<AlternateEntry>
alternate(
int index)
const;
203 std::span<const std::uint8_t> tone_;
204 std::span<const std::uint8_t> multisample_;
205 std::span<const std::uint8_t> wavedesc_;
206 std::span<const std::uint8_t> layered_;
209 int multisample_count_ = 0;
211 int alternate_count_ = 0;
A zero-copy typed view over one 0x6e-byte partial parameter block inside a tone record.
Definition partial_parameters.hpp:20
int alternate_tone(int program, ToneMap map, int bank) const
The mono/solo alternate-articulation tone for a program, or -1.
int alternate_count() const noexcept
Number of alternate-articulation records.
Definition patch_directory.hpp:112
std::optional< WaveDescriptor > wave(int wave_number) const
Reads a wave descriptor, or nothing if the number is out of range.
PatchDirectory(const TableSet &tables)
Creates a directory over a loaded table set, which must outlive it.
static constexpr int multisample_stride
Bytes per multisample record.
Definition patch_directory.hpp:91
bool half_damper(int tone_number) const
Whether a tone responds to half-damper (continuous CC64).
std::vector< int > program_tones(int program, ToneMap map, int bank) const
Resolves a program change to the tone numbers that sound for an ordinary poly note.
ResolvedTone resolve_midi(int program, int note, int velocity, ToneMap map, int bank) const
Resolves a MIDI program change and played note in one step.
int multisample_count() const noexcept
Number of multisample records.
Definition patch_directory.hpp:106
static constexpr int indirect_only_flag
Tone numbers at or above this are reachable only indirectly.
Definition patch_directory.hpp:88
std::optional< Tone > tone(int tone_number) const
Reads a tone record, or nothing if the number is out of range.
ResolvedTone resolve(int tone_number, int note, int velocity) const
Resolves a played note against a tone.
int program_to_tone(int program, ToneMap map, int bank) const
Resolves a program change to a single tone number, or -1 when unassigned.
int tone_count() const noexcept
Number of tone records in the melodic table.
Definition patch_directory.hpp:103
static constexpr int melodic_space_end
Highest tone number in the melodic space, exclusive.
Definition patch_directory.hpp:79
int zone_level(int multisample, int key, int key_center) const
Reads the per-key-zone level, the second attenuation in the TVA base-level chain.
static constexpr int drum_space_start
First tone number in the drum space.
Definition patch_directory.hpp:82
std::optional< int > multisample_wave(int multisample, int transposed_key) const
Selects the wave a multisample yields for a transposed key, or nothing when silent.
std::optional< std::string > tone_zones(int tone_number, std::vector< ToneZone > &zones) const
Builds the full static zone map for a tone, with key bounds converted back to MIDI notes.
int wave_count() const noexcept
Number of wave descriptors.
Definition patch_directory.hpp:109
int tone_level(int tone_number) const
Reads a tone's master level from its header.
std::optional< int > lut3_resolved(int program, ToneMap map, int bank) const
The three-level lookup with the GS capital-tone fallback applied.
std::optional< int > lut3_raw(int program, ToneMap map, int bank) const
The raw unsigned word the three-level program lookup yields.
std::vector< MultisampleZone > multisample_zones(int multisample) const
Lists a multisample's key zones in transposed-key space, low to high.
PartialParameters partial_by_slot(int tone_number, int slot) const
Reads a partial block by its slot rather than its position among the present partials.
static constexpr int alternate_stride
Bytes per alternate-articulation record.
Definition patch_directory.hpp:94
static constexpr int alternate_space_start
First tone number in the alternate-articulation space.
Definition patch_directory.hpp:85
static constexpr int unassigned
Value meaning "unassigned" in the third lookup level.
Definition patch_directory.hpp:97
std::optional< AlternateEntry > alternate(int index) const
Decodes an entry of the alternate-articulation table, indexed by tone# - 0x6000.
The static tables the engine needs, loaded from SCCore.dll or from a directory of extracted ....
Definition table_set.hpp:30
Definition control_decode.hpp:7
ToneMap
Which vintage's tone map a program change resolves against.
Definition patch_directory.hpp:22
@ sc55
Definition patch_directory.hpp:23
@ sc88
Definition patch_directory.hpp:24
@ sc88pro
Definition patch_directory.hpp:25
@ xg
Definition patch_directory.hpp:27
@ sc8820
Definition patch_directory.hpp:26
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.
@ bank
Definition control_decode.hpp:26
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.
An entry of the alternate-articulation table.
Definition patch_directory.hpp:59
int threshold
Inter-note timing threshold that gates the alternate.
Definition patch_directory.hpp:63
std::string name
The entry's ASCII name.
Definition patch_directory.hpp:61
ProgramReference alternate
The alternate articulation, reachable only in mono/solo mode.
Definition patch_directory.hpp:67
ProgramReference primary
The tone reference that normally sounds.
Definition patch_directory.hpp:65
A (map, bank, program) triple that resolves through the same three-level lookup.
Definition patch_directory.hpp:52
int bank
Definition patch_directory.hpp:54
int program
Definition patch_directory.hpp:55
int map
Definition patch_directory.hpp:53
The waves that sound for one tone at a given note and velocity.
Definition tone.hpp:78
One key zone of a tone, expressed in MIDI note numbers.
Definition patch_directory.hpp:41
int key_low
Definition patch_directory.hpp:45
int partial_index
Definition patch_directory.hpp:42
int wave
Definition patch_directory.hpp:47
int velocity_high
Definition patch_directory.hpp:44
WaveDescriptor descriptor
Definition patch_directory.hpp:48
int velocity_low
Definition patch_directory.hpp:43
int key_high
Definition patch_directory.hpp:46
One entry of the wave-descriptor table: where a sample lives in the wave ROM, how it is tuned,...
Definition wave_descriptor.hpp:14