Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
2e230_len_2190.c File Reference

Go to the source code of this file.

Macros

#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_LOOKUP(i, fmt, e)   (au_fetch_SBN_file(globals->mseqFileList[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
}
 

Functions

void func_80052E30 (u8 index)
 
void au_engine_init (s32 outputRate)
 
void au_update_clients_2 (void)
 
void au_update_players_main (void)
 
void au_syn_update (AuGlobals *globals)
 
void au_reset_nonfree_voice (AuVoice *voice, u8 index)
 
void au_reset_voice (AuVoice *voice, u8 voiceIdx)
 
f32 au_compute_pitch_ratio (s32 pitch)
 
void au_fade_init (Fade *fade, s32 time, s32 startValue, s32 endValue)
 
void au_fade_clear (Fade *fade)
 
void au_fade_update (Fade *fade)
 
void au_fade_set_volume (u8 busId, u16 volume, s32 busVolume)
 
void func_80053AC8 (Fade *fade)
 
void au_fade_set_vol_scale (Fade *fade, s16 value)
 
void func_80053B04 (Fade *fade, u32 arg1, s32 target)
 
void func_80053BA8 (Fade *fade)
 
Instrumentau_get_instrument (AuGlobals *globals, u32 bank, u32 patch, EnvelopeData *envData)
 
void au_get_bgm_player_and_file (u32 playerIndex, BGMHeader **outFile, BGMPlayer **outPlayer)
 
void au_get_bgm_player (u32 playerIndex, BGMPlayer **outPlayer)
 
AuResult au_load_song_files (u32 songID, BGMHeader *bgmFile, BGMPlayer *player)
 
AuResult func_80053E58 (s32 songID, BGMHeader *bgmFile)
 
BGMPlayerfunc_80053F64 (s32 arg0)
 
AuResult au_ambient_load (u32 ambSoundID)
 
BGMPlayerfunc_80054248 (u8 arg0)
 
void au_load_INIT (AuGlobals *arg0, s32 romAddr, ALHeap *heap)
 
AuResult au_fetch_SBN_file (u32 fileIdx, AuFileFormat format, SBNFileEntry *outEntry)
 
void au_load_PER (AuGlobals *globals, s32 romAddr)
 
void au_load_PRG (AuGlobals *arg0, s32 romAddr)
 
s32 snd_load_BGM (s32 arg0)
 
InstrumentGroupau_get_BK_instruments (s32 bankGroup, u32 bankIndex)
 
SoundBankau_load_BK_to_bank (s32 bkFileOffset, SoundBank *bank, s32 bankIndex, s32 bankGroup)
 
void au_swizzle_BK_instruments (s32 bkFileOffset, SoundBank *bank, InstrumentGroup instruments, u32 instrumentCount, u8 arg4)
 
s32 * func_80054AA0 (s32 *bkFileOffset, void *vaddr, s32 bankIndex, s32 bankGroup)
 
s32 snd_load_BK (s32 bkFileOffset, s32 bankIndex)
 
void func_80054C84 (s32 bankIndex, s32 bankGroup)
 
void func_80054CE0 (s32 arg0, u32 idx)
 
s32 func_80054D74 (s32 arg0, s32 arg1)
 
void func_80054DA8 (u32 bMonoSound)
 
void au_read_rom (s32 romAddr, void *buffer, u32 size)
 
void au_memset (void *dst, s32 size, u8 value)
 
void au_copy_bytes (s8 *src, s8 *dest, s32 size)
 
void au_copy_words (void *src, void *dst, s32 size)
 

Variables

AuCallback BeginSoundUpdateCallback
 
BGMPlayergBGMPlayerA
 
BGMPlayergBGMPlayerB
 
BGMPlayergBGMPlayerC
 
SoundManagergSoundManager
 
AuGlobalsgSoundGlobals
 
AmbienceManagergAuAmbienceManager
 
u16 D_80078530 [9]
 
u8 EnvelopePressDefault []
 
u8 EnvelopeReleaseDefault []
 
f32 AlTuneScaling []
 

Macro Definition Documentation

◆ TUNE_SCALING_ARR_AMPLIFY_FINE

#define TUNE_SCALING_ARR_AMPLIFY_FINE   0

Definition at line 376 of file 2e230_len_2190.c.

Referenced by au_compute_pitch_ratio().

◆ TUNE_SCALING_ARR_AMPLIFY_COARSE

#define TUNE_SCALING_ARR_AMPLIFY_COARSE   128

Definition at line 377 of file 2e230_len_2190.c.

Referenced by au_compute_pitch_ratio().

◆ TUNE_SCALING_ARR_ATTENUATE_FINE

#define TUNE_SCALING_ARR_ATTENUATE_FINE   160

Definition at line 378 of file 2e230_len_2190.c.

Referenced by au_compute_pitch_ratio().

◆ TUNE_SCALING_ARR_ATTENUATE_COARSE

#define TUNE_SCALING_ARR_ATTENUATE_COARSE   288

Definition at line 379 of file 2e230_len_2190.c.

Referenced by au_compute_pitch_ratio().

◆ SBN_LOOKUP

#define SBN_LOOKUP ( i,
fmt,
e )   (au_fetch_SBN_file(globals->mseqFileList[AmbientSoundIDtoMSEQFileIndex[i]], fmt, &e))

Definition at line 636 of file 2e230_len_2190.c.

Referenced by au_ambient_load().

◆ AL_HEADER_SIG_BK

#define AL_HEADER_SIG_BK   0x424B

Definition at line 906 of file 2e230_len_2190.c.

Referenced by au_load_BK_to_bank(), and func_80054AA0().

◆ AL_HEADER_SIG_CR

#define AL_HEADER_SIG_CR   0x4352

Definition at line 907 of file 2e230_len_2190.c.

Referenced by au_load_BK_to_bank(), and func_80054AA0().

◆ AL_HEADER_SIG_DR

#define AL_HEADER_SIG_DR   0x4452

Definition at line 908 of file 2e230_len_2190.c.

Referenced by au_load_BK_to_bank().

◆ AL_HEADER_SIG_SR

#define AL_HEADER_SIG_SR   0x5352

Definition at line 909 of file 2e230_len_2190.c.

Referenced by au_load_BK_to_bank().

Enumeration Type Documentation

◆ BKParseState

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 893 of file 2e230_len_2190.c.

893 {
894 BK_READ_DONE = 0,
897 BK_READ_SWIZZLE = 31,
898 BK_READ_PROCESS_CR = 101,
899 BK_READ_SWIZZLE_CR = 111,
900 BK_READ_PROCESS_DR = 201,
901 BK_READ_UNK_DR = 211,
902 BK_READ_PROCESS_SR = 301,
903 BK_READ_UNK_SR = 311,
904};
@ BK_READ_SWIZZLE_CR
@ BK_READ_PROCESS_DR
@ BK_READ_FETCH_HEADER
@ BK_READ_UNK_DR
@ BK_READ_PROCESS_SR
@ BK_READ_FETCH_DATA
@ BK_READ_PROCESS_CR
@ BK_READ_SWIZZLE
@ BK_READ_DONE
@ BK_READ_UNK_SR

Function Documentation

◆ func_80052E30()

void func_80052E30 ( u8 index)

Definition at line 18 of file 2e230_len_2190.c.

18 {
19 AuVoice* voice = &gSoundGlobals->voices[index];
20
21 voice->cmdPtr = NULL;
23}
AuGlobals * gSoundGlobals
AuVoice voices[24]
Definition audio.h:938
@ AU_PRIORITY_FREE
Definition audio.h:65
u8 priority
Definition audio.h:741
u8 * cmdPtr
Definition audio.h:722

Referenced by au_pull_voice().

◆ au_engine_init()

void au_engine_init ( s32 outputRate)

Definition at line 25 of file 2e230_len_2190.c.

25 {
26 AuGlobals* globals;
27 ALHeap* alHeap;
28 SBNFileEntry fileEntry;
29 s32* dummyTrackData;
30 u8 effects[4];
31 u32 i;
32
33 alHeap = gSynDriverPtr->heap;
34 gSoundGlobals = alHeapAlloc(alHeap, 1, sizeof(*gSoundGlobals));
35
36 gBGMPlayerA = alHeapAlloc(alHeap, 1, sizeof(*gBGMPlayerA));
37 gBGMPlayerB = alHeapAlloc(alHeap, 1, sizeof(*gBGMPlayerB));
38 gBGMPlayerC = alHeapAlloc(alHeap, 1, sizeof(*gBGMPlayerC));
39 gSoundManager = alHeapAlloc(alHeap, 1, sizeof(*gSoundManager));
43
44 globals = gSoundGlobals;
45 dummyTrackData = alHeapAlloc(alHeap, 1, 0x8000);
46 globals->dataBGM[0] = (BGMHeader*) &dummyTrackData[0];
47 globals->dataBGM[1] = (BGMHeader*) &dummyTrackData[0x1400];
48 globals->dataMSEQ[0] = (MSEQHeader*) &dummyTrackData[0x1C00];
49 globals->dataMSEQ[1] = (MSEQHeader*) &dummyTrackData[0x1400];
50
51 for (i = 0; i < ARRAY_COUNT(globals->unk_globals_6C); i++) {
52 globals->unk_globals_6C[i].bgmPlayer = alHeapAlloc(alHeap, 1, sizeof(BGMPlayer));
53 }
54
55 globals->dataSEF = alHeapAlloc(alHeap, 1, 0x5200);
56 globals->defaultInstrument = alHeapAlloc(alHeap, 1, sizeof(Instrument));
57 globals->dataPER = alHeapAlloc(alHeap, 1, 6 * sizeof(PEREntry));
58 globals->dataPRG = alHeapAlloc(alHeap, 1, 64 * sizeof(BGMInstrumentInfo));
59 globals->musicEventQueue = alHeapAlloc(alHeap, 1, 16 * sizeof(MusicEventTrigger));
60 globals->outputRate = outputRate;
61 au_reset_instrument(globals->defaultInstrument);
62 au_reset_drum_entry(&globals->defaultDrumEntry);
63 au_reset_instrument_entry(&globals->defaultPRGEntry);
65
66 globals->audioThreadCallbacks[0] = NULL;
67 globals->audioThreadCallbacks[1] = NULL;
68
69 for (i = 0; i < ARRAY_COUNT(globals->unk_globals_6C); i++) {
70 globals->unk_globals_6C[i].unk_4 = 0;
71 globals->unk_globals_6C[i].unk_5 = 0;
72 }
73
74 for (i = 0; i < ARRAY_COUNT(globals->effectChanges); i++) {
75 globals->effectChanges[i].type = AU_FX_NONE;
76 globals->effectChanges[i].changed = FALSE;
77 }
78
79 for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
80 AuVoice* voice;
83 voice = &globals->voices[i];
84 voice->instrument = NULL;
85 voice->pitchRatio = 0;
86 voice->p_volume = -1;
87 voice->pan = 0xFF;
88 voice->reverb = 0xFF;
89 voice->busId = 0;
90 voice->stopPending = FALSE;
91 voice->syncFlags = 0;
94 }
95
96 au_load_INIT(globals, audio_ROM_START, alHeap);
97
98 for (i = 0; i < ARRAY_COUNT(globals->banks); i++) {
99 globals->banks[i] = alHeapAlloc(alHeap, 1, 0x840);
100 }
101
103 effects[0] = FX_BUS_BGMA_MAIN;
104 effects[1] = FX_BUS_BGMA_AUX;
105 effects[2] = -1;
106 effects[3] = -1;
108
110 effects[0] = FX_BUS_BGMB;
111 effects[1] = -1;
112 effects[2] = -1;
113 effects[3] = -1;
115
118 au_init_voices(globals);
119 au_load_BK_headers(globals, alHeap);
120 if (au_fetch_SBN_file(globals->mseqFileList[0], AU_FMT_SEF, &fileEntry) == AU_RESULT_OK) {
121 au_read_rom(fileEntry.offset, globals->dataSEF, fileEntry.data & 0xFFFFFF);
122 }
124 if (au_fetch_SBN_file(globals->mseqFileList[1], AU_FMT_PER, &fileEntry) == AU_RESULT_OK) {
125 au_load_PER(globals, fileEntry.offset);
126 }
127 if (au_fetch_SBN_file(globals->mseqFileList[2], AU_FMT_PRG, &fileEntry) == AU_RESULT_OK) {
128 au_load_PRG(globals, fileEntry.offset);
129 }
130
131 globals->instrumentGroups[0] = globals->instrumentGroup1;
132 globals->instrumentGroups[1] = globals->instrumentGroup2;
133 globals->instrumentGroups[2] = globals->instrumentGroupX;
134 globals->instrumentGroups[3] = globals->instrumentGroup3;
135 globals->instrumentGroups[4] = globals->instrumentGroup4;
136 globals->instrumentGroups[5] = globals->instrumentGroup5;
137 globals->instrumentGroups[6] = globals->instrumentGroup6;
138 globals->instrumentGroups[7] = globals->instrumentGroup1;
139 globals->channelDelaySide = 0;
140 globals->channelDelayTime = 0;
141 globals->channelDelayBusId = 0;
142 globals->channelDelayPending = 0;
143
145 func_80055050(alHeap);
146}
void au_bgm_set_effect_indices(BGMPlayer *player, u8 *list)
void au_bgm_player_init(BGMPlayer *player, s32 priority, s32 busId, AuGlobals *globals)
void au_amb_manager_init(AmbienceManager *manager, s8 priority, s8 busId, AuGlobals *globals)
Definition 2BF90.c:39
void au_init_voices(AuGlobals *globals)
BGMPlayer * gBGMPlayerB
SoundManager * gSoundManager
void au_read_rom(s32 romAddr, void *buffer, u32 size)
void au_load_PRG(AuGlobals *arg0, s32 romAddr)
AuResult au_fetch_SBN_file(u32 fileIdx, AuFileFormat format, SBNFileEntry *outEntry)
BGMPlayer * gBGMPlayerA
BGMPlayer * gBGMPlayerC
void au_load_INIT(AuGlobals *arg0, s32 romAddr, ALHeap *heap)
void au_load_PER(AuGlobals *globals, s32 romAddr)
AmbienceManager * gAuAmbienceManager
void au_load_BK_headers(AuGlobals *globals, ALHeap *heap)
void func_80055050(ALHeap *heap)
Definition 30450.c:103
void bgm_clear_music_events(void)
Definition 30450.c:821
void au_pvoice_set_bus(u8 index, s8 busId)
Definition 31650.c:294
void * alHeapAlloc(ALHeap *heap, s32 count, s32 size)
Definition 31650.c:743
void au_delay_channel(s16 arg0)
Definition 31650.c:710
void au_syn_set_wavetable(u8 voiceIdx, Instrument *instrument)
Definition 31650.c:398
f32 outputRate
Definition audio.h:890
u8 channelDelayPending
Definition audio.h:904
SoundManager * soundManager
Definition audio.h:1004
@ AU_FX_NONE
Definition audio.h:87
Instrument * defaultInstrument
Definition audio.h:891
InstrumentGroup instrumentGroup6[4]
Definition audio.h:932
MusicEventTrigger * musicEventQueue
Definition audio.h:921
struct MSEQHeader * dataMSEQ[2]
Definition audio.h:911
InstrumentGroup instrumentGroup3[16]
Definition audio.h:927
AuCallback audioThreadCallbacks[2]
Definition audio.h:925
f32 pitchRatio
Definition audio.h:714
InstrumentGroup instrumentGroup1[4]
Definition audio.h:928
BGMInstrumentInfo * dataPRG
Definition audio.h:909
s8 clientPriority
Definition audio.h:740
ALHeap * heap
Definition audio.h:516
@ FX_BUS_BGMA_MAIN
Definition audio.h:119
@ FX_BUS_BGMA_AUX
Definition audio.h:122
@ FX_BUS_SOUND
Definition audio.h:120
@ FX_BUS_BGMB
Definition audio.h:121
u8 pan
Definition audio.h:717
u8 syncFlags
Definition audio.h:739
InstrumentGroup instrumentGroup2[16]
Definition audio.h:929
AuSynDriver * gSynDriverPtr
Definition 31650.c:15
u8 channelDelayBusId
Definition audio.h:905
u8 channelDelaySide
Definition audio.h:907
SoundBank * banks[3]
Definition audio.h:936
u8 stopPending
Definition audio.h:738
Instrument * instrument
Definition audio.h:713
struct BGMHeader * dataBGM[2]
Definition audio.h:910
PEREntry * dataPER
Definition audio.h:908
BGMInstrumentInfo defaultPRGEntry
Definition audio.h:893
struct BGMPlayer * bgmPlayer
Definition audio.h:883
u8 reverb
Definition audio.h:718
s32 offset
Definition audio.h:835
InstrumentGroup instrumentGroupX[1]
Definition audio.h:926
s16 p_volume
Definition audio.h:716
@ AU_PRIORITY_BGM_PLAYER_MAIN
Definition audio.h:66
@ AU_PRIORITY_MSEQ_MANAGER
Definition audio.h:69
@ AU_PRIORITY_SFX_MANAGER
Definition audio.h:68
@ AU_PRIORITY_BGM_PLAYER_AUX
Definition audio.h:67
SndGlobalsSub6C unk_globals_6C[1]
Definition audio.h:912
InstrumentGroup * instrumentGroups[8]
Definition audio.h:933
AuEffectChange effectChanges[4]
Definition audio.h:903
AuGlobals * globals
Definition audio.h:1160
u8 busId
Definition audio.h:719
InstrumentGroup instrumentGroup4[16]
Definition audio.h:930
u16 * mseqFileList
Definition audio.h:902
SEFHeader * dataSEF
Definition audio.h:924
InstrumentGroup instrumentGroup5[16]
Definition audio.h:931
u8 channelDelayTime
Definition audio.h:906
BGMDrumInfo defaultDrumEntry
Definition audio.h:892
u32 MusicEventTrigger
@ AU_FMT_PRG
Definition enums.h:1778
@ AU_FMT_PER
Definition enums.h:1777
@ AU_FMT_SEF
Definition enums.h:1775
@ AU_RESULT_OK
Definition enums.h:1756
void au_sfx_load_groups_from_SEF(SoundManager *sndMgr)
Definition sfx_player.c:506
void au_sfx_init(SoundManager *manager, u8 arg1, u8 arg2, AuGlobals *arg3, u8 arg4)
Definition sfx_player.c:423
#define ARRAY_COUNT(arr)
Definition macros.h:40

Referenced by create_audio_system().

◆ au_update_clients_2()

void au_update_clients_2 ( void )

Definition at line 191 of file 2e230_len_2190.c.

191 {
192 AuGlobals* globals = gSoundGlobals;
193 SoundManager* sfxManager = gSoundManager;
195 BGMPlayer* bgmPlayer;
196
197 au_syn_update(globals);
198
199 ambManager->nextUpdateCounter -= ambManager->nextUpdateStep;
200 if (ambManager->nextUpdateCounter <= 0) {
201 ambManager->nextUpdateCounter += ambManager->nextUpdateInterval;
202 au_amb_manager_update(ambManager);
203 }
204
205 if (sfxManager->fadeInfo.fadeTime != 0) {
206 au_fade_update(&sfxManager->fadeInfo);
207 au_fade_set_volume(sfxManager->busId, sfxManager->fadeInfo.curVolume.u16, sfxManager->busVolume);
208 }
209
210 sfxManager->nextUpdateCounter -= sfxManager->nextUpdateStep;
211 if (sfxManager->nextUpdateCounter <= 0) {
212 sfxManager->nextUpdateCounter += sfxManager->nextUpdateInterval;
213 sfxManager->unk_BA = au_sfx_manager_update(sfxManager);
214 }
215
216 // update gBGMPlayerB
218 bgmPlayer = gBGMPlayerB;
219 if (bgmPlayer->fadeInfo.fadeTime != 0) {
220 au_bgm_update_fade(bgmPlayer);
221 }
222 if (bgmPlayer->songName != 0) {
223 bgmPlayer->songPlayingCounter++;
224 }
225
226 bgmPlayer->nextUpdateCounter -= bgmPlayer->nextUpdateStep;
227 if (bgmPlayer->nextUpdateCounter <= 0) {
228 bgmPlayer->nextUpdateCounter += bgmPlayer->nextUpdateInterval;
229 bgmPlayer->unk_5C = au_bgm_player_update_main(bgmPlayer);
230 }
231 }
232
234 if (globals->unk_80 != 0) {
235 func_8004DFD4(globals);
236 }
237 bgmPlayer = gBGMPlayerA;
238 if (bgmPlayer->fadeInfo.volScaleTime != 0) {
239 func_80053BA8(&bgmPlayer->fadeInfo);
240 if (bgmPlayer->fadeInfo.fadeTime == 0) {
241 func_8004E444(bgmPlayer);
242 } else {
243 au_bgm_update_fade(bgmPlayer);
244 }
245 } else if (bgmPlayer->fadeInfo.fadeTime != 0) {
246 au_bgm_update_fade(bgmPlayer);
247 }
248 if (bgmPlayer->songName != 0) {
249 bgmPlayer->songPlayingCounter++;
250 }
251
252 bgmPlayer->nextUpdateCounter -= bgmPlayer->nextUpdateStep;
253 if (bgmPlayer->nextUpdateCounter <= 0) {
254 bgmPlayer->nextUpdateCounter += bgmPlayer->nextUpdateInterval;
255 bgmPlayer->unk_5C = au_bgm_player_update_main(bgmPlayer);
256 }
257 }
258 au_update_voices(globals);
259}
void func_8004DFD4(AuGlobals *globals)
void func_8004E444(BGMPlayer *arg0)
void au_bgm_update_fade(BGMPlayer *player)
s32 au_bgm_player_update_main(BGMPlayer *player)
void au_amb_manager_update(AmbienceManager *manager)
Definition 2BF90.c:255
void au_update_voices(AuGlobals *globals)
void au_fade_update(Fade *fade)
void au_syn_update(AuGlobals *globals)
void au_fade_set_volume(u8 busId, u16 volume, s32 busVolume)
void func_80053BA8(Fade *fade)
VolumeField curVolume
Definition audio.h:366
s32 songPlayingCounter
Definition audio.h:1009
s32 nextUpdateInterval
Definition audio.h:1162
s32 songName
Definition audio.h:1010
s32 nextUpdateInterval
Definition audio.h:666
struct Fade fadeInfo
Definition audio.h:668
s32 nextUpdateInterval
Definition audio.h:1006
s32 nextUpdateStep
Definition audio.h:1161
s32 nextUpdateCounter
Definition audio.h:1007
s16 volScaleTime
Definition audio.h:378
s32 busVolume
Definition audio.h:669
s32 nextUpdateStep
Definition audio.h:665
s32 nextUpdateStep
Definition audio.h:1005
s32 unk_80
Definition audio.h:916
s16 fadeTime
Definition audio.h:369
s16 unk_5C
Definition audio.h:1021
s32 PreventBGMPlayerUpdate
Definition 30450.c:6
u16 u16
Definition audio.h:360
s32 nextUpdateCounter
Definition audio.h:1163
Fade fadeInfo
Definition audio.h:1014
s16 unk_BA
Definition audio.h:679
s32 nextUpdateCounter
Definition audio.h:667
s16 au_sfx_manager_update(SoundManager *manager)

Referenced by alAudioFrame().

◆ au_update_players_main()

void au_update_players_main ( void )

Definition at line 261 of file 2e230_len_2190.c.

261 {
262 AuGlobals* globals = gSoundGlobals;
263 BGMPlayer* player = gBGMPlayerA;
264 SoundManager* manager = gSoundManager;
265
266 if (globals->flushMusicEventQueue) {
268 }
269
271 if (BeginSoundUpdateCallback != NULL) {
273 }
274
275 au_bgm_update_main(player);
276
277 player = gBGMPlayerB;
278 au_bgm_update_main(player);
279
280 au_sfx_update_main(manager);
281}
void au_bgm_update_main(BGMPlayer *player)
AuCallback BeginSoundUpdateCallback
s32 flushMusicEventQueue
Definition audio.h:923
void au_sfx_update_main(SoundManager *manager)
Definition sfx_player.c:569

Referenced by alAudioFrame().

◆ au_syn_update()

void au_syn_update ( AuGlobals * globals)

Definition at line 283 of file 2e230_len_2190.c.

283 {
284 u32 i;
285
286 if (globals->unk_130C == 2) {
287 globals->unk_130C = 1;
289 }
290
291 if (globals->channelDelayPending && (globals->unk_130C == 0)) {
292 switch (globals->channelDelaySide) {
293 case 1:
296 globals->channelDelayPending = FALSE;
297 break;
298 case 2:
301 globals->channelDelayPending = FALSE;
302 break;
303 default:
305 globals->channelDelayPending = FALSE;
306 break;
307 }
308 }
309
310 if (globals->effectChanges[FX_BUS_BGMA_MAIN].changed) {
312 globals->effectChanges[FX_BUS_BGMA_MAIN].changed = FALSE;
313 }
314 if (globals->effectChanges[FX_BUS_SOUND].changed) {
316 globals->effectChanges[FX_BUS_SOUND].changed = FALSE;
317
318 } if (globals->effectChanges[FX_BUS_BGMB].changed) {
320 globals->effectChanges[FX_BUS_BGMB].changed = FALSE;
321 }
322 if (globals->effectChanges[FX_BUS_BGMA_AUX].changed) {
324 globals->effectChanges[FX_BUS_BGMA_AUX].changed = FALSE;
325 }
326
327 for (i = 0; i < ARRAY_COUNT(globals->voices); i++) {
328 AuVoice* voice = &globals->voices[i];
329 u8 voiceUpdateFlags = voice->syncFlags;
330
331 if (voice->stopPending) {
333 voice->stopPending = FALSE;
334 voice->cmdPtr = NULL;
335 voice->priority = AU_PRIORITY_FREE;
336 }
337
338 if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_ALL) {
339 au_voice_start(voice, &voice->envelope);
340 au_syn_start_voice_params(i, voice->busId, voice->instrument, voice->pitchRatio, voice->p_volume, voice->pan, voice->reverb, voice->delta);
341 // priority may be AU_PRIORITY_FREE if this voice was stolen and reset
342 voice->priority = voice->clientPriority;
343 } else {
344 if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PITCH) {
345 au_syn_set_pitch(i, voice->pitchRatio);
346 }
347
348 if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PARAMS) {
349 au_syn_set_mixer_params(i, voice->p_volume, voice->delta, voice->pan, voice->reverb);
350 } else if (voiceUpdateFlags & AU_VOICE_SYNC_FLAG_PAN_FXMIX) {
351 au_syn_set_pan_fxmix(i, voice->pan, voice->reverb);
352 }
353 }
354 voice->syncFlags = 0;
355 }
356}
void au_voice_start(AuVoice *voice, EnvelopeData *envData)
void au_disable_channel_delay(void)
Definition 31650.c:704
void au_delay_right_channel(u8 groupIdx)
Definition 31650.c:689
void au_syn_stop_voice(u8 voiceIdx)
Definition 31650.c:301
void au_syn_set_pitch(u8 voiceIdx, f32 pitch)
Definition 31650.c:436
void au_set_delay_time(s32 arg0)
Definition 31650.c:662
void au_bus_set_effect(u8 index, u8 effectType)
Definition 31650.c:279
void au_syn_set_pan_fxmix(u8 voiceIdx, u8 pan, u8 fxMix)
Definition 31650.c:475
void au_syn_start_voice_params(u8 voiceIdx, u8 busId, Instrument *instrument, f32 pitch, s16 vol, u8 pan, u8 fxMix, s32 delta)
Definition 31650.c:335
void au_delay_left_channel(u8 groupIdx)
Definition 31650.c:674
void au_syn_set_mixer_params(u8 voiceIdx, s16 volume, s32 delta, u8 pan, u8 fxMix)
Definition 31650.c:442
EnvelopeData envelope
Definition audio.h:721
@ AU_VOICE_SYNC_FLAG_PARAMS
Definition audio.h:81
@ AU_VOICE_SYNC_FLAG_PAN_FXMIX
Definition audio.h:83
@ AU_VOICE_SYNC_FLAG_PITCH
Definition audio.h:82
@ AU_VOICE_SYNC_FLAG_ALL
Definition audio.h:80
u8 unk_130C
Definition audio.h:934
s32 delta
Definition audio.h:715

Referenced by au_update_clients_2().

◆ au_reset_nonfree_voice()

void au_reset_nonfree_voice ( AuVoice * voice,
u8 index )

Definition at line 358 of file 2e230_len_2190.c.

358 {
359 if (voice->priority != AU_PRIORITY_FREE) {
360 voice->cmdPtr = NULL;
361 voice->stopPending = TRUE;
362 voice->syncFlags = 0;
364 }
365}
void au_syn_set_volume_delta(u8 voiceIdx, s16 vol, s32 delta)
Definition 31650.c:505
#define AUDIO_SAMPLES
Definition audio.h:44

◆ au_reset_voice()

void au_reset_voice ( AuVoice * voice,
u8 voiceIdx )

Definition at line 368 of file 2e230_len_2190.c.

368 {
369 voice->cmdPtr = NULL;
370 voice->stopPending = TRUE;
371 voice->syncFlags = 0;
373}

Referenced by au_amb_player_stop(), au_amb_player_update(), au_amb_restore_voices(), au_bgm_player_update_playing(), au_BGMCmd_FC_Jump(), and func_80050900().

◆ au_compute_pitch_ratio()

f32 au_compute_pitch_ratio ( s32 pitch)

Definition at line 381 of file 2e230_len_2190.c.

381 {
382 if (pitch >= 0) {
383 return AlTuneScaling[(pitch & 0x7F) + TUNE_SCALING_ARR_AMPLIFY_FINE]
384 * AlTuneScaling[((pitch & 0xF80) >> 7) + TUNE_SCALING_ARR_AMPLIFY_COARSE];
385 } else {
386 pitch = -pitch;
387 return AlTuneScaling[(pitch & 0x7F) + TUNE_SCALING_ARR_ATTENUATE_FINE]
388 * AlTuneScaling[((pitch & 0x3F80) >> 7) + TUNE_SCALING_ARR_ATTENUATE_COARSE];
389 }
390}
#define TUNE_SCALING_ARR_AMPLIFY_COARSE
#define TUNE_SCALING_ARR_ATTENUATE_COARSE
#define TUNE_SCALING_ARR_ATTENUATE_FINE
f32 AlTuneScaling[]
Definition sfx_player.c:360
#define TUNE_SCALING_ARR_AMPLIFY_FINE

Referenced by au_amb_player_update(), au_amb_restore_voices(), and au_bgm_player_update_playing().

◆ au_fade_init()

void au_fade_init ( Fade * fade,
s32 time,
s32 startValue,
s32 endValue )

Definition at line 392 of file 2e230_len_2190.c.

392 {
393 fade->curVolume.s32 = startValue * 0x10000;
394 fade->targetVolume = endValue;
395
396 if (time != 0) {
397 fade->fadeTime = (time * 1000) / AU_5750;
398 fade->fadeStep = (endValue * 0x10000 - fade->curVolume.s32) / fade->fadeTime;
399 } else {
400 fade->fadeTime = 1;
401 fade->fadeStep = 0;
402 }
403
404 fade->onCompleteCallback = NULL;
405}
s32 fadeStep
Definition audio.h:367
s32 s32
Definition audio.h:361
#define AU_5750
Definition audio.h:22
s16 targetVolume
Definition audio.h:368

Referenced by au_bgm_dispatch_player_event(), au_sfx_init(), and func_8004DFD4().

◆ au_fade_clear()

void au_fade_clear ( Fade * fade)

Definition at line 407 of file 2e230_len_2190.c.

407 {
408 fade->fadeTime = 0;
409 fade->fadeStep = 0;
410 fade->onCompleteCallback = NULL;
411}

◆ au_fade_update()

void au_fade_update ( Fade * fade)

Definition at line 413 of file 2e230_len_2190.c.

413 {
414 fade->fadeTime--;
415
416 if ((fade->fadeTime << 0x10) != 0) {
417 fade->curVolume.s32 += fade->fadeStep;
418 } else {
419 fade->curVolume.s32 = fade->targetVolume << 0x10;
420 if (fade->onCompleteCallback != NULL) {
421 fade->onCompleteCallback();
422 fade->fadeStep = 0;
423 fade->onCompleteCallback = NULL;
424 }
425 }
426}

Referenced by au_update_clients_2().

◆ au_fade_set_volume()

void au_fade_set_volume ( u8 busId,
u16 volume,
s32 busVolume )

Definition at line 428 of file 2e230_len_2190.c.

428 {
429 au_bus_set_volume(busId, (u32)(volume * busVolume) >> 15);
430}
void au_bus_set_volume(u8 index, u16 arg1)
Definition 31650.c:267

Referenced by au_sfx_init(), au_update_clients_2(), and func_8004E444().

◆ func_80053AC8()

void func_80053AC8 ( Fade * fade)

Definition at line 432 of file 2e230_len_2190.c.

432 {
433 if (fade->fadeTime == 0) {
434 fade->fadeTime = 1;
435 fade->fadeStep = 0;
436 fade->targetVolume = fade->curVolume.u16;
437 }
438}

Referenced by func_80054CE0().

◆ au_fade_set_vol_scale()

void au_fade_set_vol_scale ( Fade * fade,
s16 value )

Definition at line 440 of file 2e230_len_2190.c.

440 {
441 fade->volScale.s32 = value << 16;
442 fade->targetVolScale = value;
443 fade->volScaleTime = 0;
444 fade->volScaleStep = 0;
445}
s32 volScaleStep
Definition audio.h:376
VolumeField volScale
Definition audio.h:375
s16 targetVolScale
Definition audio.h:377

Referenced by au_bgm_player_init().

◆ func_80053B04()

void func_80053B04 ( Fade * fade,
u32 arg1,
s32 target )

Definition at line 447 of file 2e230_len_2190.c.

447 {
448 s16 time;
449 s32 delta;
450
451 if (arg1 >= 250 && arg1 <= 100000) {
452 time = (s32)(arg1 * 1000) / AU_5750;
453 delta = (target << 16) - fade->volScale.s32;
454
455 fade->targetVolScale = target;
456 fade->volScaleTime = time;
457 fade->volScaleStep = delta / time;
458 } else {
459 fade->volScaleTime = 0;
460 fade->volScaleStep = 0;
461 }
462}

Referenced by func_8004E0F4().

◆ func_80053BA8()

void func_80053BA8 ( Fade * fade)

Definition at line 464 of file 2e230_len_2190.c.

464 {
465 fade->volScaleTime--;
466
467 if (fade->volScaleTime != 0) {
468 fade->volScale.s32 += fade->volScaleStep;
469 } else {
470 fade->volScaleStep = 0;
471 fade->volScale.s32 = fade->targetVolScale << 16;
472 }
473}

Referenced by au_update_clients_2().

◆ au_get_instrument()

Instrument * au_get_instrument ( AuGlobals * globals,
u32 bank,
u32 patch,
EnvelopeData * envData )

Definition at line 476 of file 2e230_len_2190.c.

476 {
477 Instrument* instrument = (*globals->instrumentGroups[(bank & 0x70) >> 4])[patch];
478 EnvelopePreset* preset = instrument->envelopes;
479 u32 envelopeIdx = bank & 3;
480
481 if (envelopeIdx < preset->count) {
482 envData->cmdListPress = AU_FILE_RELATIVE(preset, preset->offsets[envelopeIdx].offsetPress);
483 envData->cmdListRelease = AU_FILE_RELATIVE(preset, preset->offsets[envelopeIdx].offsetRelease);
484 } else {
486 envData->cmdListRelease = &EnvelopePressDefault[4]; //EnvelopeReleaseDefault;
487 }
488 return instrument;
489}
u8 EnvelopePressDefault[]
Definition sfx_player.c:299
u8 * cmdListPress
Definition audio.h:533
u8 * cmdListRelease
Definition audio.h:534
EnvelopeOffset offsets[1]
Definition audio.h:545
u16 offsetPress
Definition audio.h:538
#define AU_FILE_RELATIVE(base, offset)
Definition audio.h:40
EnvelopePreset * envelopes
Definition audio.h:571
u16 offsetRelease
Definition audio.h:539

Referenced by au_amb_player_update(), au_bgm_player_update_playing(), au_BGMCmd_E8_TrackOverridePatch(), and au_BGMCmd_F5_TrackVoice().

◆ au_get_bgm_player_and_file()

void au_get_bgm_player_and_file ( u32 playerIndex,
BGMHeader ** outFile,
BGMPlayer ** outPlayer )

Definition at line 491 of file 2e230_len_2190.c.

491 {
492 AuGlobals* globals = gSoundGlobals;
493
494 switch (playerIndex) {
495 case 0:
496 *outFile = globals->dataBGM[0];
497 *outPlayer = gBGMPlayerA;
498 break;
499 case 1:
500 *outFile = globals->dataBGM[1];
501 *outPlayer = gBGMPlayerB;
502 break;
503 case 2:
504 *outFile = globals->dataBGM[0];
505 *outPlayer = gBGMPlayerA;
506 break;
507 default:
508 *outFile = NULL;
509 *outPlayer = NULL;
510 break;
511 }
512}

Referenced by au_song_load().

◆ au_get_bgm_player()

void au_get_bgm_player ( u32 playerIndex,
BGMPlayer ** outPlayer )

Definition at line 514 of file 2e230_len_2190.c.

514 {
515 switch (playerIndex) {
516 case 0:
517 *outPlayer = gBGMPlayerA;
518 break;
519 case 1:
520 *outPlayer = gBGMPlayerB;
521 break;
522 case 2:
523 *outPlayer = gBGMPlayerA;
524 break;
525 default:
526 *outPlayer = NULL;
527 break;
528 }
529}

◆ au_load_song_files()

AuResult au_load_song_files ( u32 songID,
BGMHeader * bgmFile,
BGMPlayer * player )

Definition at line 531 of file 2e230_len_2190.c.

531 {
532 AuResult status;
533 SBNFileEntry fileEntry;
534 SBNFileEntry fileEntry2;
535 SBNFileEntry* bkFileEntry;
536 AuGlobals* soundData;
537 InitSongEntry* songInfo;
538 s32 i;
539 u16 bkFileIndex;
540 s32 bgmFileIndex;
541 u32 data;
542 u32 offset;
543 BGMPlayer* arg2_copy ;
544 BGMHeader* arg1_copy;
545 s32 cond;
546
547 soundData = gSoundGlobals;
548
549 // needed to match
550 cond = songID < soundData->songListLength;
551 arg2_copy = player;
552 arg1_copy = bgmFile;
553
554 if (cond) {
555 songInfo = &soundData->songList[songID];
556 status = au_fetch_SBN_file(songInfo->bgmFileIndex, AU_FMT_BGM, &fileEntry);
557 if (status != AU_RESULT_OK) {
558 return status;
559 }
560
561 if (func_8004DB28(arg2_copy)) {
562 return AU_ERROR_201;
563 }
564
565 au_read_rom(fileEntry.offset, arg1_copy, fileEntry.data & 0xFFFFFF);
566
567 for (i = 0; i < ARRAY_COUNT(songInfo->bkFileIndex); i++) {
568 bkFileIndex = songInfo->bkFileIndex[i];
569 if (bkFileIndex != 0) {
570 bkFileEntry = &soundData->sbnFileList[bkFileIndex];
571
572 offset = (bkFileEntry->offset & 0xFFFFFF) + soundData->baseRomOffset;
573 fileEntry2.offset = offset;
574
575 data = bkFileEntry->data;
576 fileEntry2.data = data;
577
578 if ((data >> 0x18) == AU_FMT_BK) {
579 snd_load_BK(offset, i);
580 }
581 }
582 }
583 bgmFileIndex = songInfo->bgmFileIndex;
584 arg2_copy->songID = songID;
585 arg2_copy->bgmFile = bgmFile;
586 arg2_copy->bgmFileIndex = bgmFileIndex;
587 return arg1_copy->name;
588 } else {
589 return AU_ERROR_151;
590 }
591}
s32 func_8004DB28(BGMPlayer *player)
s32 snd_load_BK(s32 bkFileOffset, s32 bankIndex)
struct BGMHeader * bgmFile
Definition audio.h:1024
u16 bkFileIndex[3]
Definition audio.h:867
s32 baseRomOffset
Definition audio.h:894
InitSongEntry * songList
Definition audio.h:898
s32 songID
Definition audio.h:1013
SBNFileEntry * sbnFileList
Definition audio.h:895
s32 name
Definition audio.h:758
u16 bgmFileIndex
Definition audio.h:866
s32 songListLength
Definition audio.h:899
s32 bgmFileIndex
Definition audio.h:1012
@ AU_FMT_BGM
Definition enums.h:1774
@ AU_FMT_BK
Definition enums.h:1776
AuResult
Definition enums.h:1755
@ AU_ERROR_151
Definition enums.h:1769
@ AU_ERROR_201
Definition enums.h:1770

Referenced by au_song_load().

◆ func_80053E58()

AuResult func_80053E58 ( s32 songID,
BGMHeader * bgmFile )

Definition at line 593 of file 2e230_len_2190.c.

593 {
594 AuResult status;
595 SBNFileEntry fileEntry;
596 SBNFileEntry sbnEntry;
597 SBNFileEntry* bkFileEntry;
598 AuGlobals* soundData;
599 InitSongEntry* songInfo;
600 s32 i;
601 u16 bkFileIndex;
602
603 soundData = gSoundGlobals;
604 songInfo = &soundData->songList[songID];
605 status = au_fetch_SBN_file(songInfo[0].bgmFileIndex, AU_FMT_BGM, &sbnEntry);
606 if (status == AU_RESULT_OK) {
607 au_read_rom(sbnEntry.offset, bgmFile, sbnEntry.data & 0xFFFFFF);
608
609 for (i = 0; i < ARRAY_COUNT(songInfo->bkFileIndex); i++) {
610 bkFileIndex = songInfo->bkFileIndex[i];
611 if (bkFileIndex != 0) {
612 bkFileEntry = &soundData->sbnFileList[bkFileIndex];
613
614 fileEntry.offset = (bkFileEntry->offset & 0xFFFFFF) + soundData->baseRomOffset;
615 fileEntry.data = bkFileEntry->data;
616
617 if ((fileEntry.data >> 0x18) == AU_FMT_BK) {
618 snd_load_BK(fileEntry.offset, i);
619 } else {
621 }
622 }
623 }
624 }
625
626 return status;
627}
@ AU_ERROR_SBN_FORMAT_MISMATCH
Definition enums.h:1768

Referenced by func_8004DE2C().

◆ func_80053F64()

BGMPlayer * func_80053F64 ( s32 arg0)

Definition at line 629 of file 2e230_len_2190.c.

629 {
630 if (arg0 == 0) {
632 }
633 return NULL;
634}

Referenced by func_8004DCB8(), and func_8004DE2C().

◆ au_ambient_load()

AuResult au_ambient_load ( u32 ambSoundID)

Definition at line 638 of file 2e230_len_2190.c.

638 {
639 AmbienceManager* manager;
640 SBNFileEntry fileEntry;
641 AuGlobals* globals;
642 MSEQHeader* mseqFile;
643 u32 i;
644
645 globals = gSoundGlobals;
646 manager = gAuAmbienceManager;
647 if (ambSoundID < AMBIENT_RADIO) {
648 if (manager->players[0].mseqName == 0 && SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
649 au_read_rom(fileEntry.offset, globals->dataMSEQ[0], fileEntry.data & 0xFFFFFF);
650 manager->mseqFiles[0] = globals->dataMSEQ[0];
651 for (i = 1; i < ARRAY_COUNT(manager->mseqFiles); i++) {
652 manager->mseqFiles[i] = NULL;
653 }
654 manager->numActivePlayers = 1;
655 }
656 } else if (ambSoundID == AMBIENT_RADIO
657 && manager->players[0].mseqName == 0
658 && manager->players[1].mseqName == 0
659 && manager->players[2].mseqName == 0) {
660 manager->numActivePlayers = 0;
661 for (i = 0; i < ARRAY_COUNT(manager->mseqFiles); i++) {
662 manager->mseqFiles[i] = NULL;
663 }
664
665 mseqFile = globals->dataMSEQ[1];
666 if (SBN_LOOKUP(ambSoundID, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
667 au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
668 manager->mseqFiles[0] = mseqFile;
669
670 mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
671 if (SBN_LOOKUP(ambSoundID + 1, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
672 au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
673 manager->mseqFiles[1] = mseqFile;
674
675 mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
676 if (SBN_LOOKUP(ambSoundID + 2, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
677 au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
678 manager->mseqFiles[2] = mseqFile;
679
680 mseqFile = AU_FILE_RELATIVE(mseqFile, (fileEntry.data + 0x40) & 0xFFFFFF);
681 if (SBN_LOOKUP(ambSoundID + 3, AU_FMT_MSEQ, fileEntry) == AU_RESULT_OK) {
682 au_read_rom(fileEntry.offset, mseqFile, fileEntry.data & 0xFFFFFF);
683 manager->mseqFiles[3] = mseqFile;
684
685 manager->numActivePlayers = 4;
686 if (SBN_LOOKUP(ambSoundID + 4, AU_FMT_BK, fileEntry) == AU_RESULT_OK) {
687 snd_load_BK(fileEntry.offset, 2);
688 }
689 }
690 }
691 }
692 }
693 }
694
695 return AU_RESULT_OK;
696}
#define SBN_LOOKUP(i, fmt, e)
MSEQHeader * mseqFiles[4]
Definition audio.h:1164
u8 numActivePlayers
Definition audio.h:1165
AmbiencePlayer players[4]
Definition audio.h:1169
@ AMBIENT_RADIO
Definition enums.h:1895
@ AU_FMT_MSEQ
Definition enums.h:1779

Referenced by snd_load_ambient().

◆ func_80054248()

BGMPlayer * func_80054248 ( u8 arg0)

Definition at line 698 of file 2e230_len_2190.c.

698 {
699 switch (arg0) {
700 case 1:
701 return gBGMPlayerA;
702 case 2:
703 return gBGMPlayerB;
704 case 4:
705 return (BGMPlayer*)gSoundManager; // TODO: why return pointer to SoundManager?
706 default:
707 return NULL;
708 }
709}

Referenced by func_8004DE2C().

◆ au_load_INIT()

void au_load_INIT ( AuGlobals * arg0,
s32 romAddr,
ALHeap * heap )

Definition at line 711 of file 2e230_len_2190.c.

711 {
712 SBNHeader sbnHeader;
713 INITHeader initHeader;
714 SBNFileEntry* entry;
715 s32 tableSize, initBase, size;
716 s32 tblAddr, shortsAddr;
717 s32* data;
718 s32 numEntries;
719 s32 tblOffset, shortsOffset;
720 s32* romPtr = &arg0->baseRomOffset;
721
722 au_read_rom(romAddr, &sbnHeader, sizeof(sbnHeader));
723 numEntries = sbnHeader.numEntries;
724 arg0->baseRomOffset = romAddr;
725 tableSize = numEntries * sizeof(SBNFileEntry);
726 arg0->fileListLength = sbnHeader.numEntries;
727 arg0->sbnFileList = alHeapAlloc(heap, 1, tableSize);
728 au_read_rom(arg0->baseRomOffset + sbnHeader.tableOffset, arg0->sbnFileList, tableSize);
729
730 entry = arg0->sbnFileList;
731 while (sbnHeader.numEntries--) {
732 if ((entry->offset & 0xFFFFFF) == 0) {
733 break;
734 }
735
736 size = entry->data;
737 entry->data = (size + 0xF) & ~0xF;
738 entry++;
739 }
740
741 if (sbnHeader.INIToffset != 0) {
742 initBase = *romPtr + sbnHeader.INIToffset;
743 au_read_rom(initBase, &initHeader, sizeof(initHeader));
744
745 tblOffset = initHeader.tblOffset;
746 size = (initHeader.tblSize + 0xF) & 0xFFF0;
747 tblAddr = initBase + tblOffset;
748 arg0->songList = alHeapAlloc(heap, 1, size);
749 au_read_rom(tblAddr, arg0->songList, size);
750
751 shortsOffset = initHeader.shortsOffset;
752 size = (initHeader.shortsSize + 0xF) & 0xFFF0;
753 shortsAddr = initBase + shortsOffset;
754 arg0->mseqFileList = alHeapAlloc(heap, 1, size);
755 au_read_rom(shortsAddr, arg0->mseqFileList, size);
756
757 arg0->bkFileListOffset = initBase + initHeader.entriesOffset;
758 arg0->bkListLength = (initHeader.entriesSize + 0xF) & 0xFFF0;
759 arg0->songListLength = initHeader.tblSize / sizeof(InitSongEntry) - 1;
760 }
761}
u16 shortsSize
Definition audio.h:821
s32 numEntries
Definition audio.h:795
u16 shortsOffset
Definition audio.h:820
s32 bkFileListOffset
Definition audio.h:900
s32 bkListLength
Definition audio.h:901
u16 tblSize
Definition audio.h:819
s32 fileListLength
Definition audio.h:896
s32 INIToffset
Definition audio.h:799
s32 tableOffset
Definition audio.h:794
u16 entriesSize
Definition audio.h:817
u16 entriesOffset
Definition audio.h:816
u16 tblOffset
Definition audio.h:818

Referenced by au_engine_init().

◆ au_fetch_SBN_file()

AuResult au_fetch_SBN_file ( u32 fileIdx,
AuFileFormat format,
SBNFileEntry * outEntry )

Definition at line 763 of file 2e230_len_2190.c.

763 {
764 SBNFileEntry fileEntry;
765 s32 status = AU_RESULT_OK;
766
767 if (fileIdx < gSoundGlobals->fileListLength) {
768 SBNFileEntry* entry = &gSoundGlobals->sbnFileList[fileIdx];
769 s32 offset = (entry->offset & 0xFFFFFF) + gSoundGlobals->baseRomOffset;
770
771 fileEntry.offset = offset;
772 fileEntry.data = entry->data;
773 if ((fileEntry.data >> 0x18) == format) {
774 outEntry->offset = offset;
775 outEntry->data = fileEntry.data;
776 } else {
778 }
779 } else {
781 }
782 return status;
783}
@ AU_ERROR_SBN_INDEX_OUT_OF_RANGE
Definition enums.h:1767

Referenced by au_engine_init(), au_load_BK_headers(), au_load_song_files(), and func_80053E58().

◆ au_load_PER()

void au_load_PER ( AuGlobals * globals,
s32 romAddr )

Definition at line 785 of file 2e230_len_2190.c.

785 {
786 PERHeader header;
787 u32 size;
788 s32 numItemsLeft;
789 s32 numItems;
790 void* end;
791
792 au_read_rom(romAddr, &header, sizeof(header));
793 size = header.mdata.size - sizeof(header);
794 au_read_rom(romAddr + sizeof(header), globals->dataPER, size);
795 numItems = size / sizeof(PEREntry);
796 numItemsLeft = 6 - numItems;
797 if (numItemsLeft > 0) {
798 end = &globals->dataPER[numItems];
799 au_copy_words(&globals->defaultDrumEntry, end, sizeof(BGMDrumInfo));
800 au_copy_words(end, end + sizeof(BGMDrumInfo), numItemsLeft * sizeof(PEREntry) - sizeof(BGMDrumInfo));
801 }
802}
void au_copy_words(void *src, void *dst, s32 size)
AUFileMetadata mdata
Definition audio.h:826

Referenced by au_engine_init().

◆ au_load_PRG()

void au_load_PRG ( AuGlobals * arg0,
s32 romAddr )

Definition at line 804 of file 2e230_len_2190.c.

804 {
805 PERHeader header;
806 u32 size;
807 s32 numItemsLeft;
808 s32 numItems;
809 s32 dataRomAddr;
810 void* end;
811
812 au_read_rom(romAddr, &header, sizeof(header));
813 dataRomAddr = romAddr + sizeof(header);
814 size = header.mdata.size - sizeof(header);
815 if (size > 0x200) {
816 size = 0x200;
817 }
818 au_read_rom(dataRomAddr, arg0->dataPRG, size);
819 numItems = size / sizeof(BGMInstrumentInfo);
820 numItemsLeft = 0x40 - numItems;
821 if (numItemsLeft > 0) {
822 end = &arg0->dataPRG[numItems];
823 au_copy_words(&arg0->defaultPRGEntry, end, sizeof(BGMInstrumentInfo));
824 au_copy_words(end, end + sizeof(BGMInstrumentInfo), numItemsLeft * sizeof(BGMInstrumentInfo) - sizeof(BGMInstrumentInfo));
825 }
826}

Referenced by au_engine_init().

◆ snd_load_BGM()

s32 snd_load_BGM ( s32 arg0)

Definition at line 828 of file 2e230_len_2190.c.

828 {
829 AuGlobals* globals = gSoundGlobals;
830 InitSongEntry* song = globals->songList;
831 s32 ret = 0;
832 s32 i;
833
834 while (TRUE) {
835 if (song->bgmFileIndex == 0xFFFF) {
836 return ret;
837 }
838
839 if (song->bgmFileIndex == arg0) {
840 for (i = 0; i < ARRAY_COUNT(song->bkFileIndex); i++) {
841 u16 bkFileIndex = song->bkFileIndex[i];
842 if (bkFileIndex != 0) {
843 SBNFileEntry* bkFileEntry = &globals->sbnFileList[bkFileIndex];
844 SBNFileEntry fileEntry;
845
846 fileEntry.offset = (bkFileEntry->offset & 0xFFFFFF) + globals->baseRomOffset;
847 fileEntry.data = bkFileEntry->data;
848 if ((fileEntry.data >> 0x18) == 0x30) {
849 snd_load_BK(fileEntry.offset, i);
850 } else {
851 ret = 0x66;
852 }
853 }
854 }
855
856 return ret;
857 }
858 song++;
859 }
860}

◆ au_get_BK_instruments()

InstrumentGroup * au_get_BK_instruments ( s32 bankGroup,
u32 bankIndex )

Definition at line 862 of file 2e230_len_2190.c.

862 {
863 InstrumentGroup* ret = NULL;
864 AuGlobals* temp = gSoundGlobals;
865
866 // TODO fake match - this multiplying the bankIndex by 16 and then dividing it right after is dumb
867 bankIndex *= 16;
868
869 switch (bankGroup) {
870 case 1:
871 ret = &temp->instrumentGroup1[bankIndex / 16];
872 break;
873 case 2:
874 ret = &temp->instrumentGroup2[bankIndex / 16];
875 break;
876 case 4:
877 ret = &temp->instrumentGroup4[bankIndex / 16];
878 break;
879 case 5:
880 ret = &temp->instrumentGroup5[bankIndex / 16];
881 break;
882 case 6:
883 ret = &temp->instrumentGroup6[bankIndex / 16];
884 break;
885 case 3:
886 ret = &temp->instrumentGroup3[bankIndex / 16];
887 break;
888 }
889
890 return ret;
891}
Instrument * InstrumentGroup[16]
Definition audio.h:574

Referenced by au_load_BK_to_bank(), func_80054AA0(), and func_80054C84().

◆ au_load_BK_to_bank()

SoundBank * au_load_BK_to_bank ( s32 bkFileOffset,
SoundBank * bank,
s32 bankIndex,
s32 bankGroup )

Definition at line 911 of file 2e230_len_2190.c.

911 {
912 ALHeap* heap = gSynDriverPtr->heap;
913 BKHeader bkHeader;
914 BKHeader* header = &bkHeader;
915 u16 keepReading;
916 u16 readState;
917 InstrumentGroup* group;
918 Instrument** inst;
919 s32 instrumentCount;
920 s32 size;
921 u32 i;
922
923 au_read_rom(bkFileOffset, header, sizeof(*header));
924 readState = BK_READ_FETCH_HEADER;
925 keepReading = TRUE;
926
927 while (keepReading) {
928 switch (readState) {
929 case BK_READ_DONE:
930 keepReading = FALSE;
931 break;
933 if (header->signature != AL_HEADER_SIG_BK) {
934 keepReading = FALSE;
935 } else if (header->size == 0) {
936 keepReading = FALSE;
937 } else {
938 readState = BK_READ_FETCH_DATA;
939 }
940 break;
942 if (header->format == AL_HEADER_SIG_CR) {
943 readState = BK_READ_PROCESS_CR;
944 } else if (header->format == AL_HEADER_SIG_DR) {
945 readState = BK_READ_PROCESS_DR;
946 } else if (header->format == AL_HEADER_SIG_SR) {
947 readState = BK_READ_PROCESS_SR;
948 } else {
949 keepReading = FALSE;
950 }
951 break;
952
954 size = ALIGN16_(header->instrumetsSize)
955 + ALIGN16_(header->unkSizeA)
956 + ALIGN16_(header->predictorsSize)
957 + ALIGN16_(header->unkSizeB)
958 + sizeof(*header);
959 if (bank == NULL) {
960 bank = alHeapAlloc(heap, 1, size);
961 }
962 au_read_rom(bkFileOffset, bank, size);
963
964 group = au_get_BK_instruments(bankGroup, bankIndex);
965 inst = (*group);
966 instrumentCount = 0;
967
968 for (i = 0; i < ARRAY_COUNT(header->instruments); inst++, i++) {
969 u16 instOffset = header->instruments[i];
970 if (instOffset != 0) {
971 instrumentCount++;
972 *inst = AU_FILE_RELATIVE(bank, instOffset);
973 } else {
974 *inst = NULL;
975 }
976 }
977
978 if (instrumentCount != 0) {
979 readState = BK_READ_SWIZZLE_CR;
980 } else {
981 keepReading = FALSE;
982 }
983 break;
985 au_swizzle_BK_instruments(bkFileOffset, bank, *group, 16, 1);
986 readState = BK_READ_DONE;
987 break;
988
989 // inferred states
991 case BK_READ_UNK_DR:
993 case BK_READ_UNK_SR:
994 default:
995 keepReading = FALSE;
996 break;
997 }
998 }
999
1000 return bank;
1001}
#define AL_HEADER_SIG_BK
#define AL_HEADER_SIG_DR
#define AL_HEADER_SIG_CR
#define AL_HEADER_SIG_SR
InstrumentGroup * au_get_BK_instruments(s32 bankGroup, u32 bankIndex)
void au_swizzle_BK_instruments(s32 bkFileOffset, SoundBank *bank, InstrumentGroup instruments, u32 instrumentCount, u8 arg4)
u16 format
Definition audio.h:852
u16 predictorsSize
Definition audio.h:860
u16 signature
Definition audio.h:848
#define ALIGN16_(val)
Definition audio.h:39
u16 unkSizeA
Definition audio.h:858
u16 instrumetsSize
Definition audio.h:856
u16 unkSizeB
Definition audio.h:862
s32 size
Definition audio.h:850
u16 instruments[16]
Definition audio.h:855

Referenced by au_load_BK_headers(), and snd_load_BK().

◆ au_swizzle_BK_instruments()

void au_swizzle_BK_instruments ( s32 bkFileOffset,
SoundBank * bank,
InstrumentGroup instruments,
u32 instrumentCount,
u8 arg4 )

Definition at line 1003 of file 2e230_len_2190.c.

1003 {
1004 Instrument* defaultInstrument = gSoundGlobals->defaultInstrument;
1005 SoundBank* sb = bank;
1006 f32 outputRate = gSoundGlobals->outputRate;
1007 s32 i;
1008
1009 if (sb->swizzled == 0) {
1010 for (i = 0; i < instrumentCount; i++) {
1011 Instrument* instrument = instruments[i];
1012
1013 if (instrument != NULL) {
1014 if (instrument->base != 0) {
1015 instrument->base += bkFileOffset;
1016 }
1017 if (instrument->loopPredictor != NULL) {
1018 instrument->loopPredictor = AU_FILE_RELATIVE(bank, instrument->loopPredictor);
1019 }
1020 if (instrument->predictor != NULL) {
1021 instrument->predictor = AU_FILE_RELATIVE(bank, instrument->predictor);
1022 }
1023 if (instrument->envelopes != NULL) {
1024 instrument->envelopes = AU_FILE_RELATIVE(bank, instrument->envelopes);
1025 }
1026 instrument->unk_25 = arg4;
1027 instrument->pitchRatio = instrument->outputRate / outputRate;
1028 } else {
1029 instruments[i] = defaultInstrument;
1030 }
1031 }
1032 sb->swizzled = 1;
1033 }
1034}
u16 * predictor
Definition audio.h:556
u8 * base
Definition audio.h:550
UNK_PTR loopPredictor
Definition audio.h:552
u8 unk_25
Definition audio.h:564
u8 swizzled
Definition audio.h:872

Referenced by au_load_BK_to_bank(), and func_80054AA0().

◆ func_80054AA0()

s32 * func_80054AA0 ( s32 * bkFileOffset,
void * vaddr,
s32 bankIndex,
s32 bankGroup )

Definition at line 1036 of file 2e230_len_2190.c.

1036 {
1037 ALHeap* heap = gSynDriverPtr->heap;
1038 BKHeader localHeader;
1039 void* fileData = vaddr;
1040 BKHeader* header = &localHeader;
1041 InstrumentGroup* group;
1042 Instrument* instruments;
1043 Instrument** inst;
1044 u32 instrCount;
1045 u32 readState;
1046 s32 keepReading;
1047
1048 u32 i;
1049 s32 swizzleArg;
1050 swizzleArg = 0;
1051 readState = BK_READ_FETCH_HEADER;
1052 keepReading = TRUE;
1053
1054
1055 while (keepReading) {
1056 switch (readState) {
1057 case BK_READ_DONE:
1058 keepReading = FALSE;
1059 break;
1061 au_read_rom(*bkFileOffset, &localHeader, sizeof(localHeader));
1062 if (header->signature != AL_HEADER_SIG_BK) {
1063 keepReading = FALSE;
1064 } else if (header->size == 0) {
1065 keepReading = FALSE;
1066 } else if (header->format != AL_HEADER_SIG_CR) {
1067 keepReading = FALSE;
1068 } else {
1069 readState = BK_READ_FETCH_DATA;
1070 }
1071 break;
1072 case BK_READ_FETCH_DATA:
1073 if (fileData == NULL) {
1074 fileData = alHeapAlloc(heap, 1, header->size);
1075 }
1076 au_read_rom(*bkFileOffset, fileData, header->size);
1077
1078 instrCount = 0;
1079 group = au_get_BK_instruments(bankGroup, bankIndex);
1080 inst = (*group);
1081 for(i = 0; i < ARRAY_COUNT(header->instruments); inst++, i++) {
1082 u16 instOffset = header->instruments[i];
1083 if(instOffset != 0) {
1084 instrCount++;
1085 *inst = AU_FILE_RELATIVE(fileData, instOffset);
1086 } else {
1087 *inst = NULL;
1088 }
1089 }
1090
1091 if (instrCount != 0) {
1092 readState = BK_READ_SWIZZLE;
1093 } else {
1094 keepReading = FALSE;
1095 }
1096 break;
1097 case BK_READ_SWIZZLE:
1098 au_swizzle_BK_instruments((s32)fileData, fileData, *group, 0x10U, swizzleArg);
1099 readState = BK_READ_DONE;
1100 break;
1101 default:
1102 keepReading = FALSE;
1103 break;
1104 }
1105 }
1106 return fileData;
1107}

◆ snd_load_BK()

s32 snd_load_BK ( s32 bkFileOffset,
s32 bankIndex )

Definition at line 1109 of file 2e230_len_2190.c.

1109 {
1110 au_load_BK_to_bank(bkFileOffset, gSoundGlobals->banks[bankIndex], bankIndex, 1);
1111 return 0;
1112}
SoundBank * au_load_BK_to_bank(s32 bkFileOffset, SoundBank *bank, s32 bankIndex, s32 bankGroup)

Referenced by au_ambient_load(), au_load_song_files(), func_80053E58(), and snd_load_BGM().

◆ func_80054C84()

void func_80054C84 ( s32 bankIndex,
s32 bankGroup )

Definition at line 1114 of file 2e230_len_2190.c.

1114 {
1115 u32 i;
1117 InstrumentGroup* group = au_get_BK_instruments(bankGroup, bankIndex);
1118 Instrument** ptr = *group;
1119 if (group != NULL) {
1120 for (i = 0; i < ARRAY_COUNT(*group); i++) {
1121 *ptr++ = instrument;
1122 }
1123 }
1124}

◆ func_80054CE0()

void func_80054CE0 ( s32 arg0,
u32 idx )

Definition at line 1126 of file 2e230_len_2190.c.

1126 {
1127 if (idx < ARRAY_COUNT(D_80078530)) {
1128 s32 temp_s0 = D_80078530[idx];
1129 if (arg0 & 1) {
1130 gBGMPlayerA->busVolume = temp_s0;
1132 gBGMPlayerB->busVolume = temp_s0;
1134 }
1135 if (arg0 & 0x10) {
1136 gSoundManager->busVolume = temp_s0;
1138 }
1139 }
1140}
u16 D_80078530[9]
Definition sfx_player.c:289
void func_80053AC8(Fade *fade)
s32 busVolume
Definition audio.h:1015

Referenced by func_800561A4(), and func_800561C4().

◆ func_80054D74()

s32 func_80054D74 ( s32 arg0,
s32 arg1 )

Definition at line 1142 of file 2e230_len_2190.c.

1142 {
1143 if (arg0 & 0x10) {
1145 }
1146 return 0;
1147}
s32 au_sfx_set_reverb_type(SoundManager *manager, s32 arg1)
Definition sfx_player.c:664

Referenced by func_800561E4().

◆ func_80054DA8()

void func_80054DA8 ( u32 bMonoSound)

Definition at line 1149 of file 2e230_len_2190.c.

1149 {
1150 if (bMonoSound % 2 == 1) {
1151 // mono sound
1152 if (gSoundGlobals->unk_130C == 0) {
1154 }
1155 } else {
1156 // stereo sound
1157 if (gSoundGlobals->unk_130C != 0) {
1160 }
1161 }
1162}

Referenced by audio_set_mono(), and audio_set_stereo().

◆ au_read_rom()

void au_read_rom ( s32 romAddr,
void * buffer,
u32 size )

Definition at line 1166 of file 2e230_len_2190.c.

1166 {
1167 s32 nchunks = size / 0x2000;
1168 s32 offset = 0;
1169
1170 if (nchunks != 0) {
1171 while (nchunks--) {
1172 nuPiReadRom(romAddr + offset, buffer + offset, 0x2000);
1173 offset += 0x2000;
1174 }
1175 }
1176
1177 size %= 0x2000;
1178 if (size != 0) {
1179 nuPiReadRom(romAddr + offset, buffer + offset, size);
1180 }
1181}

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(), func_80053E58(), and func_80054AA0().

◆ au_memset()

void au_memset ( void * dst,
s32 size,
u8 value )

Definition at line 1183 of file 2e230_len_2190.c.

1183 {
1184 s32 count;
1185 s32 intValue;
1186
1187 if (size == 0) {
1188 return;
1189 }
1190
1191 if (size < 1024) {
1192 while (size--) {
1193 *(u8*)dst++ = value;
1194 }
1195 } else {
1196 count = (u32)dst & 0x3;
1197 if (count != 0) {
1198 count = 4 - count;
1199 size -= count;
1200 while (count--) {
1201 *(u8*)dst++ = value;
1202 }
1203 }
1204
1205 count = size >> 2;
1206 intValue = (value << 8) + value;
1207 intValue = (intValue << 16) + intValue;
1208 while (count--) {
1209 *(u32*)dst = intValue;
1210 dst += 4;
1211 }
1212
1213 count = size & 3;
1214 if (count != 0) {
1215 while (count--) {
1216 *(u8*)dst++ = value;
1217 }
1218 }
1219 }
1220}

Referenced by au_amb_manager_init(), and au_amb_play_sequence().

◆ au_copy_bytes()

void au_copy_bytes ( s8 * src,
s8 * dest,
s32 size )

Definition at line 1222 of file 2e230_len_2190.c.

1222 {
1223 if (size > 0) {
1224 while (size-- != 0) {
1225 *dest++ = *src++;
1226 }
1227 }
1228}

◆ au_copy_words()

void au_copy_words ( void * src,
void * dst,
s32 size )

Definition at line 1230 of file 2e230_len_2190.c.

1230 {
1231 size /= 4;
1232
1233 if (size > 0) {
1234 if (!(((s32) src | (s32) dst) & 3)) {
1235 s32* srcIt = src;
1236 s32* dstIt = dst;
1237
1238 size--;
1239 do {
1240 *dstIt++ = *srcIt++;
1241 } while (size-- != 0);
1242 }
1243 }
1244}

Referenced by au_load_PER(), au_load_PRG(), func_8004DCB8(), and func_8004DFD4().

Variable Documentation

◆ BeginSoundUpdateCallback

AuCallback BeginSoundUpdateCallback

Definition at line 4 of file 2e230_len_2190.c.

Referenced by au_update_players_main().

◆ gBGMPlayerA

◆ gBGMPlayerB

◆ gBGMPlayerC

BGMPlayer* gBGMPlayerC

Definition at line 7 of file 2e230_len_2190.c.

Referenced by au_engine_init().

◆ gSoundManager

◆ gSoundGlobals

◆ gAuAmbienceManager

◆ D_80078530

u16 D_80078530[9]
extern

Definition at line 289 of file sfx_player.c.

289 {
290 0x0000, 0x0200, 0x0800, 0x1200, 0x2000, 0x3200, 0x4800, 0x6200, 0x8000
291};

Referenced by func_80054CE0().

◆ EnvelopePressDefault

u8 EnvelopePressDefault[]
extern

Definition at line 299 of file sfx_player.c.

299 {
300 ENV_TIME_280MS, 127,
301 ENV_CMD_END, 0
302};
@ ENV_CMD_END
Definition audio.h:130
@ ENV_TIME_280MS
Definition audio.h:195

Referenced by au_get_instrument().

◆ EnvelopeReleaseDefault

u8 EnvelopeReleaseDefault[]
extern

Definition at line 304 of file sfx_player.c.

304 {
306 ENV_CMD_END, 0
307};
@ ENV_TIME_550MS
Definition audio.h:186

◆ AlTuneScaling

f32 AlTuneScaling[]
extern

Definition at line 360 of file sfx_player.c.

360 {
361 // TUNE_SCALING_ARR_AMPLIFY_FINE
362 1.00000000f, 1.00057781f, 1.00115597f, 1.00173450f, 1.00231326f, 1.00289237f, 1.00347185f, 1.00405169f,
363 1.00463188f, 1.00521231f, 1.00579309f, 1.00637424f, 1.00695574f, 1.00753760f, 1.00811982f, 1.00870228f,
364 1.00928509f, 1.00986826f, 1.01045179f, 1.01103568f, 1.01161981f, 1.01220429f, 1.01278913f, 1.01337433f,
365 1.01395988f, 1.01454580f, 1.01513207f, 1.01571858f, 1.01630545f, 1.01689267f, 1.01748025f, 1.01806819f,
366 1.01865649f, 1.01924503f, 1.01983392f, 1.02042317f, 1.02101278f, 1.02160275f, 1.02219307f, 1.02278376f,
367 1.02337468f, 1.02396595f, 1.02455759f, 1.02514958f, 1.02574193f, 1.02633464f, 1.02692771f, 1.02752113f,
368 1.02811480f, 1.02870882f, 1.02930319f, 1.02989793f, 1.03049302f, 1.03108847f, 1.03168428f, 1.03228045f,
369 1.03287685f, 1.03347361f, 1.03407073f, 1.03466821f, 1.03526604f, 1.03586423f, 1.03646278f, 1.03706169f,
370 1.03766096f, 1.03826058f, 1.03886044f, 1.03946066f, 1.04006124f, 1.04066217f, 1.04126346f, 1.04186511f,
371 1.04246712f, 1.04306948f, 1.04367220f, 1.04427528f, 1.04487872f, 1.04548252f, 1.04608655f, 1.04669094f,
372 1.04729569f, 1.04790080f, 1.04850626f, 1.04911208f, 1.04971826f, 1.05032480f, 1.05093169f, 1.05153894f,
373 1.05214655f, 1.05275452f, 1.05336285f, 1.05397153f, 1.05458057f, 1.05518997f, 1.05579972f, 1.05640972f,
374 1.05702007f, 1.05763078f, 1.05824184f, 1.05885327f, 1.05946505f, 1.06007719f, 1.06068969f, 1.06130254f,
375 1.06191576f, 1.06252933f, 1.06314325f, 1.06375754f, 1.06437218f, 1.06498718f, 1.06560254f, 1.06621826f,
376 1.06683433f, 1.06745076f, 1.06806755f, 1.06868470f, 1.06930220f, 1.06992006f, 1.07053828f, 1.07115686f,
377 1.07177579f, 1.07239509f, 1.07301474f, 1.07363474f, 1.07425511f, 1.07487583f, 1.07549691f, 1.07611835f,
378 // TUNE_SCALING_ARR_AMPLIFY_COARSE
379 1.00000000f, 1.07674015f, 1.15936935f, 1.24833953f, 1.34413731f, 1.44728661f, 1.55835164f, 1.67793977f,
380 1.80670512f, 1.94535196f, 2.09463859f, 2.25538135f, 2.42845964f, 2.61482000f, 2.81548166f, 3.03154206f,
381 3.26418304f, 3.51467681f, 3.78439355f, 4.07480860f, 4.38750982f, 4.72420788f, 5.08674431f, 5.47710180f,
382 5.89741516f, 6.34998369f, 6.83728218f, 7.36197615f, 7.92693520f, 8.53524971f, 9.19024563f, 9.89550686f,
383 // TUNE_SCALING_ARR_ATTENUATE_FINE
384 1.00000000f, 0.99942255f, 0.99884546f, 0.99826866f, 0.99769223f, 0.99711609f, 0.99654031f, 0.99596488f,
385 0.99538976f, 0.99481499f, 0.99424052f, 0.99366641f, 0.99309260f, 0.99251914f, 0.99194598f, 0.99137318f,
386 0.99080074f, 0.99022859f, 0.98965681f, 0.98908532f, 0.98851418f, 0.98794335f, 0.98737288f, 0.98680270f,
387 0.98623288f, 0.98566335f, 0.98509419f, 0.98452532f, 0.98395681f, 0.98338860f, 0.98282075f, 0.98225319f,
388 0.98168600f, 0.98111910f, 0.98055255f, 0.97998631f, 0.97942042f, 0.97885484f, 0.97828960f, 0.97772467f,
389 0.97716010f, 0.97659582f, 0.97603190f, 0.97546828f, 0.97490501f, 0.97434205f, 0.97377944f, 0.97321713f,
390 0.97265512f, 0.97209346f, 0.97153211f, 0.97097111f, 0.97041041f, 0.96985006f, 0.96929002f, 0.96873033f,
391 0.96817094f, 0.96761185f, 0.96705312f, 0.96649468f, 0.96593660f, 0.96537882f, 0.96482134f, 0.96426421f,
392 0.96370739f, 0.96315092f, 0.96259475f, 0.96203887f, 0.96148336f, 0.96092814f, 0.96037328f, 0.95981872f,
393 0.95926446f, 0.95871055f, 0.95815694f, 0.95760363f, 0.95705068f, 0.95649803f, 0.95594567f, 0.95539367f,
394 0.95484197f, 0.95429057f, 0.95373952f, 0.95318878f, 0.95263839f, 0.95208830f, 0.95153850f, 0.95098901f,
395 0.95043987f, 0.94989103f, 0.94934249f, 0.94879431f, 0.94824642f, 0.94769883f, 0.94715160f, 0.94660467f,
396 0.94605803f, 0.94551176f, 0.94496578f, 0.94442010f, 0.94387472f, 0.94332969f, 0.94278497f, 0.94224054f,
397 0.94169647f, 0.94115269f, 0.94060922f, 0.94006604f, 0.93952322f, 0.93898070f, 0.93843848f, 0.93789655f,
398 0.93735498f, 0.93681371f, 0.93627274f, 0.93573207f, 0.93519175f, 0.93465173f, 0.93411201f, 0.93357259f,
399 0.93303353f, 0.93249476f, 0.93195629f, 0.93141812f, 0.93088025f, 0.93034273f, 0.92980552f, 0.92926860f,
400 // TUNE_SCALING_ARR_ATTENUATE_COARSE
401 1.00000000f, 0.92873198f, 0.86254311f, 0.80107135f, 0.74398059f, 0.69095856f, 0.64171529f, 0.59598154f,
402 0.55350709f, 0.51405972f, 0.47742370f, 0.44339865f, 0.41179851f, 0.38245043f, 0.35519394f, 0.32987997f,
403 0.30637008f, 0.28453568f, 0.26425737f, 0.24542427f, 0.22793336f, 0.21168900f, 0.19660234f, 0.18259089f,
404 0.16957800f, 0.15749252f, 0.14626834f, 0.13584408f, 0.12616274f, 0.11717137f, 0.10882080f, 0.10106535f,
405 0.09386262f, 0.08717322f, 0.08096056f, 0.07519066f, 0.06983197f, 0.06485518f, 0.06023308f, 0.05594039f,
406 0.05195362f, 0.04825099f, 0.04481224f, 0.04161856f, 0.03865249f, 0.03589780f, 0.03333944f, 0.03096340f,
407 0.02875670f, 0.02670727f, 0.02480390f, 0.02303617f, 0.02139443f, 0.01986969f, 0.01845361f, 0.01713846f,
408 0.01591704f, 0.01478266f, 0.01372913f, 0.01275068f, 0.01184197f, 0.01099801f, 0.01021421f, 0.00948626f,
409 0.00881019f, 0.00818231f, 0.00759917f, 0.00705759f, 0.00655461f, 0.00608748f, 0.00565364f, 0.00525071f,
410 0.00487650f, 0.00452897f, 0.00420620f, 0.00390643f, 0.00362802f, 0.00336946f, 0.00312933f, 0.00290631f,
411 0.00269918f, 0.00250681f, 0.00232816f, 0.00216224f, 0.00200814f, 0.00186502f, 0.00173211f, 0.00160866f,
412 0.00149402f, 0.00138754f, 0.00128865f, 0.00119681f, 0.00111152f, 0.00103230f, 0.00095873f, 0.00089041f,
413 0.00082695f, 0.00076801f, 0.00071328f, 0.00066244f, 0.00061523f, 0.00057139f, 0.00053067f, 0.00049285f,
414 0.00045772f, 0.00042510f, 0.00039480f, 0.00036667f, 0.00034054f, 0.00031627f, 0.00029373f, 0.00027279f,
415 0.00025335f, 0.00023530f, 0.00021853f, 0.00020295f, 0.00018849f, 0.00017506f, 0.00016258f, 0.00015099f,
416 0.00014023f, 0.00013024f, 0.00012096f, 0.00011234f, 0.00010433f, 0.00009689f, 0.00008999f, 0.00008358f
417};

Referenced by au_compute_pitch_ratio().