SSBM Decomp
Toggle main menu visibility
Loading...
Searching...
No Matches
syn.h
Go to the documentation of this file.
1
#ifndef _DOLPHIN_SYN_H_
2
#define _DOLPHIN_SYN_H_
3
4
#include <
dolphin/ax.h
>
5
6
#define SYN_INPUT_BUFFER_SIZE 0x100
7
8
struct
WTINST
{
9
/* 0x00 */
u16
keyRegion
[128];
10
};
11
12
struct
WTREGION
{
13
/* 0x00 */
u8
unityNote
;
14
/* 0x01 */
u8
keyGroup
;
15
/* 0x02 */
s16
fineTune
;
16
/* 0x04 */
long
attn
;
17
/* 0x08 */
u32
loopStart
;
18
/* 0x0C */
u32
loopLength
;
19
/* 0x10 */
u32
articulationIndex
;
20
/* 0x14 */
u32
sampleIndex
;
21
};
22
23
struct
WTART
{
24
/* 0x00 */
long
lfoFreq
;
25
/* 0x04 */
long
lfoDelay
;
26
/* 0x08 */
long
lfoAtten
;
27
/* 0x0C */
long
lfoPitch
;
28
/* 0x10 */
long
lfoMod2Atten
;
29
/* 0x14 */
long
lfoMod2Pitch
;
30
/* 0x18 */
long
eg1Attack
;
31
/* 0x1C */
long
eg1Decay
;
32
/* 0x20 */
long
eg1Sustain
;
33
/* 0x24 */
long
eg1Release
;
34
/* 0x28 */
long
eg1Vel2Attack
;
35
/* 0x2C */
long
eg1Key2Decay
;
36
/* 0x30 */
long
eg2Attack
;
37
/* 0x34 */
long
eg2Decay
;
38
/* 0x38 */
long
eg2Sustain
;
39
/* 0x3C */
long
eg2Release
;
40
/* 0x40 */
long
eg2Vel2Attack
;
41
/* 0x44 */
long
eg2Key2Decay
;
42
/* 0x48 */
long
eg2Pitch
;
43
/* 0x4C */
long
pan
;
44
};
45
46
struct
WTSAMPLE
{
47
/* 0x00 */
u16
format
;
48
/* 0x02 */
u16
sampleRate
;
49
/* 0x04 */
u32
offset
;
50
/* 0x08 */
u32
length
;
51
/* 0x0C */
u16
adpcmIndex
;
52
};
53
54
struct
WTADPCM
{
55
/* 0x00 */
u16
a
[8][2];
56
/* 0x20 */
u16
gain
;
57
/* 0x22 */
u16
pred_scale
;
58
/* 0x24 */
u16
yn1
;
59
/* 0x26 */
u16
yn2
;
60
/* 0x28 */
u16
loop_pred_scale
;
61
/* 0x2A */
u16
loop_yn1
;
62
/* 0x2C */
u16
loop_yn2
;
63
};
64
65
struct
SYNSYNTH
{
66
/* 0x0000 */
void
*
next
;
67
/* 0x0004 */
struct
WTINST
*
percussiveInst
;
68
/* 0x0008 */
struct
WTINST
*
melodicInst
;
69
/* 0x000C */
struct
WTREGION
*
region
;
70
/* 0x0010 */
struct
WTART
*
art
;
71
/* 0x0014 */
struct
WTSAMPLE
*
sample
;
72
/* 0x0018 */
struct
WTADPCM
*
adpcm
;
73
/* 0x001C */
u32
aramBaseWord
;
74
/* 0x0020 */
u32
aramBaseByte
;
75
/* 0x0024 */
u32
aramBaseNibble
;
76
/* 0x0028 */
u32
priorityVoiceAlloc
;
77
/* 0x002C */
u32
priorityNoteOn
;
78
/* 0x0030 */
u32
priorityNoteRelease
;
79
/* 0x0034 */
struct
WTINST
*
inst
[16];
80
/* 0x0074 */
long
masterVolume
;
81
/* 0x0078 */
u8
controller
[16][128];
82
/* 0x0878 */
u8
rpn
[16];
83
/* 0x0888 */
s16
dataEntry
[16];
84
/* 0x08A8 */
long
pwMaxCents
[16];
85
/* 0x08E8 */
long
pwCents
[16];
86
/* 0x0928 */
long
volAttn
[16];
87
/* 0x0968 */
long
expAttn
[16];
88
/* 0x09A8 */
long
auxAAttn
[16];
89
/* 0x09E8 */
long
auxBAttn
[16];
90
/* 0x0A28 */
u8
input
[
SYN_INPUT_BUFFER_SIZE
][3];
91
/* 0x0D28 */
u8
*
inputPosition
;
92
/* 0x0D2C */
u32
inputCounter
;
93
/* 0x0D30 */
u32
notes
;
94
/* 0x0D34 */
void
*
keyGroup
[16][16];
95
/* 0x1134 */
void
*
voice
[16][128];
96
};
97
98
struct
SYNVOICE
{
99
/* 0x00 */
void
*
next
;
100
/* 0x04 */
AXVPB
*
axvpb
;
101
/* 0x08 */
struct
SYNSYNTH
*
synth
;
102
/* 0x0C */
u8
midiChannel
;
103
/* 0x0D */
u8
keyNum
;
104
/* 0x0E */
u8
keyVel
;
105
/* 0x0F */
u8
pan
;
106
/* 0x10 */
u8
keyGroup
;
107
/* 0x14 */
struct
WTREGION
*
region
;
108
/* 0x18 */
struct
WTART
*
art
;
109
/* 0x1C */
struct
WTSAMPLE
*
sample
;
110
/* 0x20 */
struct
WTADPCM
*
adpcm
;
111
/* 0x24 */
u32
hold
;
112
/* 0x28 */
u32
type
;
113
/* 0x2C */
f32
srcRatio
;
114
/* 0x30 */
long
cents
;
115
/* 0x34 */
long
attn
;
116
/* 0x38 */
long
lfoState
;
117
/* 0x3C */
long
lfoAttn
;
118
/* 0x40 */
long
lfoCents
;
119
/* 0x44 */
long
lfoFreq
;
120
/* 0x48 */
long
lfoDelay
;
121
/* 0x4C */
long
lfoAttn_
;
122
/* 0x50 */
long
lfoCents_
;
123
/* 0x54 */
long
lfoModAttn
;
124
/* 0x58 */
long
lfoModCents
;
125
/* 0x5C */
u32
veState
;
126
/* 0x60 */
long
veAttn
;
127
/* 0x64 */
long
veAttack
;
128
/* 0x68 */
long
veAttackDelta
;
129
/* 0x6C */
long
veDecay
;
130
/* 0x70 */
long
veSustain
;
131
/* 0x74 */
long
veRelease
;
132
/* 0x78 */
u32
peState
;
133
/* 0x7C */
long
peCents
;
134
/* 0x80 */
long
peAttack
;
135
/* 0x84 */
long
peDecay
;
136
/* 0x88 */
long
peSustain
;
137
/* 0x8C */
long
peRelease
;
138
/* 0x90 */
long
pePitch
;
139
};
140
141
// sample formats
142
#define SYN_SAMPLE_FORMAT_ADPCM 0
143
#define SYN_SAMPLE_FORMAT_PCM16 1
144
#define SYN_SAMPLE_FORMAT_PCM8 2
145
146
// syn.c
147
void
SYNInit
();
148
void
SYNQuit
();
149
void
SYNRunAudioFrame
();
150
void
SYNInitSynth
(
struct
SYNSYNTH
* synth,
void
* wavetable,
u32
aramBase,
u32
priorityVoiceAlloc,
u32
priorityNoteOn,
u32
priorityNoteRelease);
151
void
SYNQuitSynth
(
struct
SYNSYNTH
* synth);
152
void
SYNMidiInput
(
struct
SYNSYNTH
* synth,
u8
* input);
153
void
SYNSetMasterVolume
(
struct
SYNSYNTH
* synth,
long
dB);
154
long
SYNGetMasterVolume
(
struct
SYNSYNTH
* synth);
155
u32
SYNGetActiveNotes
(
struct
SYNSYNTH
* synth);
156
157
// synctrl.c
158
u8
SYNGetMidiController
(
struct
SYNSYNTH
* synth,
u8
midiChannel,
u8
function);
159
160
#endif
// _DOLPHIN_SYN_H_
ax.h
u32
unsigned long u32
Definition
types.h:9
s16
signed short int s16
Definition
types.h:6
f32
float f32
Definition
types.h:13
u16
unsigned short int u16
Definition
types.h:7
u8
unsigned char u8
Definition
types.h:5
AXVPB
Definition
ax.h:122
SYNSYNTH
Definition
syn.h:65
SYNSYNTH::auxAAttn
long auxAAttn[16]
Definition
syn.h:88
SYNSYNTH::pwMaxCents
long pwMaxCents[16]
Definition
syn.h:84
SYNSYNTH::pwCents
long pwCents[16]
Definition
syn.h:85
SYNSYNTH::masterVolume
long masterVolume
Definition
syn.h:80
SYNSYNTH::inputCounter
u32 inputCounter
Definition
syn.h:92
SYNSYNTH::sample
struct WTSAMPLE * sample
Definition
syn.h:71
SYNSYNTH::aramBaseNibble
u32 aramBaseNibble
Definition
syn.h:75
SYNSYNTH::percussiveInst
struct WTINST * percussiveInst
Definition
syn.h:67
SYNSYNTH::auxBAttn
long auxBAttn[16]
Definition
syn.h:89
SYNSYNTH::priorityVoiceAlloc
u32 priorityVoiceAlloc
Definition
syn.h:76
SYNSYNTH::aramBaseByte
u32 aramBaseByte
Definition
syn.h:74
SYNSYNTH::input
u8 input[SYN_INPUT_BUFFER_SIZE][3]
Definition
syn.h:90
SYNSYNTH::melodicInst
struct WTINST * melodicInst
Definition
syn.h:68
SYNSYNTH::region
struct WTREGION * region
Definition
syn.h:69
SYNSYNTH::controller
u8 controller[16][128]
Definition
syn.h:81
SYNSYNTH::inputPosition
u8 * inputPosition
Definition
syn.h:91
SYNSYNTH::priorityNoteOn
u32 priorityNoteOn
Definition
syn.h:77
SYNSYNTH::notes
u32 notes
Definition
syn.h:93
SYNSYNTH::adpcm
struct WTADPCM * adpcm
Definition
syn.h:72
SYNSYNTH::dataEntry
s16 dataEntry[16]
Definition
syn.h:83
SYNSYNTH::expAttn
long expAttn[16]
Definition
syn.h:87
SYNSYNTH::priorityNoteRelease
u32 priorityNoteRelease
Definition
syn.h:78
SYNSYNTH::art
struct WTART * art
Definition
syn.h:70
SYNSYNTH::volAttn
long volAttn[16]
Definition
syn.h:86
SYNSYNTH::rpn
u8 rpn[16]
Definition
syn.h:82
SYNSYNTH::keyGroup
void * keyGroup[16][16]
Definition
syn.h:94
SYNSYNTH::next
void * next
Definition
syn.h:66
SYNSYNTH::voice
void * voice[16][128]
Definition
syn.h:95
SYNSYNTH::inst
struct WTINST * inst[16]
Definition
syn.h:79
SYNSYNTH::aramBaseWord
u32 aramBaseWord
Definition
syn.h:73
SYNVOICE
Definition
syn.h:98
SYNVOICE::srcRatio
f32 srcRatio
Definition
syn.h:113
SYNVOICE::type
u32 type
Definition
syn.h:112
SYNVOICE::lfoFreq
long lfoFreq
Definition
syn.h:119
SYNVOICE::axvpb
AXVPB * axvpb
Definition
syn.h:100
SYNVOICE::cents
long cents
Definition
syn.h:114
SYNVOICE::lfoDelay
long lfoDelay
Definition
syn.h:120
SYNVOICE::attn
long attn
Definition
syn.h:115
SYNVOICE::keyGroup
u8 keyGroup
Definition
syn.h:106
SYNVOICE::art
struct WTART * art
Definition
syn.h:108
SYNVOICE::lfoAttn
long lfoAttn
Definition
syn.h:117
SYNVOICE::peCents
long peCents
Definition
syn.h:133
SYNVOICE::pePitch
long pePitch
Definition
syn.h:138
SYNVOICE::midiChannel
u8 midiChannel
Definition
syn.h:102
SYNVOICE::next
void * next
Definition
syn.h:99
SYNVOICE::veSustain
long veSustain
Definition
syn.h:130
SYNVOICE::lfoAttn_
long lfoAttn_
Definition
syn.h:121
SYNVOICE::veRelease
long veRelease
Definition
syn.h:131
SYNVOICE::veAttack
long veAttack
Definition
syn.h:127
SYNVOICE::lfoState
long lfoState
Definition
syn.h:116
SYNVOICE::lfoModCents
long lfoModCents
Definition
syn.h:124
SYNVOICE::veDecay
long veDecay
Definition
syn.h:129
SYNVOICE::lfoModAttn
long lfoModAttn
Definition
syn.h:123
SYNVOICE::adpcm
struct WTADPCM * adpcm
Definition
syn.h:110
SYNVOICE::veAttn
long veAttn
Definition
syn.h:126
SYNVOICE::lfoCents
long lfoCents
Definition
syn.h:118
SYNVOICE::veAttackDelta
long veAttackDelta
Definition
syn.h:128
SYNVOICE::peSustain
long peSustain
Definition
syn.h:136
SYNVOICE::peDecay
long peDecay
Definition
syn.h:135
SYNVOICE::keyVel
u8 keyVel
Definition
syn.h:104
SYNVOICE::peState
u32 peState
Definition
syn.h:132
SYNVOICE::peAttack
long peAttack
Definition
syn.h:134
SYNVOICE::synth
struct SYNSYNTH * synth
Definition
syn.h:101
SYNVOICE::hold
u32 hold
Definition
syn.h:111
SYNVOICE::peRelease
long peRelease
Definition
syn.h:137
SYNVOICE::keyNum
u8 keyNum
Definition
syn.h:103
SYNVOICE::lfoCents_
long lfoCents_
Definition
syn.h:122
SYNVOICE::pan
u8 pan
Definition
syn.h:105
SYNVOICE::sample
struct WTSAMPLE * sample
Definition
syn.h:109
SYNVOICE::veState
u32 veState
Definition
syn.h:125
SYNVOICE::region
struct WTREGION * region
Definition
syn.h:107
WTADPCM
Definition
syn.h:54
WTADPCM::yn2
u16 yn2
Definition
syn.h:59
WTADPCM::pred_scale
u16 pred_scale
Definition
syn.h:57
WTADPCM::loop_yn1
u16 loop_yn1
Definition
syn.h:61
WTADPCM::yn1
u16 yn1
Definition
syn.h:58
WTADPCM::loop_pred_scale
u16 loop_pred_scale
Definition
syn.h:60
WTADPCM::gain
u16 gain
Definition
syn.h:56
WTADPCM::loop_yn2
u16 loop_yn2
Definition
syn.h:62
WTADPCM::a
u16 a[8][2]
Definition
syn.h:55
WTART
Definition
syn.h:23
WTART::lfoDelay
long lfoDelay
Definition
syn.h:25
WTART::eg1Decay
long eg1Decay
Definition
syn.h:31
WTART::eg1Release
long eg1Release
Definition
syn.h:33
WTART::eg2Sustain
long eg2Sustain
Definition
syn.h:38
WTART::eg2Key2Decay
long eg2Key2Decay
Definition
syn.h:41
WTART::eg1Sustain
long eg1Sustain
Definition
syn.h:32
WTART::lfoFreq
long lfoFreq
Definition
syn.h:24
WTART::eg1Attack
long eg1Attack
Definition
syn.h:30
WTART::lfoAtten
long lfoAtten
Definition
syn.h:26
WTART::eg1Key2Decay
long eg1Key2Decay
Definition
syn.h:35
WTART::eg2Release
long eg2Release
Definition
syn.h:39
WTART::eg2Decay
long eg2Decay
Definition
syn.h:37
WTART::eg1Vel2Attack
long eg1Vel2Attack
Definition
syn.h:34
WTART::lfoMod2Pitch
long lfoMod2Pitch
Definition
syn.h:29
WTART::eg2Pitch
long eg2Pitch
Definition
syn.h:42
WTART::lfoMod2Atten
long lfoMod2Atten
Definition
syn.h:28
WTART::eg2Vel2Attack
long eg2Vel2Attack
Definition
syn.h:40
WTART::eg2Attack
long eg2Attack
Definition
syn.h:36
WTART::lfoPitch
long lfoPitch
Definition
syn.h:27
WTART::pan
long pan
Definition
syn.h:43
WTINST
Definition
syn.h:8
WTINST::keyRegion
u16 keyRegion[128]
Definition
syn.h:9
WTREGION
Definition
syn.h:12
WTREGION::fineTune
s16 fineTune
Definition
syn.h:15
WTREGION::sampleIndex
u32 sampleIndex
Definition
syn.h:20
WTREGION::keyGroup
u8 keyGroup
Definition
syn.h:14
WTREGION::attn
long attn
Definition
syn.h:16
WTREGION::loopStart
u32 loopStart
Definition
syn.h:17
WTREGION::loopLength
u32 loopLength
Definition
syn.h:18
WTREGION::articulationIndex
u32 articulationIndex
Definition
syn.h:19
WTREGION::unityNote
u8 unityNote
Definition
syn.h:13
WTSAMPLE
Definition
syn.h:46
WTSAMPLE::sampleRate
u16 sampleRate
Definition
syn.h:48
WTSAMPLE::length
u32 length
Definition
syn.h:50
WTSAMPLE::format
u16 format
Definition
syn.h:47
WTSAMPLE::adpcmIndex
u16 adpcmIndex
Definition
syn.h:51
WTSAMPLE::offset
u32 offset
Definition
syn.h:49
SYNGetActiveNotes
u32 SYNGetActiveNotes(struct SYNSYNTH *synth)
SYNSetMasterVolume
void SYNSetMasterVolume(struct SYNSYNTH *synth, long dB)
SYNInit
void SYNInit()
SYN_INPUT_BUFFER_SIZE
#define SYN_INPUT_BUFFER_SIZE
Definition
syn.h:6
SYNQuit
void SYNQuit()
SYNGetMasterVolume
long SYNGetMasterVolume(struct SYNSYNTH *synth)
SYNRunAudioFrame
void SYNRunAudioFrame()
SYNQuitSynth
void SYNQuitSynth(struct SYNSYNTH *synth)
SYNMidiInput
void SYNMidiInput(struct SYNSYNTH *synth, u8 *input)
SYNInitSynth
void SYNInitSynth(struct SYNSYNTH *synth, void *wavetable, u32 aramBase, u32 priorityVoiceAlloc, u32 priorityNoteOn, u32 priorityNoteRelease)
SYNGetMidiController
u8 SYNGetMidiController(struct SYNSYNTH *synth, u8 midiChannel, u8 function)
extern
dolphin
include
dolphin
syn.h
Generated by
1.17.0