midiDmon.h
4.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#include <audiotools.h>
#include <libaudio.h>
#include <dmedia/midi.h>
typedef struct {
ALSymFileObj SFObj;
int deleteFlag;
} ALSymObj;
typedef struct { char array[32]; }array32;
#define MAX_HASH_NAME_SIZE 64
#define MAX_PORTS 4
#define MEMORY_OK 0
#define MEMORY_NOT_OK 1
#define MAX_BANK_STRS 5
#define BANK_INST_STR_LEN 10
#define BANK_DEFAULT_PARAM 1
#define BANK_PERC_PARAM 2
#define BANK_INST_CT_PARAM 3
#define BANK_RATE_PARAM 4
#define BANK_INST_PARAM 5
#define MAX_INST_STRS 5
#define INST_SND_STR_LEN 5
#define INST_VOLUME_PARAM 1
#define INST_PAN_PARAM 2
#define INST_PRIOR_PARAM 3
#define INST_SNDCOUNT_PARAM 4
#define INST_SNDARRAY_PARAM 5
#define MAX_SOUND_STRS 5
#define SND_SAMPLE_PARAM 1
#define SND_KEYMAP_PARAM 2
#define SND_ENVLP_PARAM 3
#define SND_PAN_PARAM 4
#define SND_VOLUME_PARAM 5
#define MAX_ENVLP_STRS 5
#define ENVLP_ATTCK_TIME 1
#define ENVLP_ATTCK_LVL 2
#define ENVLP_DECAY_TIME 3
#define ENVLP_DECAY_LVL 4
#define ENVLP_REL_TIME 5
#define MAX_KMAP_STRS 6
#define KMAP_VEL_MIN 1
#define KMAP_VEL_MAX 2
#define KMAP_KEY_MIN 3
#define KMAP_KEY_MAX 4
#define KMAP_KEYBASE 5
#define KMAP_DETUNE 6
#define CREATE_BANK_STR_LEN 11
#define CREATE_INST_STR_LEN 17
#define CREATE_SND_STR_LEN 12
#define CREATE_ENVLP_STR_LEN 15
#define CREATE_KMAP_STR_LEN 13
#define CREATE_WAVETBL_STR_LEN 16
#define DELETE_BANK_STR_LEN 11
#define DELETE_INST_STR_LEN 17
#define DELETE_SND_STR_LEN 12
#define DELETE_ENVLP_STR_LEN 15
#define DELETE_KMAP_STR_LEN 13
#define DELETE_WAVETBL_STR_LEN 16
#define OBJECT_GROW_PAD 500 /* in number of objects, not bytes */
#define NAME_GROW_PAD 5000
int mdInit(void);
/* sysex.c */
void ProcessSysEx(MDevent *mdv);
void HandleGetString(char *param,int strType);
void HandleGetNumber(char *param,int strType);
void HandleSetString(char *param,int strType,char *data);
void HandleSetNumber(char *param,int strType,double dvalue);
void HandleGetBank(char *param);
void HandleSetBank(char *param,char *data,double dvalue);
void HandleGetInst(char *param);
void HandleSetInst(char *param,char *data,double dvalue);
void HandleGetSnd(char *param);
void HandleSetSnd(char *param,char *data,double dvalue);
void HandleGetEnvlp(char *param);
void HandleSetEnvlp(char *param,double dvalue);
void HandleGetKmap(char *param);
void HandleSetKmap(char *param,double dvalue);
void SelectBank(char *data);
void HandleTell(char *param,int strType);
/* create.c */
void CreateBankObj(char *param,char *data);
void CreateInstObj(char *param,char *data);
void CreateSndObj(char *param,char *data);
void CreateKmapObj(char *param,char *data);
void CreateEnvlpObj(char *param,char *data);
void CreateWavetblObj(char *param,char *data);
void DeleteObject(char *name);
int SndOffsetCompare(u32 *one, u32 *two);
/* loadrom.c */
void loadrom(void);
/* syscomm.c */
void AckPresent(char *param);
void ReplyValue(char *param,u32 value);
void ReplyString(char *param,char *ptr);
void SendClassList(int class, char *param);
void SendSoundList(char *param);
void SendInstList(char *param);
/* giocomm.c */
void WriteBlock(u32 destOffset,char *data,u32 size);
void SetValue(u32 offset,int type,u32 value);
u32 GetValue(u32 offset,int type);
void WriteRamRom(u32 destAddr,char *data,u32 size);
u32 WriteMirror(void);
void SendSetBank(u32 bankOffset);
/* symbol.c */
void ReadFiles(char *fileName);
void ReadBankFile(char *name);
void ReadSamplesFile(char *name);
char *ReadSymFile(char *name,int *fileLen);
void WriteSymFile(char *fileName,char *extn);
char *BuildClassList(int class);
char *BuildInstList(char *name);
char *BuildSoundList(char *name);
char *GetStrFromOffset(u32 offset);
ALSymObj *SymObjFromOffset(u32 offset);
void DecRefCtFromOffset(u32 offset);
void CopySymObj(u32 *dst, u32 *src);
void CopyFileObj(u32 *dst, u32 *src);
void GrowNameBuffer(void);
u32 AddName(char *str);
int CheckMemory(int mirrorSize,int numNewObj, int sampleSize);
int RebuildTables(int *expObj);
u32 CopyObjMirror(u8 *srcPtr,u8 *dstPtr, int class, int expansion);
int CleanMemory(int object,int expansion);
void CompactMemory(void);
/*utilrout.c */
int CheckString(char **requestStr, array32 *list, int maxStr);
char *parsename(char *name,char *nameStr);
int GetNumber(char **hdl);
char *listcat(char *lptr,char *nptr);
void FakeProgChnge(int inst);
/* wavefile.c */
int ReadAIFCFile(char *fname,ALWaveTable *wvTblPtr);
/* hash.c */
int AllocNameHash(int numObjs);
int HashName(char *str);
int AddHashName(char *str, ALSymObj *obj);
ALSymObj *MatchHashName(char *name);
int NameHashSize(int numObjs);
int AllocNumHash(int numObj);
void DeallocNumHash(void);
int AddNumHash(u32 oldoffset, u32 newoffset);
u32 MatchNumHash(u32 oldOffset);
int NumHashSize(int numObjs);
/* save.c */
void SaveBanks(char *fileName);