1#ifndef AUDIO_INTERNAL_H
2#define AUDIO_INTERNAL_H
6#define SEQUENCE_PLAYERS 4
7#define SEQUENCE_CHANNELS 48
8#define SEQUENCE_LAYERS 64
11#define CHANNELS_MAX 16
13#define NO_LAYER ((struct SequenceChannelLayer*) (-1))
15#define MUTE_BEHAVIOR_STOP_SCRIPT 0x80
16#define MUTE_BEHAVIOR_STOP_NOTES 0x40
17#define MUTE_BEHAVIOR_SOFTEN 0x20
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
25#define NOTE_PRIORITY_DISABLED 0
26#define NOTE_PRIORITY_STOPPING 1
27#define NOTE_PRIORITY_MIN 2
28#define NOTE_PRIORITY_DEFAULT 3
30#define TATUMS_PER_BEAT 48
37#define TEMPO_SCALE TATUMS_PER_BEAT
40#define US_FLOAT(x) x##f
46#define FLOAT_CAST(x) (f32)(s32)(x)
56#define stubbed_printf(...)
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)
#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
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
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
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
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 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
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