A voice a track plays its notes with: its kind and base key, the sample or wave it plays, and its attack, decay, sustain and release. More...
#include <sound/audio_engine_types.h>
Data Fields | |
| u8 | kind |
| bits: 7 rhythm | 6 key split | 3 fixed rate for PCM, bias rounding for CGB | 2..0 CGB channel (0 PCM). | |
| u8 | baseKey |
| Key a rhythm entry plays every note at. | |
| u8 | length |
| CGB sound length (NRx1); 0 plays until released. | |
| u8 | panOrSweep |
| CGB channel 1's sweep (NR10) when bit 7 is clear and bits 6..4 are not; else no sweep. | |
| const void * | target |
| The PCM sample, the CGB wave pattern, duty or noise width, or for a rhythm or split voice its voice table. | |
| u8 | attack |
| PCM: added to the envelope each frame until 255. | |
| u8 | decay |
| PCM: envelope * decay / 256 a frame. CGB: frames a step. | |
| u8 | sustain |
| Level decay stops at: 0 to 255 for PCM, 0 to 15 for CGB. | |
| u8 | release |
| PCM: envelope * release / 256 a frame. CGB: frames a step. | |
A voice a track plays its notes with: its kind and base key, the sample or wave it plays, and its attack, decay, sustain and release.
Definition at line 114 of file audio_engine_types.h.
| u8 SoundVoice::kind |
bits: 7 rhythm | 6 key split | 3 fixed rate for PCM, bias rounding for CGB | 2..0 CGB channel (0 PCM).
A rhythm or split voice plays an entry of the voice table at target, chosen by the key (rhythm) or through the key map that attack's four bytes point to (split).
Definition at line 120 of file audio_engine_types.h.
Referenced by MusicPlayer_ResetActiveTracks(), and MusicTrack_SetVoiceKind().
| u8 SoundVoice::baseKey |
Key a rhythm entry plays every note at.
Definition at line 121 of file audio_engine_types.h.
| u8 SoundVoice::length |
CGB sound length (NRx1); 0 plays until released.
Definition at line 122 of file audio_engine_types.h.
Referenced by MusicTrack_SetVoiceLength().
| u8 SoundVoice::panOrSweep |
CGB channel 1's sweep (NR10) when bit 7 is clear and bits 6..4 are not; else no sweep.
In a rhythm entry with bit 7 set, the note's pan is (value - 192) * 2.
Definition at line 126 of file audio_engine_types.h.
Referenced by MusicTrack_SetVoicePanOrSweep().
| const void* SoundVoice::target |
The PCM sample, the CGB wave pattern, duty or noise width, or for a rhythm or split voice its voice table.
Definition at line 129 of file audio_engine_types.h.
Referenced by MusicTrack_ReadVoiceTarget().
| u8 SoundVoice::attack |
PCM: added to the envelope each frame until 255.
CGB: frames a step. In a split voice, these four bytes are a pointer to its key map.
Definition at line 132 of file audio_engine_types.h.
Referenced by MusicTrack_SetVoiceAttack().
| u8 SoundVoice::decay |
PCM: envelope * decay / 256 a frame. CGB: frames a step.
Definition at line 133 of file audio_engine_types.h.
Referenced by MusicTrack_SetVoiceDecay().
| u8 SoundVoice::sustain |
Level decay stops at: 0 to 255 for PCM, 0 to 15 for CGB.
Definition at line 134 of file audio_engine_types.h.
Referenced by MusicTrack_SetVoiceSustain().
| u8 SoundVoice::release |
PCM: envelope * release / 256 a frame. CGB: frames a step.
Definition at line 135 of file audio_engine_types.h.
Referenced by MusicTrack_SetVoiceRelease().