Go to the source code of this file.
Macros | |
| #define | SBN_ROM_OFFSET 0xF00000 |
| #define | TUNE_SCALING_ARR_AMPLIFY_FINE 0 |
| #define | TUNE_SCALING_ARR_AMPLIFY_COARSE 128 |
| #define | TUNE_SCALING_ARR_ATTENUATE_FINE 160 |
| #define | TUNE_SCALING_ARR_ATTENUATE_COARSE 288 |
| #define | SBN_EXTRA_LOOKUP(i, fmt, e) (au_fetch_SBN_file(globals->extraFileList[AmbientSoundIDtoMSEQFileIndex[i]], fmt, &e)) |
| #define | AL_HEADER_SIG_BK 0x424B |
| #define | AL_HEADER_SIG_CR 0x4352 |
| #define | AL_HEADER_SIG_DR 0x4452 |
| #define | AL_HEADER_SIG_SR 0x5352 |
Enumerations | |
| enum | BKParseState { BK_READ_DONE = 0 , BK_READ_FETCH_HEADER = 11 , BK_READ_FETCH_DATA = 21 , BK_READ_SWIZZLE = 31 , BK_READ_PROCESS_CR = 101 , BK_READ_SWIZZLE_CR = 111 , BK_READ_PROCESS_DR = 201 , BK_READ_UNK_DR = 211 , BK_READ_PROCESS_SR = 301 , BK_READ_UNK_SR = 311 } |
Variables | |
| AuCallback | BeginSoundUpdateCallback |
| BGMPlayer * | gBGMPlayerA |
| BGMPlayer * | gBGMPlayerB |
| BGMPlayer * | gBGMPlayerC |
| SoundManager * | gSoundManager |
| AuGlobals * | gSoundGlobals |
| AmbienceManager * | gAuAmbienceManager |
| u16 | PerceptualVolumeLevels [9] |
| Volume steps use squared values so each level represents linear power increase, matching loudness perception. | |
| u8 | EnvelopePressDefault [] |
| u8 | EnvelopeReleaseDefault [] |
| f32 | AlTuneScaling [] |
| #define SBN_ROM_OFFSET 0xF00000 |
Definition at line 30 of file engine.c.
Referenced by au_engine_init().
| #define TUNE_SCALING_ARR_AMPLIFY_FINE 0 |
Definition at line 405 of file engine.c.
Referenced by au_compute_pitch_ratio().
| #define TUNE_SCALING_ARR_AMPLIFY_COARSE 128 |
Definition at line 406 of file engine.c.
Referenced by au_compute_pitch_ratio().
| #define TUNE_SCALING_ARR_ATTENUATE_FINE 160 |
Definition at line 407 of file engine.c.
Referenced by au_compute_pitch_ratio().
| #define TUNE_SCALING_ARR_ATTENUATE_COARSE 288 |
Definition at line 408 of file engine.c.
Referenced by au_compute_pitch_ratio().
| #define SBN_EXTRA_LOOKUP | ( | i, | |
| fmt, | |||
| e ) (au_fetch_SBN_file(globals->extraFileList[AmbientSoundIDtoMSEQFileIndex[i]], fmt, &e)) |
Definition at line 663 of file engine.c.
Referenced by au_ambient_load().
| #define AL_HEADER_SIG_BK 0x424B |
Definition at line 938 of file engine.c.
Referenced by au_load_BK_to_bank(), and au_load_static_BK_to_bank().
| #define AL_HEADER_SIG_CR 0x4352 |
Definition at line 939 of file engine.c.
Referenced by au_load_BK_to_bank(), and au_load_static_BK_to_bank().
| #define AL_HEADER_SIG_DR 0x4452 |
Definition at line 940 of file engine.c.
Referenced by au_load_BK_to_bank().
| #define AL_HEADER_SIG_SR 0x5352 |
Definition at line 941 of file engine.c.
Referenced by au_load_BK_to_bank().
| Enumerator | |
|---|---|
| BK_READ_DONE | |
| BK_READ_FETCH_HEADER | |
| BK_READ_FETCH_DATA | |
| BK_READ_SWIZZLE | |
| BK_READ_PROCESS_CR | |
| BK_READ_SWIZZLE_CR | |
| BK_READ_PROCESS_DR | |
| BK_READ_UNK_DR | |
| BK_READ_PROCESS_SR | |
| BK_READ_UNK_SR | |
Definition at line 925 of file engine.c.
Definition at line 33 of file engine.c.
Referenced by au_pull_voice().
Definition at line 40 of file engine.c.
Referenced by create_audio_system().
Called exactly once per audio frame (every 5.75ms at 32kHz).
this is called per audio frame generated by alAudioFrame (every 184 audio samples) there will be multiuple of these per video frame
Updates MSEQ, SFX, and BGM players for the current audio frame.
Definition at line 214 of file engine.c.
Referenced by alAudioFrame().
this is called once per video frame update (50 or 60 times per second)
Definition at line 290 of file engine.c.
Referenced by alAudioFrame().
Definition at line 312 of file engine.c.
Referenced by au_update_clients_for_audio_frame().
Definition at line 388 of file engine.c.
Definition at line 397 of file engine.c.
Referenced by au_bgm_player_update_playing(), au_bgm_reset_all_voices(), au_BGMCmd_FC_Branch(), au_mseq_player_stop(), au_mseq_player_update(), and au_mseq_restore_voices().
Converts a linear pitch value (in cents) into a frequency ratio suitable for adjusting playback speed.
This function computes the playback rate corresponding to a pitch shift (up or down) in cents. Positive values increase pitch (higher frequency), and negative values decrease it. Recall 100 cents = 1 semitone, and therefore 1200 cents = 1 octave.
| tuning | The pitch offset in cents, from +4095 (~ 40.95 semitones up) to -16383 (~ 163.83 semitones down) |
Definition at line 410 of file engine.c.
Referenced by au_bgm_player_update_playing(), au_mseq_player_update(), and au_mseq_restore_voices().
Definition at line 421 of file engine.c.
Referenced by au_bgm_process_init_song(), au_bgm_restore_copied_player(), and au_sfx_init().
Definition at line 457 of file engine.c.
Referenced by au_bgm_update_bus_volumes(), au_sfx_init(), and au_update_clients_for_audio_frame().
Definition at line 493 of file engine.c.
Referenced by au_update_clients_for_audio_frame().
| Instrument * au_get_instrument | ( | AuGlobals * | globals, |
| BankSetIndex | bank, | ||
| s32 | patch, | ||
| EnvelopeData * | envData ) |
Note that bank is supplied as BankSetIndex and not BankSet, which means it will be used to perform a raw access into AuGlobals::bankSets.
This does not affect values above 3, but 1 and 2 differ.
Definition at line 506 of file engine.c.
Referenced by au_bgm_player_update_playing(), au_BGMCmd_E8_TrackOverridePatch(), au_BGMCmd_F5_UseInstrument(), and au_mseq_player_update().
Definition at line 522 of file engine.c.
Referenced by snd_song_load().
Definition at line 562 of file engine.c.
Referenced by snd_song_load().
Definition at line 618 of file engine.c.
Referenced by au_bgm_process_resume().
Definition at line 656 of file engine.c.
Referenced by au_bgm_process_resume(), and au_bgm_process_suspend().
Definition at line 665 of file engine.c.
Referenced by snd_load_ambient().
Definition at line 732 of file engine.c.
Referenced by au_bgm_process_resume().
Definition at line 745 of file engine.c.
Referenced by au_engine_init().
| AuResult au_fetch_SBN_file | ( | u32 | fileIdx, |
| AuFileFormat | format, | ||
| SBNFileEntry * | outEntry ) |
Definition at line 795 of file engine.c.
Referenced by au_engine_init(), au_load_BK_headers(), au_load_song_files(), and au_reload_song_files().
Definition at line 817 of file engine.c.
Referenced by au_engine_init().
Definition at line 836 of file engine.c.
Referenced by au_engine_init().
| InstrumentBank * au_get_BK_instruments | ( | BankSet | bankSet, |
| u32 | bankIndex ) |
Definition at line 894 of file engine.c.
Referenced by au_clear_instrument_group(), au_load_BK_to_bank(), and au_load_static_BK_to_bank().
| BKFileBuffer * au_load_BK_to_bank | ( | s32 | bkFileOffset, |
| BKFileBuffer * | bkFile, | ||
| s32 | bankIndex, | ||
| BankSet | bankSet ) |
Loads an instrument bank file from ROM, allocates memory if needed, and sets up instrument pointers.
Instruments in the bank will be configured to use DMA streaming for sample/codebook data. This is the standard loader for streamed instrument banks.
Definition at line 946 of file engine.c.
Referenced by au_load_aux_bank(), and au_load_BK_headers().
| void au_swizzle_BK_instruments | ( | s32 | bkFileOffset, |
| BKFileBuffer * | file, | ||
| InstrumentBank | instruments, | ||
| u32 | instrumentCount, | ||
| u8 | useDma ) |
Fixes up (swizzles) instrument pointers in a loaded bank, converting file-relative offsets to valid RAM pointers.
Sets whether each instrument uses DMA streaming or not, and updates pitch ratios to match output rate. Replaces nullptr instruments with a default instrument to ensure all loaded patches point to valid data.
Definition at line 1041 of file engine.c.
Referenced by au_load_BK_to_bank(), and au_load_static_BK_to_bank().
| BKFileBuffer * au_load_static_BK_to_bank | ( | s32 * | inAddr, |
| void * | outAddr, | ||
| s32 | bankIndex, | ||
| BankSet | bankSet ) |
UNUSED Loads an instrument bank file from ROM to a given buffer (allocates if needed), and sets up instrument pointers.
Instruments are configured to always bypass DMA: sample and codebook data is assumed to be already present in RAM. Use this only for banks whose sample data is guaranteed to be preloaded, not for standard streaming.
Definition at line 1078 of file engine.c.
Definition at line 1148 of file engine.c.
Referenced by au_ambient_load(), au_load_BGM(), au_load_song_files(), and au_reload_song_files().
Definition at line 1167 of file engine.c.
Referenced by snd_set_bgm_volume(), and snd_set_sfx_volume().
Definition at line 1183 of file engine.c.
Referenced by snd_set_sfx_reverb_type().
Definition at line 1190 of file engine.c.
Referenced by snd_set_mono(), and snd_set_stereo().
Definition at line 1207 of file engine.c.
Referenced by au_ambient_load(), au_engine_init(), au_load_BK_headers(), au_load_BK_to_bank(), au_load_INIT(), au_load_PER(), au_load_PRG(), au_load_song_files(), au_load_static_BK_to_bank(), and au_reload_song_files().
Definition at line 1224 of file engine.c.
Referenced by au_mseq_manager_init(), and au_mseq_play_sequence().
Definition at line 1271 of file engine.c.
Referenced by au_bgm_process_suspend(), au_bgm_restore_copied_player(), au_load_PER(), and au_load_PRG().
| AuCallback BeginSoundUpdateCallback |
Definition at line 5 of file engine.c.
Referenced by au_update_clients_for_video_frame().
| BGMPlayer* gBGMPlayerA |
Definition at line 6 of file engine.c.
Referenced by au_bgm_get_player_with_song_name(), au_bgm_stop_all(), au_engine_init(), au_get_bgm_player(), au_get_bgm_player_and_file(), au_get_client_by_priority(), au_set_bus_volume_level(), au_update_clients_for_audio_frame(), au_update_clients_for_video_frame(), snd_bgm_enqueue_legacy_command(), and snd_song_get_playing_info().
| BGMPlayer* gBGMPlayerB |
Definition at line 7 of file engine.c.
Referenced by au_bgm_get_player_with_song_name(), au_bgm_stop_all(), au_engine_init(), au_get_bgm_player(), au_get_bgm_player_and_file(), au_get_client_by_priority(), au_set_bus_volume_level(), au_update_clients_for_audio_frame(), au_update_clients_for_video_frame(), snd_bgm_enqueue_legacy_command(), and snd_song_get_playing_info().
| BGMPlayer* gBGMPlayerC |
Definition at line 8 of file engine.c.
Referenced by au_engine_init().
| SoundManager* gSoundManager |
Definition at line 9 of file engine.c.
Referenced by au_engine_init(), au_get_client_by_priority(), au_set_bus_volume_level(), au_set_reverb_type(), au_update_clients_for_audio_frame(), au_update_clients_for_video_frame(), snd_adjust_sound(), snd_adjust_sound_with_shift(), snd_disable_sfx(), snd_enable_sfx(), snd_reset(), snd_start_sound(), snd_start_sound_raw(), snd_start_sound_with_shift(), and snd_stop_sound().
| AuGlobals* gSoundGlobals |
Definition at line 10 of file engine.c.
Referenced by au_ambient_load(), au_clear_instrument_group(), au_engine_init(), au_fetch_SBN_file(), au_get_bgm_player_and_file(), au_get_BK_instruments(), au_get_snapshot_by_index(), au_load_aux_bank(), au_load_BGM(), au_load_song_files(), au_release_voice(), au_reload_song_files(), au_swizzle_BK_instruments(), au_sync_channel_delay_enabled(), au_update_clients_for_audio_frame(), au_update_clients_for_video_frame(), snd_register_callback(), snd_song_clear_music_events(), snd_song_flush_music_events(), snd_song_get_playing_info(), snd_song_poll_music_events(), and snd_song_trigger_music_event().
| AmbienceManager* gAuAmbienceManager |
Definition at line 11 of file engine.c.
Referenced by au_ambient_load(), au_engine_init(), au_mseq_check_player_index(), au_mseq_check_stopped(), au_mseq_load_tracks_fade(), au_mseq_pause(), au_mseq_resume(), au_mseq_set_disabled(), au_mseq_set_volume(), au_mseq_start(), au_mseq_stop_quick(), au_mseq_stop_slow(), and au_update_clients_for_audio_frame().
|
extern |
Volume steps use squared values so each level represents linear power increase, matching loudness perception.
This makes each step sound evenly spaced.
Definition at line 299 of file sfx_player.c.
Referenced by au_set_bus_volume_level().
|
extern |
Definition at line 317 of file sfx_player.c.
Referenced by au_get_instrument().
|
extern |
Definition at line 322 of file sfx_player.c.
|
extern |
Definition at line 378 of file sfx_player.c.
Referenced by au_compute_pitch_ratio().