forked from osoumen/C700
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC700defines.h
283 lines (249 loc) · 8.26 KB
/
C700defines.h
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/*
* C700defines.h
* C700
*
* Created by osoumen on 06/10/12.
* Copyright 2006 ppse All rights reserved.
*
*/
#pragma once
// parameters
enum {
kParam_poly=0,
kParam_mainvol_L,
kParam_mainvol_R,
kParam_vibdepth,
kParam_vibrate,
kParam_vibdepth2,
kParam_velocity,
kParam_bendrange,
kParam_program,
kParam_newadpcm,
kParam_bankAmulti,
kParam_program_2,
kParam_program_3,
kParam_program_4,
kParam_program_5,
kParam_program_6,
kParam_program_7,
kParam_program_8,
kParam_program_9,
kParam_program_10,
kParam_program_11,
kParam_program_12,
kParam_program_13,
kParam_program_14,
kParam_program_15,
kParam_program_16,
kParam_vibdepth_2,
kParam_vibdepth_3,
kParam_vibdepth_4,
kParam_vibdepth_5,
kParam_vibdepth_6,
kParam_vibdepth_7,
kParam_vibdepth_8,
kParam_vibdepth_9,
kParam_vibdepth_10,
kParam_vibdepth_11,
kParam_vibdepth_12,
kParam_vibdepth_13,
kParam_vibdepth_14,
kParam_vibdepth_15,
kParam_vibdepth_16,
//«ƒGƒR[•”
kParam_echovol_L,
kParam_echovol_R,
kParam_echoFB,
kParam_echodelay,
kParam_fir0,
kParam_fir1,
kParam_fir2,
kParam_fir3,
kParam_fir4,
kParam_fir5,
kParam_fir6,
kParam_fir7,
kParam_bankBmulti,
kParam_bankCmulti,
kParam_bankDmulti,
kParam_alwaysDelayNote,
kNumberOfParameters
};
// properties
enum
{
kAudioUnitCustomProperty_Begin = 64000,
kAudioUnitCustomProperty_ProgramName = kAudioUnitCustomProperty_Begin,
kAudioUnitCustomProperty_BRRData,
kAudioUnitCustomProperty_Rate,
kAudioUnitCustomProperty_BaseKey,
kAudioUnitCustomProperty_LowKey,
kAudioUnitCustomProperty_HighKey,
kAudioUnitCustomProperty_LoopPoint,
kAudioUnitCustomProperty_Loop,
kAudioUnitCustomProperty_AR,
kAudioUnitCustomProperty_DR,
kAudioUnitCustomProperty_SL,
kAudioUnitCustomProperty_SR,
kAudioUnitCustomProperty_VolL,
kAudioUnitCustomProperty_VolR,
kAudioUnitCustomProperty_Echo,
kAudioUnitCustomProperty_Bank,
kAudioUnitCustomProperty_EditingProgram,
kAudioUnitCustomProperty_EditingChannel,
//«ƒGƒR[•”
kAudioUnitCustomProperty_Band1,
kAudioUnitCustomProperty_Band2,
kAudioUnitCustomProperty_Band3,
kAudioUnitCustomProperty_Band4,
kAudioUnitCustomProperty_Band5,
kAudioUnitCustomProperty_TotalRAM, // read only
kAudioUnitCustomProperty_PGDictionary,
kAudioUnitCustomProperty_XIData, // read only
kAudioUnitCustomProperty_NoteOnTrack_1, // read only
kAudioUnitCustomProperty_NoteOnTrack_2, // read only
kAudioUnitCustomProperty_NoteOnTrack_3, // read only
kAudioUnitCustomProperty_NoteOnTrack_4, // read only
kAudioUnitCustomProperty_NoteOnTrack_5, // read only
kAudioUnitCustomProperty_NoteOnTrack_6, // read only
kAudioUnitCustomProperty_NoteOnTrack_7, // read only
kAudioUnitCustomProperty_NoteOnTrack_8, // read only
kAudioUnitCustomProperty_NoteOnTrack_9, // read only
kAudioUnitCustomProperty_NoteOnTrack_10, // read only
kAudioUnitCustomProperty_NoteOnTrack_11, // read only
kAudioUnitCustomProperty_NoteOnTrack_12, // read only
kAudioUnitCustomProperty_NoteOnTrack_13, // read only
kAudioUnitCustomProperty_NoteOnTrack_14, // read only
kAudioUnitCustomProperty_NoteOnTrack_15, // read only
kAudioUnitCustomProperty_NoteOnTrack_16, // read only
kAudioUnitCustomProperty_MaxNoteTrack_1, // read only
kAudioUnitCustomProperty_MaxNoteTrack_2, // read only
kAudioUnitCustomProperty_MaxNoteTrack_3, // read only
kAudioUnitCustomProperty_MaxNoteTrack_4, // read only
kAudioUnitCustomProperty_MaxNoteTrack_5, // read only
kAudioUnitCustomProperty_MaxNoteTrack_6, // read only
kAudioUnitCustomProperty_MaxNoteTrack_7, // read only
kAudioUnitCustomProperty_MaxNoteTrack_8, // read only
kAudioUnitCustomProperty_MaxNoteTrack_9, // read only
kAudioUnitCustomProperty_MaxNoteTrack_10, // read only
kAudioUnitCustomProperty_MaxNoteTrack_11, // read only
kAudioUnitCustomProperty_MaxNoteTrack_12, // read only
kAudioUnitCustomProperty_MaxNoteTrack_13, // read only
kAudioUnitCustomProperty_MaxNoteTrack_14, // read only
kAudioUnitCustomProperty_MaxNoteTrack_15, // read only
kAudioUnitCustomProperty_MaxNoteTrack_16, // read only
kAudioUnitCustomProperty_SourceFileRef,
kAudioUnitCustomProperty_IsEmaphasized,
kAudioUnitCustomProperty_SustainMode,
kAudioUnitCustomProperty_MonoMode,
kAudioUnitCustomProperty_PortamentoOn,
kAudioUnitCustomProperty_PortamentoRate,
kAudioUnitCustomProperty_NoteOnPriority,
kAudioUnitCustomProperty_ReleasePriority,
kAudioUnitCustomProperty_End,
kNumberOfProperties = kAudioUnitCustomProperty_End-kAudioUnitCustomProperty_Begin
};
// control commands
enum
{
kControlCommandsFirst = 70000,
kControlBankDBtn = 70000,
kControlBankCBtn,
kControlBankBBtn,
kControlBankABtn,
kControlXMSNESText = 70004,
kControlButtonCopy = 70005,
kControlButtonPreemphasis = 70006,
kControlButtonUnload = 70007,
kControlButtonLoad = 70008,
kControlButtonSave = 70009,
kControlButtonSaveXI = 70010,
kControlButtonAutoSampleRate= 70011,
kControlButtonAutoKey = 70012,
kControlButtonChangeLoopPoint= 70013,
kControlButtonChangeProgram = 70014,
kControlSelectTrack16 = 70015,
kControlSelectTrack15,
kControlSelectTrack14,
kControlSelectTrack13,
kControlSelectTrack12,
kControlSelectTrack11,
kControlSelectTrack10,
kControlSelectTrack9,
kControlSelectTrack8,
kControlSelectTrack7,
kControlSelectTrack6,
kControlSelectTrack5,
kControlSelectTrack4,
kControlSelectTrack3,
kControlSelectTrack2,
kControlSelectTrack1,
kControlButtonKhaos
};
enum InstChangeFlag {
HAS_PGNAME = 1 << 0,
HAS_RATE = 1 << 1,
HAS_BASEKEY = 1 << 2,
HAS_LOWKEY = 1 << 3,
HAS_HIGHKEY = 1 << 4,
HAS_AR = 1 << 5,
HAS_DR = 1 << 6,
HAS_SL = 1 << 7,
HAS_SR = 1 << 8,
HAS_VOLL = 1 << 9,
HAS_VOLR = 1 << 10,
HAS_ECHO = 1 << 11,
HAS_BANK = 1 << 12,
HAS_ISEMPHASIZED = 1 << 13,
HAS_SOURCEFILE = 1 << 14,
HAS_SUSTAINMODE = 1 << 15,
HAS_MONOMODE = 1 << 16,
HAS_PORTAMENTOON = 1 << 17,
HAS_PORTAMENTORATE = 1 << 18,
HAS_NOTEONPRIORITY = 1 << 19,
HAS_RELEASEPRIORITY = 1 << 20
};
static const int kMaximumVoices = 16;
static const int NUM_BANKS = 4;
static const int NUM_PRESETS = 2;
static const int NUM_OUTPUTS = 2;
static const int PROGRAMNAME_MAX_LEN = 256;
static const int PATH_LEN_MAX = 1024;
static const int CKID_PROGRAM_TOTAL = 0x20000;
static const int CKID_PROGRAM_DATA = 0x30000;
static const int kDefaultValue_AR = 15;
static const int kDefaultValue_DR = 7;
static const int kDefaultValue_SL = 7;
static const int kDefaultValue_SR = 31;
static const bool kDefaultValue_SustainMode = true;
static const bool kDefaultValue_MonoMode = false;
static const bool kDefaultValue_PortamentoOn = false;
static const int kDefaultValue_PortamentoRate = 0;
static const int kDefaultValue_NoteOnPriority = 64;
static const int kDefaultValue_ReleasePriority = 0;
typedef struct {
int size;
unsigned char *data;
} BRRData;
typedef struct {
char pgname[PROGRAMNAME_MAX_LEN];
int ar,dr,sl,sr;
int volL,volR;
double rate;
int basekey,lowkey,highkey;
int lp;
bool loop;
bool echo;
int bank;
BRRData brr;
char sourceFile[PATH_LEN_MAX];
bool isEmphasized;
bool sustainMode;
bool monoMode;
bool portamentoOn;
int portamentoRate;
int noteOnPriority;
int releasePriority;
} InstParams;
float ConvertToVSTValue( float value, float min, float max );
float ConvertFromVSTValue( float value, float min, float max );