Contains classes and functions for handling music data in Zelda 3. More...
Namespaces | |
| namespace | anonymous_namespace{music_bank.cc} |
Classes | |
| class | AsmExporter |
| Exports MusicSong to Oracle of Secrets music_macros.asm format. More... | |
| struct | AsmExportOptions |
| Options for ASM export in music_macros.asm format. More... | |
| class | AsmImporter |
| Imports music_macros.asm format files into MusicSong. More... | |
| struct | AsmImportOptions |
| Options for ASM import from music_macros.asm format. More... | |
| struct | AsmParseResult |
| Parse result with diagnostics. More... | |
| class | BrrCodec |
| BRR sample encoder/decoder. More... | |
| struct | CommandMacroMapping |
| struct | DurationConstant |
| struct | InstrumentMacro |
| struct | InstrumentMacroMapping |
| class | MusicBank |
| Manages the collection of songs, instruments, and samples from a ROM. More... | |
| struct | MusicCommand |
| Represents an N-SPC command (opcodes 0xE0-0xFF). More... | |
| struct | MusicInstrument |
| An instrument definition with ADSR envelope. More... | |
| struct | MusicSample |
| A BRR-encoded audio sample. More... | |
| struct | MusicSegment |
| A segment containing 8 parallel tracks. More... | |
| struct | MusicSong |
| A complete song composed of segments. More... | |
| struct | MusicTrack |
| One of 8 channels in a music segment. More... | |
| struct | Note |
| Represents a single musical note. More... | |
| struct | NoteNameMapping |
| struct | SampleEdit |
| A state structure for a GUI sample editor. More... | |
| struct | Song |
| Represents a complete song, which is a collection of SongParts. More... | |
| struct | SongPart |
| Represents one of the 8 channels (tracks) in a song. More... | |
| struct | SongRange |
| A metadata structure to keep track of parsed sections of the song data. Used to avoid re-parsing the same data from the ROM multiple times. More... | |
| struct | SongSpcBlock |
| Represents a block of binary data destined for the APU (SPC700) RAM. This is the intermediate format used before writing data back to the ROM. More... | |
| struct | SpcCommand |
| The core data structure representing a single command in a music track. A song track is a doubly-linked list of these commands. More... | |
| class | SpcParser |
| Parser for N-SPC music data from ROM. More... | |
| class | SpcSerializer |
| Serializer for N-SPC music data to ROM format. More... | |
| class | Tracker |
| struct | TrackEvent |
| A single event in a music track (note, command, or control). More... | |
| struct | ZeldaInstrument |
| Defines an instrument for a song, mapping to a sample and ADSR settings. More... | |
| struct | ZeldaSfxInstrument |
| Defines an instrument for a sound effect. More... | |
| struct | ZeldaWave |
| Represents a decoded instrument sample (a waveform). More... | |
Typedefs | |
| using | text_buf_ty = char[512] |
Enumerations | |
| enum class | CommandType : uint8_t { SetInstrument = 0xE0 , SetPan = 0xE1 , PanFade = 0xE2 , VibratoOn = 0xE3 , VibratoOff = 0xE4 , SetMasterVolume = 0xE5 , MasterVolumeFade = 0xE6 , SetTempo = 0xE7 , TempoFade = 0xE8 , GlobalTranspose = 0xE9 , ChannelTranspose = 0xEA , TremoloOn = 0xEB , TremoloOff = 0xEC , SetChannelVolume = 0xED , ChannelVolumeFade = 0xEE , CallSubroutine = 0xEF , VibratoFade = 0xF0 , PitchEnvelopeTo = 0xF1 , PitchEnvelopeFrom = 0xF2 , PitchEnvelopeOff = 0xF3 , Tuning = 0xF4 , EchoVBits = 0xF5 , EchoOff = 0xF6 , EchoParams = 0xF7 , EchoVolumeFade = 0xF8 , PitchSlide = 0xF9 , PercussionPatch = 0xFA } |
Functions | |
| const char * | GetVanillaSongName (int song_id) |
| Get the vanilla name for a song ID. | |
| MusicBank::Bank | GetVanillaSongBank (int song_id) |
| Get the bank for a vanilla song ID. | |
| uint16_t | LookupNSpcPitch (uint8_t note_byte) |
| Look up the DSP pitch value for an N-SPC note byte. | |
Variables | |
| constexpr DurationConstant | kDurationConstants [] |
| constexpr InstrumentMacro | kInstrumentMacros [] |
| constexpr NoteNameMapping | kAsmNoteNames [] |
| constexpr CommandMacroMapping | kCommandMacros [] |
| constexpr InstrumentMacroMapping | kInstrumentMacroImport [] |
| constexpr int | kCommandParamCount [32] |
| constexpr uint8_t | kNoteMinPitch = 0x80 |
| constexpr uint8_t | kNoteMaxPitch = 0xC7 |
| constexpr uint8_t | kNoteTie = 0xC8 |
| constexpr uint8_t | kNoteRest = 0xC9 |
| constexpr uint8_t | kTrackEnd = 0x00 |
| constexpr uint8_t | kDurationQuarter = 0x48 |
| constexpr uint8_t | kDurationQuarterDot = 0x6C |
| constexpr uint8_t | kDurationQuarterTrip = 0x30 |
| constexpr uint8_t | kDurationEighth = 0x24 |
| constexpr uint8_t | kDurationEighthDot = 0x36 |
| constexpr uint8_t | kDurationEighthTrip = 0x18 |
| constexpr uint8_t | kDurationSixteenth = 0x12 |
| constexpr uint8_t | kDurationSixteenthDot = 0x1B |
| constexpr uint8_t | kDurationThirtySecond = 0x09 |
| constexpr uint32_t | kOverworldBankRom = 0xD1EF5 |
| constexpr uint32_t | kDungeonBankRom = 0xD8000 |
| constexpr uint32_t | kCreditsBankRom = 0xD5380 |
| constexpr uint16_t | kSongTableAram = 0xD000 |
| constexpr uint16_t | kInstrumentTableAram = 0x3D00 |
| constexpr uint16_t | kSampleTableAram = 0x3C00 |
| constexpr uint16_t | kSampleDataAram = 0x4000 |
| constexpr int | kOverworldBankMaxSize = 12032 |
| constexpr int | kDungeonBankMaxSize = 11200 |
| constexpr int | kCreditsBankMaxSize = 4200 |
| constexpr uint16_t | kNSpcPitchTable [72] |
| constexpr uint32_t | kExpandedOverworldBankRom = 0x1A9EF5 |
| constexpr uint32_t | kExpandedAuxBankRom = 0x1ACCA7 |
| constexpr uint16_t | kAuxSongTableAram = 0x2B00 |
| constexpr int | kExpandedOverworldBankMaxSize = 0x2DAE |
| constexpr int | kAuxBankMaxSize = 0x0688 |
| constexpr uint32_t | kExpandedMusicHookAddress = 0x008919 |
| constexpr uint8_t | kJslOpcode = 0x22 |
| constexpr const char * | kDefaultInstrumentNames [] |
| constexpr const char * | kNoteNames [] |
| constexpr uint32_t | kSoundBankOffsets [] |
| constexpr char | op_len [32] |
| constexpr char | fil1 [4] = {0, 15, 61, 115} |
| constexpr char | fil2 [4] = {0, 4, 5, 6} |
| constexpr char | fil3 [4] = {0, 0, 15, 13} |
| constexpr int | kOverworldMusicBank = 0x0D0000 |
| constexpr int | kDungeonMusicBank = 0x0D8000 |
Contains classes and functions for handling music data in Zelda 3.
Based off of the Hyrule Magic tracker code, this system is designed to parse the game's complex, pointer-based music format into an editable in-memory representation and then serialize it back into a binary format that the SNES Audio Processing Unit (APU) can understand.
| using yaze::zelda3::music::text_buf_ty = char[512] |
|
strong |
Definition at line 152 of file song_data.h.
| const char * yaze::zelda3::music::GetVanillaSongName | ( | int | song_id | ) |
Get the vanilla name for a song ID.
| song_id | The song ID (1-34). |
Definition at line 1202 of file music_bank.cc.
References yaze::zelda3::music::anonymous_namespace{music_bank.cc}::VanillaSongInfo::name.
Referenced by yaze::zelda3::music::MusicBank::LoadSongTable().
| MusicBank::Bank yaze::zelda3::music::GetVanillaSongBank | ( | int | song_id | ) |
Get the bank for a vanilla song ID.
| song_id | The song ID (1-34). |
Definition at line 1209 of file music_bank.cc.
References yaze::zelda3::music::anonymous_namespace{music_bank.cc}::VanillaSongInfo::bank, and yaze::zelda3::music::MusicBank::Overworld.
|
inline |
Look up the DSP pitch value for an N-SPC note byte.
| note_byte | The note value (0x80-0xC7 for C1-B6). |
Definition at line 126 of file song_data.h.
References kNoteMaxPitch, kNoteMinPitch, and kNSpcPitchTable.
Referenced by yaze::editor::music::MusicPlayer::PreviewInstrument(), and yaze::editor::music::MusicPlayer::PreviewNote().
|
constexpr |
Definition at line 116 of file asm_exporter.h.
Referenced by yaze::zelda3::music::AsmExporter::GetDurationConstant(), and yaze::zelda3::music::AsmImporter::ParseDurationConstant().
|
constexpr |
Definition at line 137 of file asm_exporter.h.
Referenced by yaze::zelda3::music::AsmExporter::GetInstrumentMacro().
|
constexpr |
Definition at line 141 of file asm_importer.h.
Referenced by yaze::zelda3::music::AsmImporter::ParseNoteName().
|
constexpr |
Definition at line 233 of file asm_importer.h.
Referenced by yaze::zelda3::music::AsmImporter::ResolveCommandMacro().
|
constexpr |
Definition at line 269 of file asm_importer.h.
Referenced by yaze::zelda3::music::AsmImporter::ResolveInstrumentMacro().
|
constexpr |
Definition at line 19 of file song_data.h.
Referenced by yaze::zelda3::music::AsmExporter::GetCommandParamCount(), yaze::zelda3::music::SpcParser::GetCommandParamCount(), and yaze::zelda3::music::MusicCommand::GetParamCount().
|
constexpr |
Definition at line 55 of file song_data.h.
Referenced by yaze::editor::music::TrackerView::DrawEventCell(), yaze::editor::music::PianoRollView::DrawGrid(), yaze::editor::music::PianoRollView::DrawNotes(), yaze::editor::music::PianoRollView::DrawPianoKeys(), yaze::editor::music::PianoRollView::DrawRollCanvas(), yaze::zelda3::music::AsmExporter::GetNoteName(), yaze::zelda3::music::Note::GetOctave(), yaze::zelda3::music::Note::GetSemitone(), yaze::editor::music::TrackerView::HandleKeyboardInput(), yaze::editor::music::PianoRollView::HandleMouseInput(), yaze::zelda3::music::Note::IsNote(), yaze::zelda3::music::SpcParser::IsNotePitch(), LookupNSpcPitch(), and yaze::zelda3::music::AsmImporter::ParseDataBytes().
|
constexpr |
Definition at line 56 of file song_data.h.
Referenced by yaze::editor::music::TrackerView::DrawEventCell(), yaze::editor::music::PianoRollView::DrawGrid(), yaze::editor::music::PianoRollView::DrawPianoKeys(), yaze::editor::music::PianoRollView::DrawRollCanvas(), yaze::zelda3::music::AsmExporter::GetNoteName(), yaze::editor::music::PianoRollView::HandleMouseInput(), yaze::zelda3::music::Note::IsNote(), LookupNSpcPitch(), and yaze::zelda3::music::AsmImporter::ParseDataBytes().
|
constexpr |
Definition at line 57 of file song_data.h.
Referenced by yaze::zelda3::music::AsmExporter::GetNoteName(), yaze::zelda3::music::Note::IsTie(), yaze::zelda3::music::AsmImporter::ParseDataBytes(), and yaze::zelda3::music::SpcParser::ParseTrackInternal().
|
constexpr |
|
constexpr |
Definition at line 59 of file song_data.h.
Referenced by yaze::zelda3::music::AsmExporter::GetNoteName(), yaze::zelda3::music::AsmImporter::ParseDataBytes(), yaze::zelda3::music::SpcParser::ParseTrackInternal(), and yaze::zelda3::music::SpcSerializer::SerializeTrack().
|
constexpr |
Definition at line 62 of file song_data.h.
Referenced by yaze::editor::music::PianoRollView::Draw(), yaze::editor::music::PianoRollView::DrawToolbar(), and yaze::editor::music::PianoRollView::HandleMouseInput().
|
constexpr |
Definition at line 63 of file song_data.h.
|
constexpr |
Definition at line 64 of file song_data.h.
|
constexpr |
Definition at line 65 of file song_data.h.
Referenced by yaze::editor::music::PianoRollView::Draw(), and yaze::editor::music::PianoRollView::DrawToolbar().
|
constexpr |
Definition at line 66 of file song_data.h.
|
constexpr |
Definition at line 67 of file song_data.h.
|
constexpr |
Definition at line 68 of file song_data.h.
Referenced by yaze::editor::music::PianoRollView::Draw(), yaze::editor::music::TrackerView::DrawEventCell(), yaze::editor::music::PianoRollView::DrawToolbar(), and yaze::editor::music::TrackerView::HandleKeyboardInput().
|
constexpr |
Definition at line 69 of file song_data.h.
|
constexpr |
Definition at line 70 of file song_data.h.
Referenced by yaze::editor::music::PianoRollView::Draw().
|
constexpr |
Definition at line 77 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankRomAddress().
|
constexpr |
Definition at line 78 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankRomAddress().
|
constexpr |
Definition at line 79 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankRomAddress().
|
constexpr |
Definition at line 82 of file song_data.h.
Referenced by yaze::editor::MusicEditor::ExportSongToAsm(), yaze::zelda3::music::MusicBank::GetSongTableAddress(), yaze::zelda3::music::MusicBank::LoadExpandedSongTable(), yaze::editor::music::MusicPlayer::PreviewCustomSong(), and yaze::editor::music::MusicPlayer::PreviewSegment().
|
constexpr |
Definition at line 83 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::LoadInstruments().
|
constexpr |
Definition at line 84 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::LoadSamples().
|
constexpr |
Definition at line 85 of file song_data.h.
|
constexpr |
Definition at line 88 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankMaxSize().
|
constexpr |
Definition at line 89 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankMaxSize().
|
constexpr |
Definition at line 90 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankMaxSize().
|
constexpr |
Definition at line 100 of file song_data.h.
Referenced by LookupNSpcPitch().
|
constexpr |
Definition at line 138 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::DetectExpandedMusicPatch(), and yaze::zelda3::music::MusicBank::GetBankRomAddress().
|
constexpr |
Definition at line 139 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::DetectExpandedMusicPatch(), and yaze::zelda3::music::MusicBank::GetBankRomAddress().
|
constexpr |
Definition at line 140 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::DetectExpandedMusicPatch(), and yaze::editor::MusicEditor::ExportSongToAsm().
|
constexpr |
Definition at line 141 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankMaxSize(), and yaze::zelda3::music::MusicBank::LoadExpandedSongTable().
|
constexpr |
Definition at line 142 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::GetBankMaxSize().
|
constexpr |
Definition at line 145 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::DetectExpandedMusicPatch().
|
constexpr |
Definition at line 146 of file song_data.h.
Referenced by yaze::zelda3::music::MusicBank::DetectExpandedMusicPatch().
|
constexpr |
Definition at line 406 of file song_data.h.
|
constexpr |
Definition at line 425 of file song_data.h.
Referenced by yaze::zelda3::music::Note::GetNoteName().
|
constexpr |
Definition at line 25 of file spc_parser.h.
Referenced by yaze::zelda3::music::SpcParser::ParseTrack().
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |