Mario Kart 64
synthesis.c File Reference
#include <ultra64.h>
#include <macros.h>
#include "audio/synthesis.h"
#include "audio/heap.h"
#include "audio/data.h"
#include "audio/load.h"
#include "audio/internal.h"
#include "PR/abi.h"
Include dependency graph for synthesis.c:

Data Structures

struct  VolumeChange
 

Macros

#define aSetLoadBufferPair(pkt, c, off)
 
#define aSetSaveBufferPair(pkt, c, d, off)
 

Functions

u64process_envelope (u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags)
 
void prepare_reverb_ring_buffer (s32 chunkLen, u32 updateIndex, s32 reverbIndex)
 
Acmd * synthesis_load_reverb_ring_buffer (Acmd *acmd, u16 addr, u16 srcOffset, s32 len, s32 reverbIndex)
 
Acmd * synthesis_save_reverb_ring_buffer (Acmd *acmd, u16 addr, u16 destOffset, s32 len, s32 reverbIndex)
 
void func_800B6FB4 (s32 updateIndexStart, s32 noteIndex)
 
void synthesis_load_note_subs_eu (s32 updateIndex)
 
Acmd * synthesis_execute (Acmd *acmd, s32 *writtenCmds, s16 *aiBuf, s32 bufLen)
 
Acmd * synthesis_resample_and_mix_reverb (Acmd *acmd, s32 bufLen, s16 reverbIndex, s16 updateIndex)
 
Acmd * synthesis_save_reverb_samples (Acmd *acmd, s16 reverbIndex, s16 updateIndex)
 
Acmd * synthesis_do_one_audio_update (s16 *aiBuf, s32 bufLen, Acmd *acmd, s32 updateIndex)
 
Acmd * load_wave_samples (Acmd *acmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad)
 
Acmd * final_resample (Acmd *acmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags)
 
Acmd * note_apply_headset_pan_effects (Acmd *acmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight)
 

Variables

struct SynthesisReverb gSynthesisReverbs [4]
 
u8 sAudioSynthesisPad [0x10]
 
char synthesisAudioString0 [] = "Terminate-Canceled Channel %d,Phase %d\n"
 
char synthesisAudioString1 [] = "Copy %d\n"
 
char synthesisAudioString2 [] = "%d->%d\n"
 
char synthesisAudioString3 [] = "pitch %x: delaybytes %d : olddelay %d\n"
 
char synthesisAudioString4 [] = "cont %x: delaybytes %d : olddelay %d\n"
 

Macro Definition Documentation

◆ aSetLoadBufferPair

#define aSetLoadBufferPair (   pkt,
  c,
  off 
)
Value:
aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_LEFT_CH, 0, DEFAULT_LEN_1CH - c); \
aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \
aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_RIGHT_CH, 0, DEFAULT_LEN_1CH - c); \
aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off)))
#define VIRTUAL_TO_PHYSICAL2(addr)
Definition: macros.h:62
#define DEFAULT_LEN_1CH
Definition: synthesis.h:7
#define DMEM_ADDR_WET_RIGHT_CH
Definition: synthesis.h:21
#define DMEM_ADDR_WET_LEFT_CH
Definition: synthesis.h:20

◆ aSetSaveBufferPair

#define aSetSaveBufferPair (   pkt,
  c,
  d,
  off 
)
Value:
aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_LEFT_CH, d); \
aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \
aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_RIGHT_CH, d); \
aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off)));

Function Documentation

◆ final_resample()

Acmd* final_resample ( Acmd *  acmd,
struct NoteSynthesisState synthesisState,
s32  count,
u16  pitch,
u16  dmemIn,
u32  flags 
)

◆ func_800B6FB4()

void func_800B6FB4 ( s32  updateIndexStart,
s32  noteIndex 
)

◆ load_wave_samples()

Acmd* load_wave_samples ( Acmd *  acmd,
struct NoteSubEu noteSubEu,
struct NoteSynthesisState synthesisState,
s32  nSamplesToLoad 
)

◆ note_apply_headset_pan_effects()

Acmd* note_apply_headset_pan_effects ( Acmd *  acmd,
struct NoteSubEu noteSubEu,
struct NoteSynthesisState note,
s32  bufLen,
s32  flags,
s32  leftRight 
)

◆ prepare_reverb_ring_buffer()

void prepare_reverb_ring_buffer ( s32  chunkLen,
u32  updateIndex,
s32  reverbIndex 
)
Here is the caller graph for this function:

◆ process_envelope()

u64* process_envelope ( u64 cmd,
struct NoteSubEu noteSubEu,
struct NoteSynthesisState synthesisState,
s32  nSamples,
u16  inBuf,
s32  headsetPanSettings,
u32  flags 
)

◆ synthesis_do_one_audio_update()

Acmd* synthesis_do_one_audio_update ( s16 aiBuf,
s32  bufLen,
Acmd *  acmd,
s32  updateIndex 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ synthesis_execute()

Acmd* synthesis_execute ( Acmd *  acmd,
s32 writtenCmds,
s16 aiBuf,
s32  bufLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ synthesis_load_note_subs_eu()

void synthesis_load_note_subs_eu ( s32  updateIndex)
Here is the caller graph for this function:

◆ synthesis_load_reverb_ring_buffer()

Acmd* synthesis_load_reverb_ring_buffer ( Acmd *  acmd,
u16  addr,
u16  srcOffset,
s32  len,
s32  reverbIndex 
)
Here is the caller graph for this function:

◆ synthesis_resample_and_mix_reverb()

Acmd* synthesis_resample_and_mix_reverb ( Acmd *  acmd,
s32  bufLen,
s16  reverbIndex,
s16  updateIndex 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ synthesis_save_reverb_ring_buffer()

Acmd* synthesis_save_reverb_ring_buffer ( Acmd *  acmd,
u16  addr,
u16  destOffset,
s32  len,
s32  reverbIndex 
)
Here is the caller graph for this function:

◆ synthesis_save_reverb_samples()

Acmd* synthesis_save_reverb_samples ( Acmd *  acmd,
s16  reverbIndex,
s16  updateIndex 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gSynthesisReverbs

struct SynthesisReverb gSynthesisReverbs[4]

◆ sAudioSynthesisPad

u8 sAudioSynthesisPad[0x10]

◆ synthesisAudioString0

char synthesisAudioString0[] = "Terminate-Canceled Channel %d,Phase %d\n"

Given that (almost) all of these are format strings, it is highly likely that they are meant to be used in some sort of printf variant. But I don't care to try and figure out which function gets which string(s) So I've place them all here instead.

◆ synthesisAudioString1

char synthesisAudioString1[] = "Copy %d\n"

◆ synthesisAudioString2

char synthesisAudioString2[] = "%d->%d\n"

◆ synthesisAudioString3

char synthesisAudioString3[] = "pitch %x: delaybytes %d : olddelay %d\n"

◆ synthesisAudioString4

char synthesisAudioString4[] = "cont %x: delaybytes %d : olddelay %d\n"