Mario Kart 64
Loading...
Searching...
No Matches
internal.h
Go to the documentation of this file.
1#ifndef AUDIO_INTERNAL_H
2#define AUDIO_INTERNAL_H
3
4#include <ultra64.h>
5
6#define SEQUENCE_PLAYERS 4
7#define SEQUENCE_CHANNELS 48
8#define SEQUENCE_LAYERS 64
9
10#define LAYERS_MAX 4
11#define CHANNELS_MAX 16
12
13#define NO_LAYER ((struct SequenceChannelLayer*) (-1))
14
15#define MUTE_BEHAVIOR_STOP_SCRIPT 0x80 // stop processing sequence/channel scripts
16#define MUTE_BEHAVIOR_STOP_NOTES 0x40 // prevent further notes from playing
17#define MUTE_BEHAVIOR_SOFTEN 0x20 // lower volume, by default to half
18
19#define SEQUENCE_PLAYER_STATE_0 0
20#define SEQUENCE_PLAYER_STATE_FADE_OUT 1
21#define SEQUENCE_PLAYER_STATE_2 2
22#define SEQUENCE_PLAYER_STATE_3 3
23#define SEQUENCE_PLAYER_STATE_4 4
24
25#define NOTE_PRIORITY_DISABLED 0
26#define NOTE_PRIORITY_STOPPING 1
27#define NOTE_PRIORITY_MIN 2
28#define NOTE_PRIORITY_DEFAULT 3
29
30#define TATUMS_PER_BEAT 48
31
32// abi.h contains more details about the ADPCM and S8 codecs, "skip" skips codec processing
33#define CODEC_ADPCM 0
34#define CODEC_S8 1
35#define CODEC_SKIP 2
36
37#define TEMPO_SCALE TATUMS_PER_BEAT
38
40#define US_FLOAT(x) x##f
41#define US_FLOAT2(x) x
42
43// Convert u8 or u16 to f32. On JP, this uses a u32->f32 conversion,
44// resulting in more bloated codegen, while on US it goes through s32.
45// Since u8 and u16 fit losslessly in both, behavior is the same.
46#define FLOAT_CAST(x) (f32)(s32)(x)
47
48// No-op printf macro which leaves string literals in rodata in IDO. IDO
49// doesn't support variadic macros, so instead we let the parameter list
50// expand to a no-op comma expression. Another possibility is that it might
51// have expanded to something with "if (0)". See also goddard/gd_main.h.
52// On US/JP, -sopt optimizes away these except for external.c.
53#ifdef __sgi
54#define stubbed_printf
55#else
56#define stubbed_printf(...)
57#endif
58
59#define eu_stubbed_printf_0(msg) stubbed_printf(msg)
60#define eu_stubbed_printf_1(msg, a) stubbed_printf(msg, a)
61#define eu_stubbed_printf_2(msg, a, b) stubbed_printf(msg, a, b)
62#define eu_stubbed_printf_3(msg, a, b, c) stubbed_printf(msg, a, b, c)
63
64struct NotePool;
65
67 // A node in a circularly linked list. Each node is either a head or an item:
68 // - Items can be either detached (prev = NULL), or attached to a list.
69 // 'value' points to something of interest.
70 // - List heads are always attached; if a list is empty, its head points
71 // to itself. 'count' contains the size of the list.
72 // If the list holds notes, 'pool' points back to the pool where it lives.
73 // Otherwise, that member is NULL.
76 union {
77 void* value; // either Note* or SequenceChannelLayer*
79 } u;
80 struct NotePool* pool;
81}; // size = 0x10
82
89
91 /*0x00, 0x00*/ struct SequenceChannel* seqChannel;
92 /*0x04, 0x04*/ u32 time;
93 /* , 0x08*/ s16* curve;
94 /* , 0x0C*/ f32 extent;
95 /* , 0x10*/ f32 rate;
96 /* , 0x14*/ u8 active;
97 /*0x12, 0x16*/ u16 rateChangeTimer;
98 /*0x14, 0x18*/ u16 extentChangeTimer;
99 /*0x16, 0x1A*/ u16 delay;
100}; // size = 0x18, 0x1C on EU
101
102// Pitch sliding by up to one octave in the positive direction. Negative
103// direction is "supported" by setting extent to be negative. The code
104// extrapolates exponentially in the wrong direction in that case, but that
105// doesn't prevent seqplayer from doing it, AFAICT.
107 u8 mode; // bit 0x80 denotes something; the rest are an index 0-5
111}; // size = 0x10
112
116}; // size = 0x4
117
118struct AdpcmLoop {
123 s16 state[16]; // only exists if count != 0. 8-byte aligned
124};
125
126struct AdpcmBook {
129 s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
130};
131
138 u32 sampleSize; // never read. either 0 or 1 mod 9, depending on padding
139};
140
143 f32 tuning; // frequency scale factor
144}; // size = 0x8
145
147 /*0x00*/ u8 loaded;
150 /*0x03*/ u8 releaseRate;
151 /*0x04*/ struct AdsrEnvelope* envelope;
155}; // size = 0x20
156
157struct Drum {
158 /*0x00*/ u8 releaseRate;
159 /*0x01*/ u8 pan;
160 /*0x02*/ u8 loaded;
163};
164
165struct AudioBank {
166 struct Drum** drums;
168}; // dynamic size
169
177
183}; // size = 0x1C
184
185// Also known as a Group, according to debug strings.
187 /*US/JP, EU, SH */
188 /*0x000, 0x000, 0x000*/ u8 enabled : 1;
189 /*0x000, 0x000*/ u8 finished : 1; // never read
190 /*0x000, 0x000*/ u8 muted : 1;
191 /*0x000, 0x000*/ u8 seqDmaInProgress : 1;
192 /*0x000, 0x000*/ u8 bankDmaInProgress : 1;
193 /* 0x000*/ u8 recalculateVolume : 1;
194 /*0x002, 0x001, 0x001*/ u8 state;
195 /*0x003, 0x002*/ u8 noteAllocPolicy;
196 /*0x004, 0x003*/ u8 muteBehavior;
197 /*0x005, 0x004*/ u8 seqId;
198 /*0x006, 0x005*/ u8 defaultBank[1]; // must be an array to get a comparison
199 // to match; other u8's might also be part of that array
200 /*0x007, 0x006*/ u8 loadingBankId;
201 /* , 0x007, 0x007*/ s8 seqVariationEu[1];
202 /*0x00A, 0x008*/ u16 tempo; // beats per minute in JP, tatums per minute in US/EU
203 /*0x00C, 0x00A*/ u16 tempoAcc;
204 /*0x010, 0x00C, 0x00E*/ s16 transposition;
205 /*0x012, 0x00E, 0x010*/ u16 delay;
206 /*0x00E, 0x010, 0x012*/ u16 fadeRemainingFrames;
207 /* , 0x012, 0x014*/ u16 fadeTimerUnkEu;
208 /*0x014, 0x014*/ u8* seqData; // buffer of some sort
209 /*0x018, 0x018, 0x1C*/ f32 fadeVolume; // set to 1.0f
210 /*0x01C, 0x01C*/ f32 fadeVelocity; // set to 0.0f
211 /*0x020, 0x020, 0x024*/ f32 volume; // set to 0.0f
212 /*0x024, 0x024*/ f32 muteVolumeScale; // set to 0.5f
213 /* , 0x028, 0x02C*/ f32 fadeVolumeScale;
214 /* , 0x02C*/ f32 appliedFadeVolume;
215 /*0x02C, 0x030, 0x034*/ struct SequenceChannel* channels[CHANNELS_MAX];
216 /*0x06C, 0x070*/ struct M64ScriptState scriptState;
217 /*0x088, 0x08C*/ u8* shortNoteVelocityTable;
218 /*0x08C, 0x090*/ u8* shortNoteDurationTable;
219 /*0x090, 0x094*/ struct NotePool notePool;
220 /*0x0D0, 0x0D4*/ OSMesgQueue seqDmaMesgQueue;
221 /*0x0E8, 0x0EC*/ OSMesg seqDmaMesg;
222 /*0x0EC, 0x0F0*/ OSIoMesg seqDmaIoMesg;
223 /*0x100, 0x108*/ OSMesgQueue bankDmaMesgQueue;
224 /*0x118, 0x120*/ OSMesg bankDmaMesg;
225 /*0x11C, 0x124*/ OSIoMesg bankDmaIoMesg;
226 /*0x130, 0x13C*/ u8* bankDmaCurrMemAddr;
227 /*0x138, 0x140*/ uintptr_t bankDmaCurrDevAddr;
228 /*0x13C, 0x144*/ ssize_t bankDmaRemaining;
229}; // size = 0x140, 0x148 on EU, 0x14C on SH
230
235}; // size = 0x8
236
237struct AdsrState {
238 /*0x00, 0x00*/ u8 action;
239 /*0x01, 0x01*/ u8 state;
240 /*0x08, 0x02*/ s16 envIndex;
241 /*0x0A, 0x04*/ s16 delay;
242 /* , 0x08*/ f32 sustain;
243 /* , 0x0C*/ f32 velocity;
244 /* , 0x10*/ f32 fadeOutVel;
245 /* , 0x14*/ f32 current;
246 /* , 0x18*/ f32 target;
248 /*0x1C, 0x20*/ struct AdsrEnvelope* envelope;
249}; // size = 0x20, 0x24 in EU
250
252 /* 0x00 */ u8 bit0 : 1;
253 /* 0x00 */ u8 bit1 : 1;
254 /* 0x00 */ u8 bit2 : 1;
255 /* 0x00 */ u8 usesHeadsetPanEffects : 1;
256 /* 0x00 */ u8 stereoHeadsetEffects : 2;
257 /* 0x00 */ u8 strongRight : 1;
258 /* 0x00 */ u8 strongLeft : 1;
259};
260
262 /* 0x00 */ struct ReverbBitsData s;
263 /* 0x00 */ u8 asByte;
264};
267 u8 synthesisVolume; // UQ4.4, although 0 <= x < 1 is rounded up to 1
274};
275
282
283// Also known as a SubTrack, according to debug strings.
284// Confusingly, a SubTrack is a container of Tracks.
286 /* U/J, EU, SH */
287 /*0x00, 0x00*/ u8 enabled : 1;
288 /*0x00, 0x00*/ u8 finished : 1;
289 /*0x00, 0x00*/ u8 stopScript : 1;
290 /*0x00, 0x00*/ u8 stopSomething2 : 1; // sets SequenceChannelLayer.stopSomething
291 /*0x00, 0x00*/ u8 hasInstrument : 1;
292 /*0x00, 0x00*/ u8 stereoHeadsetEffects : 1;
293 /*0x00, ????*/ u8 largeNotes : 1; // notes specify duration and velocity
294 /*0x00, ????*/ u8 unused : 1; // never read, set to 0
295 /* , 0x01*/ union {
296 struct {
299 u8 pan : 1;
303 /*0x01, 0x02*/ u8 noteAllocPolicy;
304 /*0x02, 0x03, 0x03*/ u8 muteBehavior;
305 /*0x03, 0x04, 0x04*/ u8 reverbVol; // until EU: Q1.7, after EU: UQ0.8
306 /*0x04, ????*/ u8 notePriority; // 0-3
307 /*0x05, 0x06*/ u8 bankId;
308 /* , 0x07*/ u8 reverbIndex;
309 /* , 0x08, 0x09*/ u8 bookOffset;
310 /* , 0x09*/ u8 newPan;
311 /* , 0x0A*/ u8 panChannelWeight; // proportion of pan that comes from the channel (0..128)
312 /*0x08, 0x0C, 0x0E*/ u16 vibratoRateStart; // initially 0x800
313 /*0x0A, 0x0E, 0x10*/ u16 vibratoExtentStart;
314 /*0x0C, 0x10, 0x12*/ u16 vibratoRateTarget; // initially 0x800
315 /*0x0E, 0x12, 0x14*/ u16 vibratoExtentTarget;
316 /*0x10, 0x14, 0x16*/ u16 vibratoRateChangeDelay;
317 /*0x12, 0x16, 0x18*/ u16 vibratoExtentChangeDelay;
318 /*0x14, 0x18, 0x1A*/ u16 vibratoDelay;
319 /*0x16, 0x1A, 0x1C*/ u16 delay;
320 /*0x18, 0x1C, 0x1E*/ s16 instOrWave; // either 0 (none), instrument index + 1, or
321 // 0x80..0x83 for sawtooth/triangle/sine/square waves.
322 /*0x1A, 0x1E, 0x20*/ s16 transposition;
323 /*0x1C, 0x20, 0x24*/ f32 volumeScale;
324 /*0x20, 0x24, 0x28*/ f32 volume;
325 /* , 0x28*/ s32 pan;
326 /* , 0x2C*/ f32 appliedVolume;
327 /*0x2C, 0x30*/ f32 freqScale;
328 /*0x30, 0x34*/ u8 (*dynTable)[][2];
329 /*0x34, ????*/ struct Note* noteUnused; // never read
330 /*0x38, ????*/ struct SequenceChannelLayer* layerUnused; // never read
331 /*0x3C, 0x40*/ struct Instrument* instrument;
332 /*0x40, 0x44*/ struct SequencePlayer* seqPlayer;
333 /*0x44, 0x48*/ struct SequenceChannelLayer* layers[LAYERS_MAX];
334 /*0x54, 0x58 */ s8 soundScriptIO[8]; // bridge between sound script and audio lib. For player 2,
335 // [0] contains enabled, [4] contains sound ID, [5] contains reverb adjustment
336 /*0x5C, 0x60*/ struct M64ScriptState scriptState;
337 /*0x78, 0x7C*/ struct AdsrSettings adsr;
338 /*0x80, 0x84*/ struct NotePool notePool;
339}; // size = 0xC0, 0xC4 in EU, 0xD0 in SH
340
341// Also known as a Track, according to debug strings.
343 /* U/J, EU, SH */
344 /*0x00, 0x00*/ u8 enabled : 1;
345 /*0x00, 0x00*/ u8 finished : 1;
346 /*0x00, 0x00*/ u8 stopSomething : 1; // ?
347 /*0x00, 0x00*/ u8 continuousNotes : 1; // keep the same note for consecutive notes with the same sound
348 /* , 0x00*/ u8 unusedEu0b8 : 1;
349 /* , 0x00*/ u8 notePropertiesNeedInit : 1;
350 /* , 0x00*/ u8 ignoreDrumPan : 1;
351 /* , 0x01, 0x02*/ u8 instOrWave;
352 /*0x01, 0x02, 0x03*/ u8 status; // 0x03 in SH
353 /*0x02, 0x03*/ u8 noteDuration; // set to 0x80
354 /*0x03, 0x04*/ u8 portamentoTargetNote;
355 /* , 0x05*/ u8 pan; // 0..128
356 /* , 0x06, 0x07*/ u8 notePan;
357 /*0x04, 0x08*/ struct Portamento portamento;
358 /*0x14, 0x18*/ struct AdsrSettings adsr;
359 /*0x1C, 0x20*/ u16 portamentoTime;
360 /*0x1E, 0x22*/ s16 transposition; // #semitones added to play commands
361 // (m64 instruction encoding only allows referring to the limited range
362 // 0..0x3f; this makes 0x40..0x7f accessible as well)
363 /*0x20, 0x24, 0x24*/ f32 freqScale;
364 /*0x24, 0x28, 0x2C*/ f32 velocitySquare;
365 /*0x2C, 0x2C, 0x30*/ f32 noteVelocity;
366 /*0x34, 0x30, 0x34*/ f32 noteFreqScale;
368 /*0x3A, 0x36*/ s16 playPercentage; // it's not really a percentage...
369 /*0x3C, 0x38*/ s16 delay;
370 /*0x3E, 0x3A*/ s16 duration;
371 /*0x40, 0x3C*/ s16 delayUnused; // set to 'delay', never read
372 /*0x44, 0x40, 0x44*/ struct Note* note;
373 /*0x48, 0x44*/ struct Instrument* instrument;
374 /*0x4C, 0x48*/ struct AudioBankSound* sound;
375 /*0x50, 0x4C, 0x50*/ struct SequenceChannel* seqChannel;
376 /*0x54, 0x50*/ struct M64ScriptState scriptState;
377 /*0x70, 0x6C*/ struct AudioListItem listItem;
379}; // size = 0x80
380
382 /*0x00*/ u8 restart;
386 /*0x04, 0x06*/ u16 samplePosFrac;
389 /*0x10*/ s16 curVolLeft; // UQ0.16 (EU Q1.15)
390 /*0x12*/ s16 curVolRight; // UQ0.16 (EU Q1.15)
391};
393 /* U/J, EU, SH */
394 /*0x04, 0x00, 0x00*/ u8 priority;
395 /* 0x01, 0x01*/ u8 waveId;
396 /* 0x02, 0x02*/ u8 sampleCountIndex;
397 /*0x08, 0x04, 0x06*/ s16 adsrVolScale;
398 /*0x18, 0x08, 0x08*/ f32 portamentoFreqScale;
399 /*0x1C, 0x0C, 0x0C*/ f32 vibratoFreqScale;
400 /*0x28, 0x10, */ struct SequenceChannelLayer* prevParentLayer;
401 /*0x2C, 0x14, 0x14*/ struct SequenceChannelLayer* parentLayer;
402 /*0x30, 0x18, 0x18*/ struct SequenceChannelLayer* wantedParentLayer;
403 /* , 0x1C, 0x1C*/ struct NoteAttributes attributes;
404 /*0x54, 0x28, 0x2C*/ struct AdsrState adsr;
405 /*0x74, 0x4C, */ struct Portamento portamento;
406 /*0x84, 0x5C, */ struct VibratoState vibratoState;
407};
408struct NoteSubEu {
409 /*0x00*/ volatile u8 enabled : 1;
410 /*0x00*/ u8 needsInit : 1;
411 /*0x00*/ u8 finished : 1;
412 /*0x00*/ u8 envMixerNeedsInit : 1;
413 /*0x00*/ u8 stereoStrongRight : 1;
414 /*0x00*/ u8 stereoStrongLeft : 1;
417 /*0x01*/ u8 reverbIndex : 3;
418 /*0x01*/ u8 bookOffset : 3;
419 /*0x01*/ u8 isSyntheticWave : 1;
420 /*0x01*/ u8 hasTwoAdpcmParts : 1;
421 /*0x02*/ u8 bankId;
424 /*0x05*/ u8 reverbVol; // UQ0.7 (EU Q1.7)
425 /*0x06*/ u16 targetVolLeft; // UQ0.12 (EU UQ0.10)
426 /*0x08*/ u16 targetVolRight; // UQ0.12 (EU UQ0.10)
427 /*0x0A*/ u16 resamplingRateFixedPoint; // stored as signed but loaded as u16
428 /*0x0C*/ union {
432};
433struct Note {
434 /* U/J, EU, SH */
435 /*0xA4, 0x00, 0x00*/ struct AudioListItem listItem;
436 /* 0x10, 0x10*/ struct NoteSynthesisState synthesisState;
437 // The next members are actually part of a struct (NotePlaybackState), but
438 // that results in messy US/EU ifdefs. Instead we cast to a struct pointer
439 // when needed... This breaks alignment on non-N64 platforms, which we hack
440 // around by skipping the padding in that case.
442#ifdef TARGET_N64
443 u8 pad0[12];
444#endif
445
446 /*0x04, 0x30, 0x30*/ u8 priority;
447 /* 0x31, 0x31*/ u8 waveId;
448 /* 0x32, 0x32*/ u8 sampleCountIndex;
449 /*0x08, 0x34, 0x36*/ s16 adsrVolScale;
450 /*0x18, 0x38, */ f32 portamentoFreqScale;
451 /*0x1C, 0x3C, */ f32 vibratoFreqScale;
452 /*0x28, 0x40, */ struct SequenceChannelLayer* prevParentLayer;
453 /*0x2C, 0x44, 0x44*/ struct SequenceChannelLayer* parentLayer;
454 /*0x30, 0x48, 0x48*/ struct SequenceChannelLayer* wantedParentLayer;
455 /* , 0x4C, 0x4C*/ struct NoteAttributes attributes;
456 /*0x54, 0x58, 0x5C*/ struct AdsrState adsr;
457 /*0x74, 0x7C*/ struct Portamento portamento;
458 /*0x84, 0x8C*/ struct VibratoState vibratoState;
460 /* , 0xB0, 0xB4*/ struct NoteSubEu noteSubEu;
461}; // size = 0xC0, known to be 0xC8 on SH
462
463// While this struct needs to be size 0xA0, its not clear
464// what innards are necessary. All the possible options from
465// SM64 are sized incorrectly so we're probably looking at some
466// MK64 weirdness
473
474/*
475SM64 NoteSynthesisBuffers, kept here because I'm not sure our current
476version is correct
477struct NoteSynthesisBuffers {
478 s16 adpcmdecState[0x10];
479 s16 finalResampleState[0x10];
480#ifdef VERSION_SH
481 s16 unk[0x10];
482 s16 filterBuffer[0x20];
483 s16 panSamplesBuffer[0x20];
484#else
485 s16 mixEnvelopeState[0x28];
486 s16 panResampleState[0x10];
487 s16 panSamplesBuffer[0x20];
488 s16 dummyResampleState[0x10];
489#if defined(VERSION_JP) || defined(VERSION_US)
490 s16 samples[0x40];
491#endif
492#endif
493};
494*/
495
498 u8 windowSize; // To be multiplied by 64
500};
501
503 /* 0x00 */ u32 frequency;
504 /* 0x04 */ u8 unk1; // always 1
506 /* 0x06 */ u8 numReverbs; // always 1
507 /* 0x07 */ u8 unk2; // always 0
509 /* 0x0C */ u16 volume;
510 /* 0x0E */ u16 unk3; // always 0
513 /* 0x18 */ u32 unk_18;
516 /* 0x24 */ u32 unk_24;
517}; // 0x30 on shindou
518
520 /*0x00*/ u32 frequency;
522 /*0x05*/ u8 reverbDownsampleRate; // always 1
524 /*0x08*/ u16 reverbGain;
525 /*0x0A*/ u16 volume;
530}; // size = 0x1C
531
533 /*0x00*/ s16 presetUnk4; // audio frames per vsync?
534 /*0x02*/ u16 frequency;
535 /*0x04*/ u16 aiFrequency; // ?16
543 /*0x14*/ f32 resampleRate; // contains 32000.0f / frequency
544 /*0x18*/ f32 updatesPerFrameInv; // 1.0f / updatesPerFrame
545 /*0x1C*/ f32 unkUpdatesPerFrameScaled; // 3.0f / (1280.0f * updatesPerFrame)
546};
547
617
618#endif // AUDIO_INTERNAL_H
#define LAYERS_MAX
Definition internal.h:10
#define CHANNELS_MAX
Definition internal.h:11
Definition internal.h:126
s16 book[1]
Definition internal.h:129
s32 npredictors
Definition internal.h:128
s32 order
Definition internal.h:127
Definition internal.h:118
u32 pad
Definition internal.h:122
u32 start
Definition internal.h:119
s16 state[16]
Definition internal.h:123
u32 count
Definition internal.h:121
u32 end
Definition internal.h:120
Definition internal.h:113
s16 delay
Definition internal.h:114
s16 arg
Definition internal.h:115
Definition internal.h:231
u8 sustain
Definition internal.h:233
struct AdsrEnvelope * envelope
Definition internal.h:234
u8 releaseRate
Definition internal.h:232
Definition internal.h:237
s32 pad1C
Definition internal.h:247
f32 target
Definition internal.h:246
f32 current
Definition internal.h:245
s16 delay
Definition internal.h:241
u8 state
Definition internal.h:239
s16 envIndex
Definition internal.h:240
f32 velocity
Definition internal.h:243
u8 action
Definition internal.h:238
struct AdsrEnvelope * envelope
Definition internal.h:248
f32 fadeOutVel
Definition internal.h:244
f32 sustain
Definition internal.h:242
Definition internal.h:132
u32 sampleSize
Definition internal.h:138
u8 loaded
Definition internal.h:134
u8 * sampleAddr
Definition internal.h:135
struct AdpcmLoop * loop
Definition internal.h:136
u8 unused
Definition internal.h:133
struct AdpcmBook * book
Definition internal.h:137
Definition internal.h:141
f32 tuning
Definition internal.h:143
struct AudioBankSample * sample
Definition internal.h:142
Definition internal.h:165
struct Instrument * instruments[1]
Definition internal.h:167
struct Drum ** drums
Definition internal.h:166
Definition internal.h:532
s16 updatesPerFrame
Definition internal.h:539
s16 samplesPerUpdateMax
Definition internal.h:541
s16 samplesPerFrameTarget
Definition internal.h:536
f32 resampleRate
Definition internal.h:543
s16 minAiBufferLength
Definition internal.h:538
u16 aiFrequency
Definition internal.h:535
f32 updatesPerFrameInv
Definition internal.h:544
f32 unkUpdatesPerFrameScaled
Definition internal.h:545
s16 maxAiBufferLength
Definition internal.h:537
s16 presetUnk4
Definition internal.h:533
u16 frequency
Definition internal.h:534
s16 samplesPerUpdateMin
Definition internal.h:542
s16 samplesPerUpdate
Definition internal.h:540
Definition internal.h:66
union AudioListItem::@0 u
struct NotePool * pool
Definition internal.h:80
s32 count
Definition internal.h:78
void * value
Definition internal.h:77
struct AudioListItem * prev
Definition internal.h:74
struct AudioListItem * next
Definition internal.h:75
Definition internal.h:502
u32 temporarySeqMem
Definition internal.h:514
u32 persistentBankMem
Definition internal.h:512
struct ReverbSettingsEU * reverbSettings
Definition internal.h:508
u8 maxSimultaneousNotes
Definition internal.h:505
u32 unk_24
Definition internal.h:516
u8 unk1
Definition internal.h:504
u32 frequency
Definition internal.h:503
u32 temporaryBankMem
Definition internal.h:515
u32 persistentSeqMem
Definition internal.h:511
u8 unk2
Definition internal.h:507
u32 unk_18
Definition internal.h:513
u8 numReverbs
Definition internal.h:506
u16 unk3
Definition internal.h:510
u16 volume
Definition internal.h:509
Definition internal.h:519
u16 volume
Definition internal.h:525
u32 temporarySeqMem
Definition internal.h:528
u16 reverbWindowSize
Definition internal.h:523
u8 maxSimultaneousNotes
Definition internal.h:521
u32 persistentBankMem
Definition internal.h:527
u32 temporaryBankMem
Definition internal.h:529
u16 reverbGain
Definition internal.h:524
u8 reverbDownsampleRate
Definition internal.h:522
u32 persistentSeqMem
Definition internal.h:526
u32 frequency
Definition internal.h:520
Definition internal.h:170
struct Instrument ** instruments
Definition internal.h:174
struct Drum ** drums
Definition internal.h:175
u8 numDrums
Definition internal.h:173
u8 unused
Definition internal.h:171
u8 numInstruments
Definition internal.h:172
Definition internal.h:157
u8 pan
Definition internal.h:159
u8 loaded
Definition internal.h:160
struct AdsrEnvelope * envelope
Definition internal.h:162
struct AudioBankSound sound
Definition internal.h:161
u8 releaseRate
Definition internal.h:158
Definition internal.h:599
f32 as_f32
Definition internal.h:612
struct EuAudioCmd::@4::@6 s
s32 as_s32
Definition internal.h:610
u8 op
Definition internal.h:602
u8 bankId
Definition internal.h:603
u8 as_u8
Definition internal.h:613
u32 first
Definition internal.h:607
union EuAudioCmd::@5 u2
s8 as_s8
Definition internal.h:614
u8 arg2
Definition internal.h:604
u32 as_u32
Definition internal.h:611
u8 arg3
Definition internal.h:605
union EuAudioCmd::@4 u
Definition internal.h:146
u8 releaseRate
Definition internal.h:150
struct AdsrEnvelope * envelope
Definition internal.h:151
struct AudioBankSound lowNotesSound
Definition internal.h:152
u8 loaded
Definition internal.h:147
u8 normalRangeLo
Definition internal.h:148
struct AudioBankSound highNotesSound
Definition internal.h:154
u8 normalRangeHi
Definition internal.h:149
struct AudioBankSound normalNotesSound
Definition internal.h:153
Definition internal.h:178
u8 depth
Definition internal.h:182
u8 remLoopIters[4]
Definition internal.h:181
u8 * stack[4]
Definition internal.h:180
u8 * pc
Definition internal.h:179
Definition internal.h:276
f32 velocity
Definition internal.h:280
u8 pan
Definition internal.h:278
f32 freqScale
Definition internal.h:279
u8 reverbVol
Definition internal.h:277
Definition internal.h:392
f32 vibratoFreqScale
Definition internal.h:399
struct SequenceChannelLayer * parentLayer
Definition internal.h:401
u8 waveId
Definition internal.h:395
struct SequenceChannelLayer * prevParentLayer
Definition internal.h:400
struct Portamento portamento
Definition internal.h:405
struct SequenceChannelLayer * wantedParentLayer
Definition internal.h:402
s16 adsrVolScale
Definition internal.h:397
f32 portamentoFreqScale
Definition internal.h:398
u8 priority
Definition internal.h:394
u8 sampleCountIndex
Definition internal.h:396
struct VibratoState vibratoState
Definition internal.h:406
struct AdsrState adsr
Definition internal.h:404
struct NoteAttributes attributes
Definition internal.h:403
Definition internal.h:83
struct AudioListItem releasing
Definition internal.h:86
struct AudioListItem disabled
Definition internal.h:84
struct AudioListItem active
Definition internal.h:87
struct AudioListItem decaying
Definition internal.h:85
Definition internal.h:408
struct AudioBankSound * audioBankSound
Definition internal.h:430
u8 headsetPanRight
Definition internal.h:422
u8 bankId
Definition internal.h:421
u8 usesHeadsetPanEffects
Definition internal.h:416
u8 reverbVol
Definition internal.h:424
u16 targetVolLeft
Definition internal.h:425
u8 stereoStrongRight
Definition internal.h:413
u8 hasTwoAdpcmParts
Definition internal.h:420
s16 * samples
Definition internal.h:429
u8 reverbIndex
Definition internal.h:417
u8 headsetPanLeft
Definition internal.h:423
u8 bookOffset
Definition internal.h:418
u8 isSyntheticWave
Definition internal.h:419
u16 resamplingRateFixedPoint
Definition internal.h:427
union NoteSubEu::@3 sound
u16 targetVolRight
Definition internal.h:426
u8 envMixerNeedsInit
Definition internal.h:412
u8 finished
Definition internal.h:411
u8 stereoStrongLeft
Definition internal.h:414
volatile u8 enabled
Definition internal.h:409
u8 stereoHeadsetEffects
Definition internal.h:415
u8 needsInit
Definition internal.h:410
Definition internal.h:467
s16 panSamplesBuffer[0x20]
Definition internal.h:471
s16 finalResampleState[0x10]
Definition internal.h:469
s16 panResampleState[0x10]
Definition internal.h:470
s16 adpcmdecState[0x10]
Definition internal.h:468
Definition internal.h:381
s32 samplePosInt
Definition internal.h:387
struct NoteSynthesisBuffers * synthesisBuffers
Definition internal.h:388
s16 curVolRight
Definition internal.h:390
u16 samplePosFrac
Definition internal.h:386
s16 curVolLeft
Definition internal.h:389
u8 prevHeadsetPanLeft
Definition internal.h:385
u8 prevHeadsetPanRight
Definition internal.h:384
u8 sampleDmaIndex
Definition internal.h:383
u8 restart
Definition internal.h:382
Definition internal.h:433
struct VibratoState vibratoState
Definition internal.h:458
struct SequenceChannelLayer * wantedParentLayer
Definition internal.h:454
u8 pad3[8]
Definition internal.h:459
f32 vibratoFreqScale
Definition internal.h:451
u8 waveId
Definition internal.h:447
struct NoteSynthesisState synthesisState
Definition internal.h:436
f32 portamentoFreqScale
Definition internal.h:450
struct AdsrState adsr
Definition internal.h:456
struct SequenceChannelLayer * parentLayer
Definition internal.h:453
struct Portamento portamento
Definition internal.h:457
struct NoteSubEu noteSubEu
Definition internal.h:460
struct AudioListItem listItem
Definition internal.h:435
u8 sampleCountIndex
Definition internal.h:448
u8 priority
Definition internal.h:446
struct SequenceChannelLayer * prevParentLayer
Definition internal.h:452
s16 adsrVolScale
Definition internal.h:449
struct NoteAttributes attributes
Definition internal.h:455
Definition os_pi.h:53
Definition internal.h:106
u8 mode
Definition internal.h:107
f32 cur
Definition internal.h:108
f32 speed
Definition internal.h:109
f32 extent
Definition internal.h:110
Definition internal.h:251
u8 bit1
Definition internal.h:253
u8 strongLeft
Definition internal.h:258
u8 stereoHeadsetEffects
Definition internal.h:256
u8 bit2
Definition internal.h:254
u8 strongRight
Definition internal.h:257
u8 bit0
Definition internal.h:252
u8 usesHeadsetPanEffects
Definition internal.h:255
Definition internal.h:265
u8 synthesisVolume
Definition internal.h:267
u8 pan
Definition internal.h:268
s32 unused
Definition internal.h:272
s16 * filter
Definition internal.h:273
union ReverbBits reverbBits
Definition internal.h:269
u8 reverbVol
Definition internal.h:266
f32 freqScale
Definition internal.h:270
f32 velocity
Definition internal.h:271
Definition internal.h:496
u8 downsampleRate
Definition internal.h:497
u8 windowSize
Definition internal.h:498
u16 gain
Definition internal.h:499
Definition internal.h:342
u8 noteDuration
Definition internal.h:353
struct SequenceChannel * seqChannel
Definition internal.h:375
u8 continuousNotes
Definition internal.h:347
s16 duration
Definition internal.h:370
u16 portamentoTime
Definition internal.h:359
s16 transposition
Definition internal.h:360
s16 shortNoteDefaultPlayPercentage
Definition internal.h:367
f32 freqScale
Definition internal.h:363
u8 notePropertiesNeedInit
Definition internal.h:349
u8 pad2[4]
Definition internal.h:378
struct AudioListItem listItem
Definition internal.h:377
struct Note * note
Definition internal.h:372
u8 notePan
Definition internal.h:356
u8 finished
Definition internal.h:345
s16 delay
Definition internal.h:369
struct AdsrSettings adsr
Definition internal.h:358
u8 instOrWave
Definition internal.h:351
u8 pan
Definition internal.h:355
u8 status
Definition internal.h:352
u8 enabled
Definition internal.h:344
s16 delayUnused
Definition internal.h:371
s16 playPercentage
Definition internal.h:368
f32 noteVelocity
Definition internal.h:365
f32 velocitySquare
Definition internal.h:364
struct Portamento portamento
Definition internal.h:357
u8 ignoreDrumPan
Definition internal.h:350
struct Instrument * instrument
Definition internal.h:373
u8 unusedEu0b8
Definition internal.h:348
struct M64ScriptState scriptState
Definition internal.h:376
f32 noteFreqScale
Definition internal.h:366
struct AudioBankSound * sound
Definition internal.h:374
u8 portamentoTargetNote
Definition internal.h:354
u8 stopSomething
Definition internal.h:346
Definition internal.h:285
u16 vibratoRateStart
Definition internal.h:312
s32 pan
Definition internal.h:325
struct NotePool notePool
Definition internal.h:338
struct Instrument * instrument
Definition internal.h:331
f32 volume
Definition internal.h:324
union SequenceChannel::@1 changes
u8 hasInstrument
Definition internal.h:291
u8 notePriority
Definition internal.h:306
u16 vibratoExtentTarget
Definition internal.h:315
u8(* dynTable)[][2]
Definition internal.h:328
u8 largeNotes
Definition internal.h:293
u8 freqScale
Definition internal.h:297
struct AdsrSettings adsr
Definition internal.h:337
s16 instOrWave
Definition internal.h:320
u8 bankId
Definition internal.h:307
u16 vibratoDelay
Definition internal.h:318
u8 stopSomething2
Definition internal.h:290
u8 reverbVol
Definition internal.h:305
u8 newPan
Definition internal.h:310
u16 vibratoExtentChangeDelay
Definition internal.h:317
u8 stereoHeadsetEffects
Definition internal.h:292
struct M64ScriptState scriptState
Definition internal.h:336
u8 volume
Definition internal.h:298
struct SequenceChannelLayer * layers[LAYERS_MAX]
Definition internal.h:333
u8 as_u8
Definition internal.h:301
f32 freqScale
Definition internal.h:327
u8 pan
Definition internal.h:299
u16 vibratoExtentStart
Definition internal.h:313
u8 muteBehavior
Definition internal.h:304
struct SequenceChannel::@1::@2 as_bitfields
u8 enabled
Definition internal.h:287
struct Note * noteUnused
Definition internal.h:329
s8 soundScriptIO[8]
Definition internal.h:334
u16 vibratoRateTarget
Definition internal.h:314
struct SequenceChannelLayer * layerUnused
Definition internal.h:330
u8 bookOffset
Definition internal.h:309
u8 reverbIndex
Definition internal.h:308
u16 delay
Definition internal.h:319
u8 stopScript
Definition internal.h:289
u8 panChannelWeight
Definition internal.h:311
u8 finished
Definition internal.h:288
struct SequencePlayer * seqPlayer
Definition internal.h:332
f32 appliedVolume
Definition internal.h:326
u16 vibratoRateChangeDelay
Definition internal.h:316
u8 noteAllocPolicy
Definition internal.h:303
u8 unused
Definition internal.h:294
s16 transposition
Definition internal.h:322
f32 volumeScale
Definition internal.h:323
Definition internal.h:186
f32 fadeVelocity
Definition internal.h:210
struct NotePool notePool
Definition internal.h:219
u8 noteAllocPolicy
Definition internal.h:195
OSIoMesg bankDmaIoMesg
Definition internal.h:225
u16 fadeTimerUnkEu
Definition internal.h:207
s8 seqVariationEu[1]
Definition internal.h:201
struct M64ScriptState scriptState
Definition internal.h:216
f32 appliedFadeVolume
Definition internal.h:214
u8 enabled
Definition internal.h:188
u8 muteBehavior
Definition internal.h:196
u8 bankDmaInProgress
Definition internal.h:192
u8 recalculateVolume
Definition internal.h:193
u8 seqDmaInProgress
Definition internal.h:191
OSIoMesg seqDmaIoMesg
Definition internal.h:222
struct SequenceChannel * channels[CHANNELS_MAX]
Definition internal.h:215
u16 tempo
Definition internal.h:202
u16 fadeRemainingFrames
Definition internal.h:206
u8 loadingBankId
Definition internal.h:200
u8 seqId
Definition internal.h:197
OSMesg bankDmaMesg
Definition internal.h:224
f32 muteVolumeScale
Definition internal.h:212
s16 transposition
Definition internal.h:204
f32 volume
Definition internal.h:211
u8 * shortNoteDurationTable
Definition internal.h:218
u16 delay
Definition internal.h:205
u8 * bankDmaCurrMemAddr
Definition internal.h:226
u8 * shortNoteVelocityTable
Definition internal.h:217
OSMesgQueue seqDmaMesgQueue
Definition internal.h:220
u8 * seqData
Definition internal.h:208
uintptr_t bankDmaCurrDevAddr
Definition internal.h:227
OSMesgQueue bankDmaMesgQueue
Definition internal.h:223
u8 muted
Definition internal.h:190
ssize_t bankDmaRemaining
Definition internal.h:228
u8 state
Definition internal.h:194
u8 defaultBank[1]
Definition internal.h:198
u8 finished
Definition internal.h:189
f32 fadeVolumeScale
Definition internal.h:213
u16 tempoAcc
Definition internal.h:203
OSMesg seqDmaMesg
Definition internal.h:221
f32 fadeVolume
Definition internal.h:209
Definition internal.h:90
struct SequenceChannel * seqChannel
Definition internal.h:91
u16 extentChangeTimer
Definition internal.h:98
f32 rate
Definition internal.h:95
u8 active
Definition internal.h:96
u32 time
Definition internal.h:92
s16 * curve
Definition internal.h:93
u16 delay
Definition internal.h:99
u16 rateChangeTimer
Definition internal.h:97
f32 extent
Definition internal.h:94
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16
signed char s8
Definition ultratypes.h:11
signed short int s16
Definition ultratypes.h:13
float f32
Definition ultratypes.h:34
unsigned short int u16
Definition ultratypes.h:14
ptrdiff_t ssize_t
Definition ultratypes.h:47
unsigned char u8
Definition ultratypes.h:12
Definition internal.h:261
u8 asByte
Definition internal.h:263
struct ReverbBitsData s
Definition internal.h:262