2022-04-08 08:30:31 +00:00
|
|
|
#ifndef MUSYX_H
|
|
|
|
#define MUSYX_H
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-07-27 06:32:31 +00:00
|
|
|
#ifndef bool8
|
2022-07-28 14:00:20 +00:00
|
|
|
typedef unsigned char bool8;
|
2022-07-27 06:32:31 +00:00
|
|
|
#endif
|
|
|
|
|
2022-04-08 08:30:31 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2022-04-08 08:30:31 +00:00
|
|
|
typedef struct _SynthInfo {
|
2022-04-10 00:17:06 +00:00
|
|
|
u8 unk[0x210];
|
|
|
|
u8 voices;
|
|
|
|
u8 music;
|
|
|
|
u8 sfx;
|
|
|
|
u8 studios;
|
2022-04-08 08:30:31 +00:00
|
|
|
} SynthInfo;
|
|
|
|
|
2022-07-27 05:11:36 +00:00
|
|
|
typedef struct _SND_HOOKS {
|
2022-07-27 06:32:31 +00:00
|
|
|
void* (*malloc)(u32 len);
|
|
|
|
void (*free)(void* addr);
|
2022-07-27 05:11:36 +00:00
|
|
|
} SND_HOOKS;
|
2022-07-27 06:32:31 +00:00
|
|
|
|
|
|
|
#define SND_AUX_NUMPARAMETERS 4
|
|
|
|
|
2022-07-28 14:00:20 +00:00
|
|
|
#define SND_AUX_REASON_BUFFERUPDATE 0
|
|
|
|
#define SND_AUX_REASON_PARAMETERUPDATE 1
|
|
|
|
|
2022-07-27 06:32:31 +00:00
|
|
|
typedef struct SND_AUX_INFO {
|
|
|
|
union SND_AUX_DATA {
|
|
|
|
struct SND_AUX_BUFFERUPDATE {
|
|
|
|
s32* left;
|
|
|
|
s32* right;
|
|
|
|
s32* surround;
|
|
|
|
} bufferUpdate;
|
|
|
|
struct SND_AUX_PARAMETERUPDATE {
|
|
|
|
u16 para[SND_AUX_NUMPARAMETERS];
|
|
|
|
} parameterUpdate;
|
|
|
|
} data;
|
|
|
|
} SND_AUX_INFO;
|
|
|
|
|
|
|
|
typedef struct _SND_REVHI_DELAYLINE {
|
|
|
|
s32 inPoint;
|
|
|
|
s32 outPoint;
|
|
|
|
s32 length;
|
|
|
|
f32* inputs;
|
|
|
|
f32 lastOutput;
|
|
|
|
} _SND_REVHI_DELAYLINE;
|
|
|
|
|
|
|
|
typedef struct _SND_REVHI_WORK {
|
|
|
|
_SND_REVHI_DELAYLINE AP[9];
|
|
|
|
_SND_REVHI_DELAYLINE C[9];
|
|
|
|
f32 allPassCoeff;
|
|
|
|
f32 combCoef[9];
|
|
|
|
f32 lpLastout[3];
|
|
|
|
f32 level;
|
|
|
|
f32 damping;
|
|
|
|
s32 preDelayTime;
|
|
|
|
f32 crosstalk;
|
|
|
|
f32* preDelayLine[3];
|
|
|
|
f32* preDelayPtr[3];
|
|
|
|
} _SND_REVHI_WORK;
|
|
|
|
|
|
|
|
typedef struct SND_AUX_REVERBHI {
|
|
|
|
_SND_REVHI_WORK rv;
|
|
|
|
bool8 tempDisableFX;
|
|
|
|
|
|
|
|
f32 coloration;
|
|
|
|
f32 mix;
|
|
|
|
f32 time;
|
|
|
|
f32 damping;
|
|
|
|
f32 preDelay;
|
|
|
|
f32 crosstalk;
|
|
|
|
} SND_AUX_REVERBHI;
|
|
|
|
|
2022-07-28 14:00:20 +00:00
|
|
|
void sndAuxCallbackReverbHI(u8 reason, SND_AUX_INFO* info, void* user);
|
2022-07-28 15:50:05 +00:00
|
|
|
s32 sndAuxCallbackPrepareReverbHI(SND_AUX_REVERBHI* rev);
|
|
|
|
s32 sndAuxCallbackShutdownReverbHI(SND_AUX_REVERBHI* rev);
|
2022-07-28 14:00:20 +00:00
|
|
|
|
|
|
|
typedef struct SND_AUX_DELAY {
|
|
|
|
u32 currentSize[3];
|
|
|
|
u32 currentPos[3];
|
|
|
|
u32 currentFeedback[3];
|
|
|
|
u32 currentOutput[3];
|
|
|
|
|
|
|
|
s32* left;
|
|
|
|
s32* right;
|
|
|
|
s32* sur;
|
|
|
|
|
|
|
|
u32 delay[3]; // Delay buffer length in ms per channel
|
|
|
|
u32 feedback[3]; // Feedback volume in % per channel
|
|
|
|
u32 output[3]; // Output volume in % per channel
|
|
|
|
} SND_AUX_DELAY;
|
|
|
|
|
2022-07-28 15:50:05 +00:00
|
|
|
void sndAuxCallbackDelay(u8 reason, SND_AUX_INFO* info, void* user);
|
|
|
|
s32 sndAuxCallbackUpdateSettingsDelay(SND_AUX_DELAY* delay);
|
|
|
|
s32 sndAuxCallbackPrepareDelay(SND_AUX_DELAY* rev);
|
|
|
|
s32 sndAuxCallbackShutdownDelay(SND_AUX_DELAY* rev);
|
|
|
|
s32 sndAuxCallbackUpdateSettingsReverbHI(SND_AUX_REVERBHI *rev);
|
2022-07-28 14:00:20 +00:00
|
|
|
|
2022-07-28 15:50:05 +00:00
|
|
|
typedef struct _SND_REVSTD_DELAYLINE {
|
|
|
|
s32 inPoint;
|
|
|
|
s32 outPoint;
|
|
|
|
s32 length;
|
|
|
|
f32* inputs;
|
|
|
|
f32 lastOutput;
|
|
|
|
} _SND_REVSTD_DELAYLINE;
|
|
|
|
|
|
|
|
typedef struct _SND_REVSTD_WORK {
|
|
|
|
_SND_REVSTD_DELAYLINE AP[6];
|
|
|
|
_SND_REVSTD_DELAYLINE C[6];
|
|
|
|
f32 allPassCoeff;
|
|
|
|
f32 combCoef[6];
|
|
|
|
f32 lpLastout[3];
|
|
|
|
f32 level;
|
|
|
|
f32 damping;
|
|
|
|
s32 preDelayTime;
|
|
|
|
f32* preDelayLine[3];
|
|
|
|
f32* preDelayPtr[3];
|
|
|
|
} _SND_REVSTD_WORK;
|
|
|
|
|
|
|
|
typedef struct SND_AUX_REVERBSTD {
|
|
|
|
_SND_REVSTD_WORK rv;
|
|
|
|
bool8 tempDisableFX;
|
|
|
|
|
|
|
|
f32 coloration;
|
|
|
|
f32 mix;
|
|
|
|
f32 time;
|
|
|
|
f32 damping;
|
|
|
|
f32 preDelay;
|
|
|
|
} SND_AUX_REVERBSTD;
|
2022-07-28 14:00:20 +00:00
|
|
|
|
2022-07-28 15:50:05 +00:00
|
|
|
void sndAuxCallbackReverbSTD(u8 reason,SND_AUX_INFO *info,void *user);
|
|
|
|
s32 sndAuxCallbackPrepareReverbSTD(SND_AUX_REVERBSTD *rev);
|
|
|
|
s32 sndAuxCallbackShutdownReverbSTD(SND_AUX_REVERBSTD *rev);
|
|
|
|
s32 sndAuxCallbackUpdateSettingsReverbSTD(SND_AUX_REVERBSTD *rev);
|
2022-04-08 08:30:31 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|