PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
sdhd.h
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#ifndef _SDHD_H
12#define _SDHD_H
13
14#ifdef _IOP
15#include <tamtypes.h>
16#endif
17
19{
20 u16 sampleSetIndex;
21 u8 splitRangeLow;
22 u8 splitCrossFade;
23 u8 splitRangeHigh;
24 u8 splitNumber;
25 u16 splitBendRangeLow;
26 u16 splitBendRangeHigh;
27 char keyFollowPitch;
28 u8 keyFollowPitchCenter;
29 char keyFollowAmp;
30 u8 keyFollowAmpCenter;
31 char keyFollowPan;
32 u8 keyFollowPanCenter;
33 u8 splitVolume;
34 char splitPanpot;
35 char splitTranspose;
36 char splitDetune;
38
40{
41 unsigned int splitBlockAddr;
42 u8 nSplit;
43 u8 sizeSplitBlock;
44 u8 progVolume;
45 char progPanpot;
46 char progTranspose;
47 char progDetune;
48 char keyFollowPan;
49 u8 keyFollowPanCenter;
50 u8 progAttr;
51 u8 dmy;
52 u8 progLfoWave;
53 u8 progLfoWave2;
54 u8 progLfoStartPhase;
55 u8 progLfoStartPhase2;
56 u8 progLfoPhaseRandom;
57 u8 progLfoPhaseRandom2;
58 u16 progLfoFreq;
59 u16 progLfoFreq2;
60 s16 progLfoPitchDepth;
61 s16 progLfoPitchDepth2;
62 s16 progLfoMidiPitchDepth;
63 s16 progLfoMidiPitchDepth2;
64 char progLfoAmpDepth;
65 char progLfoAmpDepth2;
66 char progLfoMidiAmpDepth;
67 char progLfoMidiAmpDepth2;
68 sceHardSynthSplitBlock splitBlock[];
70
72{
73 unsigned int volume;
74 int panpot;
75 int transpose;
76 int detune;
77};
78
81
83{
84 int pan;
85 unsigned int panCenter;
87
88typedef struct SceSdHdProgramLFO_
89{
90 unsigned int wavePitch;
91 unsigned int waveAmp;
92 unsigned int startPhasePitch;
93 unsigned int startPhaseAmp;
94 unsigned int phaseRandomPitch;
95 unsigned int phaseRandomAmp;
96 unsigned int cyclePitch;
97 unsigned int cycleAmp;
98 int pitchDepthUp;
99 int pitchDepthDown;
100 int midiPitchDepthUp;
101 int midiPitchDepthDown;
102 int ampDepthUp;
103 int ampDepthDown;
104 int midiAmpDepthUp;
105 int midiAmpDepthDown;
107
109{
110 unsigned int nSplit;
111 unsigned int progAttr;
113 SceSdHdProgramKeyFollow keyFollow;
116
118{
119 unsigned int low;
120 unsigned int crossFade;
121 unsigned int high;
122};
123
126
128{
129 unsigned int low;
130 unsigned int high;
132
134{
135 int pitch;
136 unsigned int pitchCenter;
137 int amp;
138 unsigned int ampCenter;
139 int pan;
140 unsigned int panCenter;
142
143typedef struct SceSdHdSplitBlock_
144{
145 unsigned int sampleSetIndex;
146 unsigned int splitNumber;
147 SceSdHdSplitRange range;
148 SceSdHdSplitBendRange bendRange;
149 SceSdHdSplitKeyFollow keyFollow;
150 SceSdHdSplitCommon common;
152
154{
155 u8 velCurve;
156 u8 velLimitLow;
157 u8 velLimitHigh;
158 u8 nSample;
159 u16 sampleIndex[];
161
163{
164 unsigned int velCurve;
165 unsigned int velLimitLow;
166 unsigned int velLimitHigh;
167 unsigned int nSample;
169
171{
172 u16 VagIndex;
173 u8 velRangeLow;
174 u8 velCrossFade;
175 u8 velRangeHigh;
176 char velFollowPitch;
177 u8 velFollowPitchCenter;
178 u8 velFollowPitchVelCurve;
179 char velFollowAmp;
180 u8 velFollowAmpCenter;
181 u8 velFollowAmpVelCurve;
182 u8 sampleBaseNote;
183 char sampleDetune;
184 char samplePanpot;
185 u8 sampleGroup;
186 u8 samplePriority;
187 u8 sampleVolume;
188 u8 dmy;
189 u16 sampleAdsr1;
190 u16 sampleAdsr2;
191 char keyFollowAr;
192 u8 keyFollowArCenter;
193 char keyFollowDr;
194 u8 keyFollowDrCenter;
195 char keyFollowSr;
196 u8 keyFollowSrCenter;
197 char keyFollowRr;
198 u8 keyFollowRrCenter;
199 char keyFollowSl;
200 u8 keyFollowSlCenter;
201 u16 samplePitchLfoDelay;
202 u16 samplePitchLfoFade;
203 u16 sampleAmpLfoDelay;
204 u16 sampleAmpLfoFade;
205 u8 sampleLfoAttr;
206 u8 sampleSpuAttr;
208
210{
211 int pitch;
212 unsigned int pitchCenter;
213 unsigned int pitchVelCurve;
214 int amp;
215 unsigned int ampCenter;
216 unsigned int ampVelCurve;
218
220{
221 unsigned int baseNote;
222 int detune;
223 int panpot;
224 unsigned int group;
225 unsigned int priority;
226 unsigned int volume;
228
229typedef struct SceSdHdSampleADSR_
230{
231 unsigned int ADSR1;
232 unsigned int ADSR2;
234
236{
237 int ar;
238 unsigned int arCenter;
239 int dr;
240 unsigned int drCenter;
241 int sr;
242 unsigned int srCenter;
243 int rr;
244 unsigned int rrCenter;
245 int sl;
246 unsigned int slCenter;
248
249typedef struct SceSdHdSampleLFO_
250{
251 unsigned int pitchLFODelay;
252 unsigned int pitchLFOFade;
253 unsigned int ampLFODelay;
254 unsigned int ampLFOFade;
256
258{
259 int vagIndex;
260 unsigned int spuAttr;
261 unsigned int lfoAttr;
262 SceSdHdSampleVelRange velRange;
263 SceSdHdSampleVelFollow velFollow;
264 SceSdHdSampleCommon common;
266 SceSdHdSampleKeyFollow keyFollow;
269
271{
272 unsigned int vagOffsetAddr;
273 u16 vagSampleRate;
274 u8 vagAttribute;
275 u8 dmy;
277
279{
280 unsigned int vagOffsetAddr;
281 unsigned int vagSize;
282 unsigned int vagSampleRate;
283 unsigned int vagAttribute;
285
286extern int sceSdHdGetMaxProgramNumber(void *buffer);
287extern int sceSdHdGetMaxSampleSetNumber(void *buffer);
288extern int sceSdHdGetMaxSampleNumber(void *buffer);
289extern int sceSdHdGetMaxVAGInfoNumber(void *buffer);
290extern int sceSdHdGetProgramParamAddr(void *buffer, unsigned int programNumber, sceHardSynthProgramParam **ptr);
291extern int sceSdHdGetProgramParam(void *buffer, unsigned int programNumber, SceSdHdProgramParam *param);
292extern int sceSdHdGetSplitBlockAddr(
293 void *buffer, unsigned int programNumber, unsigned int splitBlockNumber, sceHardSynthSplitBlock **theParamPtr);
294extern int
295sceSdHdGetSplitBlock(void *buffer, unsigned int programNumber, unsigned int splitBlockNumber, SceSdHdSplitBlock *param);
296extern int sceSdHdGetSampleSetParamAddr(void *buffer, unsigned int sampleSetNumber, sceHardSynthSampleSetParam **ptr);
297extern int sceSdHdGetSampleSetParam(void *buffer, unsigned int sampleSetNumber, SceSdHdSampleSetParam *param);
298extern int sceSdHdGetSampleParamAddr(void *buffer, unsigned int sampleNumber, sceHardSynthSampleParam **ptr);
299extern int sceSdHdGetSampleParam(void *buffer, unsigned int sampleNumber, SceSdHdSampleParam *param);
300extern int sceSdHdGetVAGInfoParamAddr(void *buffer, unsigned int vagInfoNumber, sceHardSynthVagParam **ptr);
301extern int sceSdHdGetVAGInfoParam(void *buffer, unsigned int vagInfoNumber, SceSdHdVAGInfoParam *param);
302extern int sceSdHdCheckProgramNumber(void *buffer, unsigned int programNumber);
303extern int sceSdHdGetSplitBlockCountByNote(void *buffer, unsigned int programNumber, unsigned int noteNumber);
304extern int sceSdHdGetSplitBlockAddrByNote(
305 void *buffer, unsigned int programNumber, unsigned int noteNumber, sceHardSynthSplitBlock **ptr);
306extern int
307sceSdHdGetSplitBlockByNote(void *buffer, unsigned int programNumber, unsigned int noteNumber, SceSdHdSplitBlock *param);
308extern int sceSdHdGetSampleSetParamCountByNote(void *buffer, unsigned int programNumber, unsigned int noteNumber);
309extern int sceSdHdGetSampleSetParamAddrByNote(
310 void *buffer, unsigned int programNumber, unsigned int noteNumber, sceHardSynthSampleSetParam **ptr);
311extern int sceSdHdGetSampleSetParamByNote(
312 void *buffer, unsigned int programNumber, unsigned int noteNumber, SceSdHdSampleSetParam *param);
313extern int sceSdHdGetSampleParamCountByNoteVelocity(
314 void *buffer, unsigned int programNumber, unsigned int noteNumber, unsigned int velocity, unsigned int mode);
315extern int sceSdHdGetSampleParamAddrByNoteVelocity(
316 void *buffer,
317 unsigned int programNumber,
318 unsigned int noteNumber,
319 unsigned int velocity,
320 unsigned int mode,
322extern int sceSdHdGetSampleParamByNoteVelocity(
323 void *buffer,
324 unsigned int programNumber,
325 unsigned int noteNumber,
326 unsigned int velocity,
327 unsigned int mode,
328 SceSdHdSampleParam *param);
329extern int sceSdHdGetVAGInfoParamCountByNoteVelocity(
330 void *buffer, unsigned int programNumber, unsigned int noteNumber, unsigned int velocity, unsigned int mode);
331extern int sceSdHdGetVAGInfoParamAddrByNoteVelocity(
332 void *buffer,
333 unsigned int programNumber,
334 unsigned int noteNumber,
335 unsigned int velocity,
336 unsigned int mode,
338extern int sceSdHdGetVAGInfoParamByNoteVelocity(
339 void *buffer,
340 unsigned int programNumber,
341 unsigned int noteNumber,
342 unsigned int velocity,
343 unsigned int mode,
344 SceSdHdVAGInfoParam *param);
345extern int sceSdHdGetSampleParamCountByVelocity(
346 void *buffer, unsigned int sampleSetNumber, unsigned int velocity, unsigned int mode);
347extern int sceSdHdGetSampleParamAddrByVelocity(
348 void *buffer, unsigned int sampleSetNumber, unsigned int velocity, unsigned int mode, sceHardSynthSampleParam **ptr);
349extern int sceSdHdGetSampleParamByVelocity(
350 void *buffer, unsigned int sampleSetNumber, unsigned int velocity, unsigned int mode, SceSdHdSampleParam *param);
351extern int sceSdHdGetVAGInfoParamCountByVelocity(
352 void *buffer, unsigned int sampleSetNumber, unsigned int velocity, unsigned int mode);
353extern int sceSdHdGetVAGInfoParamAddrByVelocity(
354 void *buffer, unsigned int sampleSetNumber, unsigned int velocity, unsigned int mode, sceHardSynthVagParam **ptr);
355extern int sceSdHdGetVAGInfoParamByVelocity(
356 void *buffer, unsigned int sampleSetNumber, unsigned int velocity, unsigned int mode, SceSdHdVAGInfoParam *param);
357extern int
358sceSdHdGetVAGInfoParamAddrBySampleNumber(void *buffer, unsigned int sampleNumber, sceHardSynthVagParam **ptr);
359extern int sceSdHdGetVAGInfoParamBySampleNumber(void *buffer, unsigned int sampleNumber, SceSdHdVAGInfoParam *param);
360extern int sceSdHdGetSplitBlockNumberBySplitNumber(void *buffer, unsigned int programNumber, unsigned int splitNumber);
361extern int sceSdHdGetVAGSize(void *buffer, unsigned int vagInfoNumber);
362extern int sceSdHdGetSplitBlockCount(void *buffer, unsigned int programNumber);
363extern int sceSdHdGetMaxSplitBlockCount(void *buffer);
364extern int sceSdHdGetMaxSampleSetParamCount(void *buffer);
365extern int sceSdHdGetMaxSampleParamCount(void *buffer);
366extern int sceSdHdGetMaxVAGInfoParamCount(void *buffer);
367extern int sceSdHdModifyVelocity(unsigned int curveType, int velocity);
368extern int sceSdHdModifyVelocityLFO(unsigned int curveType, int velocity, int center);
369extern int sceSdHdGetValidProgramNumberCount(void *buffer);
370extern int sceSdHdGetValidProgramNumber(void *buffer, unsigned int *ptr);
371extern int
372sceSdHdGetSampleNumberBySampleIndex(void *buffer, unsigned int sampleSetNumber, unsigned int sampleIndexNumber);
373
374#define sdhd_IMPORTS_start DECLARE_IMPORT_TABLE(sdhd, 1, 2)
375#define sdhd_IMPORTS_end END_IMPORT_TABLE
376
377#define I_sceSdHdGetMaxProgramNumber DECLARE_IMPORT(4, sceSdHdGetMaxProgramNumber)
378#define I_sceSdHdGetMaxSampleSetNumber DECLARE_IMPORT(5, sceSdHdGetMaxSampleSetNumber)
379#define I_sceSdHdGetMaxSampleNumber DECLARE_IMPORT(6, sceSdHdGetMaxSampleNumber)
380#define I_sceSdHdGetMaxVAGInfoNumber DECLARE_IMPORT(7, sceSdHdGetMaxVAGInfoNumber)
381#define I_sceSdHdGetProgramParamAddr DECLARE_IMPORT(8, sceSdHdGetProgramParamAddr)
382#define I_sceSdHdGetProgramParam DECLARE_IMPORT(9, sceSdHdGetProgramParam)
383#define I_sceSdHdGetSplitBlockAddr DECLARE_IMPORT(10, sceSdHdGetSplitBlockAddr)
384#define I_sceSdHdGetSplitBlock DECLARE_IMPORT(11, sceSdHdGetSplitBlock)
385#define I_sceSdHdGetSampleSetParamAddr DECLARE_IMPORT(12, sceSdHdGetSampleSetParamAddr)
386#define I_sceSdHdGetSampleSetParam DECLARE_IMPORT(13, sceSdHdGetSampleSetParam)
387#define I_sceSdHdGetSampleParamAddr DECLARE_IMPORT(14, sceSdHdGetSampleParamAddr)
388#define I_sceSdHdGetSampleParam DECLARE_IMPORT(15, sceSdHdGetSampleParam)
389#define I_sceSdHdGetVAGInfoParamAddr DECLARE_IMPORT(16, sceSdHdGetVAGInfoParamAddr)
390#define I_sceSdHdGetVAGInfoParam DECLARE_IMPORT(17, sceSdHdGetVAGInfoParam)
391#define I_sceSdHdCheckProgramNumber DECLARE_IMPORT(18, sceSdHdCheckProgramNumber)
392#define I_sceSdHdGetSplitBlockCountByNote DECLARE_IMPORT(19, sceSdHdGetSplitBlockCountByNote)
393#define I_sceSdHdGetSplitBlockAddrByNote DECLARE_IMPORT(20, sceSdHdGetSplitBlockAddrByNote)
394#define I_sceSdHdGetSplitBlockByNote DECLARE_IMPORT(21, sceSdHdGetSplitBlockByNote)
395#define I_sceSdHdGetSampleSetParamCountByNote DECLARE_IMPORT(22, sceSdHdGetSampleSetParamCountByNote)
396#define I_sceSdHdGetSampleSetParamAddrByNote DECLARE_IMPORT(23, sceSdHdGetSampleSetParamAddrByNote)
397#define I_sceSdHdGetSampleSetParamByNote DECLARE_IMPORT(24, sceSdHdGetSampleSetParamByNote)
398#define I_sceSdHdGetSampleParamCountByNoteVelocity DECLARE_IMPORT(25, sceSdHdGetSampleParamCountByNoteVelocity)
399#define I_sceSdHdGetSampleParamAddrByNoteVelocity DECLARE_IMPORT(26, sceSdHdGetSampleParamAddrByNoteVelocity)
400#define I_sceSdHdGetSampleParamByNoteVelocity DECLARE_IMPORT(27, sceSdHdGetSampleParamByNoteVelocity)
401#define I_sceSdHdGetVAGInfoParamCountByNoteVelocity DECLARE_IMPORT(28, sceSdHdGetVAGInfoParamCountByNoteVelocity)
402#define I_sceSdHdGetVAGInfoParamAddrByNoteVelocity DECLARE_IMPORT(29, sceSdHdGetVAGInfoParamAddrByNoteVelocity)
403#define I_sceSdHdGetVAGInfoParamByNoteVelocity DECLARE_IMPORT(30, sceSdHdGetVAGInfoParamByNoteVelocity)
404#define I_sceSdHdGetSampleParamCountByVelocity DECLARE_IMPORT(31, sceSdHdGetSampleParamCountByVelocity)
405#define I_sceSdHdGetSampleParamAddrByVelocity DECLARE_IMPORT(32, sceSdHdGetSampleParamAddrByVelocity)
406#define I_sceSdHdGetSampleParamByVelocity DECLARE_IMPORT(33, sceSdHdGetSampleParamByVelocity)
407#define I_sceSdHdGetVAGInfoParamCountByVelocity DECLARE_IMPORT(34, sceSdHdGetVAGInfoParamCountByVelocity)
408#define I_sceSdHdGetVAGInfoParamAddrByVelocity DECLARE_IMPORT(35, sceSdHdGetVAGInfoParamAddrByVelocity)
409#define I_sceSdHdGetVAGInfoParamByVelocity DECLARE_IMPORT(36, sceSdHdGetVAGInfoParamByVelocity)
410#define I_sceSdHdGetVAGInfoParamAddrBySampleNumber DECLARE_IMPORT(37, sceSdHdGetVAGInfoParamAddrBySampleNumber)
411#define I_sceSdHdGetVAGInfoParamBySampleNumber DECLARE_IMPORT(38, sceSdHdGetVAGInfoParamBySampleNumber)
412#define I_sceSdHdGetSplitBlockNumberBySplitNumber DECLARE_IMPORT(39, sceSdHdGetSplitBlockNumberBySplitNumber)
413#define I_sceSdHdGetVAGSize DECLARE_IMPORT(40, sceSdHdGetVAGSize)
414#define I_sceSdHdGetSplitBlockCount DECLARE_IMPORT(41, sceSdHdGetSplitBlockCount)
415#define I_sceSdHdGetMaxSplitBlockCount DECLARE_IMPORT(42, sceSdHdGetMaxSplitBlockCount)
416#define I_sceSdHdGetMaxSampleSetParamCount DECLARE_IMPORT(43, sceSdHdGetMaxSampleSetParamCount)
417#define I_sceSdHdGetMaxSampleParamCount DECLARE_IMPORT(44, sceSdHdGetMaxSampleParamCount)
418#define I_sceSdHdGetMaxVAGInfoParamCount DECLARE_IMPORT(45, sceSdHdGetMaxVAGInfoParamCount)
419#define I_sceSdHdModifyVelocity DECLARE_IMPORT(46, sceSdHdModifyVelocity)
420#define I_sceSdHdModifyVelocityLFO DECLARE_IMPORT(47, sceSdHdModifyVelocityLFO)
421#define I_sceSdHdGetValidProgramNumberCount DECLARE_IMPORT(48, sceSdHdGetValidProgramNumberCount)
422#define I_sceSdHdGetValidProgramNumber DECLARE_IMPORT(49, sceSdHdGetValidProgramNumber)
423#define I_sceSdHdGetSampleNumberBySampleIndex DECLARE_IMPORT(50, sceSdHdGetSampleNumberBySampleIndex)
424
425#endif