87 [[nodiscard]]
int kit_count() const noexcept {
return kit_count_; }
103 [[nodiscard]]
int map_row(
int internal_bank)
const noexcept;
109 [[nodiscard]] std::optional<int>
kit_for_program(
int program,
int row = 0) const noexcept;
151 [[nodiscard]] static constexpr
double level_gain(
int level) noexcept
153 return (level / 127.0) * (level / 127.0);
158 static constexpr int tone_plane = 0x000;
159 static constexpr int level_plane = 0x100;
160 static constexpr int pitch_plane = 0x180;
161 static constexpr int group_plane = 0x200;
162 static constexpr int pan_plane = 0x280;
165 static constexpr int receive_plane = 0x480;
167 static constexpr int name_plane = 0x500;
168 static constexpr int name_length = 12;
170 std::int64_t kit_base_ = 0;
171 std::vector<std::uint8_t> bank_row_;
172 std::vector<std::uint8_t> program_map_;
173 std::array<std::uint16_t, 256> kit_index_{};
174 std::vector<std::uint8_t> kits_;
static constexpr int key_count
Keys per kit.
Definition drum_kit_table.hpp:63
DrumKitTable(const RomImage &rom)
Creates the table by reading the drum regions out of the ROM image.
std::string kit_name(int kit) const
The kit's name, as the ROM record carries it, trimmed of trailing spaces.
static constexpr double level_gain(int level) noexcept
The gain the kit level contributes, as amplitude.
Definition drum_kit_table.hpp:151
DrumKey key(int note, int kit=0) const
Reads one key's settings from a kit; kit 0 is GM Standard.
std::optional< int > kit_for_program(int program, int row=0) const noexcept
Resolves a drum program to its kit record index, or nothing for an undefined program.
static constexpr int map_row_count
Rows in the drum program map.
Definition drum_kit_table.hpp:75
static constexpr std::int64_t kit_index_offset
File offset of the table mapping a level-two index to a kit record index.
Definition drum_kit_table.hpp:81
static constexpr int kit_stride
Bytes per kit record.
Definition drum_kit_table.hpp:60
static std::optional< int > row_for_map(ToneMap map) noexcept
The drum map row a vintage's tone map selects, or nothing where no measurement pins one.
int kit_count() const noexcept
Number of kit records reachable through the program map.
Definition drum_kit_table.hpp:87
static double coarse_pitch_ratio(int pitch) noexcept
The playback ratio the kit's coarse-pitch plane implies.
int map_row(int internal_bank) const noexcept
Maps an internal bank code to a drum map row; standard GM/GS drum parts use 0x04.
Read-only access to SCCore.dll as a data file.
Definition rom_image.hpp:39
Definition control_decode.hpp:7
ToneMap
Which vintage's tone map a program change resolves against.
Definition patch_directory.hpp:22
@ pitch
Pitch, in milli-semitones.
Definition lfo_engine.hpp:18
One drum key's settings within a kit.
Definition drum_kit_table.hpp:15
int group
Mute/assign group; keys sharing a non-zero group cut each other off.
Definition drum_kit_table.hpp:23
bool receives_note_on
Whether this key responds to note-on — GS Rx.Note On, bit 4 of the same plane.
Definition drum_kit_table.hpp:43
int pan
Pan position, per key.
Definition drum_kit_table.hpp:25
int tone
Tone number. Drum sounds are ordinary melodic tones.
Definition drum_kit_table.hpp:17
bool receives_note_off
Whether this key responds to note-off at all — GS Rx.Note Off, per key.
Definition drum_kit_table.hpp:36
int level
Kit level for this key. Applies downstream as (level / 127)^2.
Definition drum_kit_table.hpp:19
int pitch
Coarse pitch, 60 being the tone's natural pitch.
Definition drum_kit_table.hpp:21