InstrumentFile.h
12.2 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
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
/*============================================================================
InstrumentFile
Copyright C 1992 Digidesign Inc.
All rights reserved
CONFIDENTIAL: This document contains confidential information.
Do not disclose any information contained in this documet to any
third-party without the prior written consent of Digidesign Inc.
Format and interface definition for SampleCell Instrument files.
NOTE: Structures that start with 'SP' are old structures used
for version 1.x of the SampleCell Editor. Structures that start
with 'SCell' are for version 2.x of the SampleCell Editor.
============================================================================*/
#ifndef __InstrumentFile__
#define __InstrumentFile__
#include "type.h"
#include "SampleCellInterface.h"
const OSType kSCellInstrumentFileType = 'SCin';
const OSType kSCellStereoInstrumentFileType = 'SCsi';
const OSType kSCellSoundFileType = 'SCsd';
const OSType kSCellStereoSoundFileType = 'SCss';
const short kChannelDocumentRsrcID = 1000; // rsrc IDs for inst & sound files
// SampleCell instrument file chunk id's for the new file format
const OSType kSCellGeneralID = 'GenP';
const OSType kSCellEnvelopeID = 'EnvP';
const OSType kSCellLFOID = 'LFOP';
const OSType kSCellRampID = 'Ramp';
const OSType kSCellTrackerID = 'TrkP';
const OSType kSCellModulationPathID = 'ModP';
const OSType kSCellKeyGroupParametersID = 'KeyP';
const OSType kSCellKeyGroupSamplesID = 'KeyS';
const OSType kSCellNewInstrumentFileType = 'Monk';
// size of parameters written out with each sample
const long kSampleParametersSize = 64;
/*============================================================================
Record definitions that match one to one with the Sample Players
format. This is so that we can load up and send a complete
instrument/sound to the card as fast as possible. All parameters
required by the program that are not used directly by the card are
stored in other records defined below.
===========================================================================*/
typedef struct {
//Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short InstrumentSoundFlag; // 0-1:0=instrument,1=sound
short MIDIChannel; // 0-16:0=OMNI, 1-16=Channel
short MIDILowNoteLimit; // 0-127:low MIDI note that voice responds to
short MIDIHiNoteLimit; // 0-127:hi MIDI note that voice responds to
short PitchOctave; // -4-+3:unit=octave
short PitchSemitone; // -12-+12:unit=semitone
short DetuneAmount; // -99-+99:???
short DetuneMode; // 0-1:0=norm, 1=equal
short KeyTrack; // 0-1:0=OFF, 1=ON
short KeyAssignMode; // 0-1:0=norm, 1=mono
short SoundPriorityLevel; // 0-9:0=lowest, 9=highest
short OverlapAmount; // 0-99:0=none, 99=max overlap
short CrossFade; // 0-1:0=no xfade, 1=xfade
short Send1BusSelect; // 0-7:0=output 1,7=output8
short Send1PrePostFader; // 0-1:0=pre fader ie direct, 1=post fader
short Send1Volume; // 0-99:0=OFF, 99=full level ~.5dB per value
short Send2BusSelect; // 0-7:0=output 1,7=output8
short Send2PrePostFader; // 0-1:0=pre fader ie direct, 1=post fader
short Send2Volume; // 0-99:0=OFF, 99=full level ~.5dB per value
short Panning; // -99/+99: -99=left, +99=right, 0=center
short LeftPanBusSelect; // 0-7:0=output 1,7=output8
short RightPanBusSelect; // 0-7:0=output 1,7=output8
short Mute; // 0-1:0=OFF,1=ON
short Volume; // 0-99:0=OFF, 99=full level ~.5dB per value
short MIDIControllerANum; // 0-121: MIDI controller assigned to cont A
short MIDIControllerBNum; // 0-121: MIDI controller assigned to cont B
short PitchByPitchWheel; // -12-+12: +12=+1 octave
short VolumeByVelocity; // -99-+99: ?????
short DisableMIDIVolume; // 0-1:0=Enabled/1=Disabled
short UnUsed39; // for future use
} SPGenParmsRec;
typedef struct
{
//Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
// (I) indicates a SCell I only param, (II) an SCell II only param
short InstrumentSoundFlag; // 0-1:0=instrument,1=sound
short MIDIChannel; // 0-16:0=OMNI, 1-16= MIDI channel
short MIDILowNoteLimit; // 0-127:low MIDI note that voice responds to
short MIDIHiNoteLimit; // 0-127:hi MIDI note that voice responds to
short PitchOctave; // -4-+3:unit=octave
short PitchSemitone; // -12-+12:unit=semitone
short DetuneAmount; // -99-+99:???
short DetuneMode; // 0-1:0=norm, 1=equal
short KeyTrack; // 0-1:0=OFF, 1=ON
short KeyAssignMode; // 0-1:0=norm, 1=mono
short SoundPriorityLevel; // 0-9:0=lowest, 9=highest
short OverlapAmount; // 0-99:0=none, 99=max overlap
short CrossFade; // 0-1:0=no xfade, 1=xfade
short Send1BusSelect; // (I) 0-7:0=output 1,7=output8
short Send1PrePostFader; // (I) 0-1:0=pre fader ie direct, 1=post fader
short Send1Volume; // (I) 0-99:0=OFF, 99=full level ~.5dB per value
short Send2BusSelect; // (I) 0-7:0=output 1,7=output8
short Send2PrePostFader; // (I) 0-1:0=pre fader ie direct, 1=post fader
short Send2Volume; // (I) 0-99:0=OFF, 99=full level ~.5dB per value
short Panning; // -99/+99: -99=left, +99=right, 0=center
short LeftPanBusSelect; // (I) 0-7:0=output 1,7=output8
// Also - PanBusSelect (II) 0-3:0 = output
// 1&2...3 = output 7&8
short RightPanBusSelect; // (I) 0-7:0=output 1,7=output8
short Mute; // 0-1:0=OFF,1=ON
short Volume; // 0-99:0=OFF, 99=full level ~.5dB per value
short MIDIControllerANum; // 0-121: MIDI controller assigned to cont A
short MIDIControllerBNum; // 0-121: MIDI controller assigned to cont B
short PitchByPitchWheel; // -12-+12: +12=+1 octave
short VolumeByVelocity; // -99-+99: ?????
short DisableMIDIVolume; // 0-1:0=Enabled/1=Disabled
short InitialFilterFreq; // (II) 0-240: initial low pass filter freq
} SCellGeneralParametersRec;
//=============================================================================
typedef struct
{
short SampVolume; // 0-99:0=-50dB,99=0dB
short SampNumber; // 0-1000: which DRAM sample to use:
// 0=no samp, 1=sine
short SampDirection; // 0-1: 0=fowards,1=backwards
short SampStart; // 0-127: 0=no offset
short SampBaseNote; // 0-127: MIDI note where sample plays
// at orig pitch
} SPVelocityZoneRec;
typedef struct
{
//Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short HighNoteLimit; // 0-128: 128=key group not used
// 0-15:mod level where med/loug sample starts
short Thresholds[kSCellINumVelocityZones - 1];
SPVelocityZoneRec VelocityZones[kSCellINumVelocityZones];
short Panning; // -99-+99: -99=left, +99=right, 0=center
} SPKeyGroupRec;
//=============================================================================
typedef struct
{
short Threshold; // 0-15:mod level where med/loug sample starts
short SampVolume; // 0-99:0=-50dB,99=0dB
short SampDirection; // 0-1: 0=fowards,1=backwards
short SampStart; // 0-127: 0=no offset
short SampBaseNote; // 0-127: MIDI note where sample plays at orig pitch
} SCellVelocityZoneRec;
typedef struct
{
short HighNoteLimit; // 0-128: 128=key group not used
short Panning; // -99-+99: -99=left, +99=right, 0=center
SCellVelocityZoneRec VelocityZones[kSCellIINumVelocityZones];
} SCellKeyGroupRec;
//=============================================================================
typedef struct
{
//Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short Attack; // 0/99: 0=fastest, 99=slowest
short Decay; // 0/99: 0=fastest, 99=slowest
short SustainLevel; // 0/99: 0=lowest, 99=highest
short SustainDecay; // 0/99: 0=fastest, 99=slowest
short Release; // 0/99: 0=fastest, 99=slowest
short GateTime; // 0/99: 0=fastest, 99=slowest
short TimeTrack; // 0/1: 0=OFF, 99=ON
short Amplitude; // 0/99: 0=lowest, 99=highest
} SPEnvelopeRec;
typedef SPEnvelopeRec SCellEnvelopeRec;
//=============================================================================
typedef struct
{
// Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short Speed; // 0/99: 0=slowest, 99=fastest
short Amplitude; // 0/99: 0=lowest, 99=highest
short Trigger; // 0/3: 0=off,1=sync,2=trig,3=both
short WaveShape; // 0/6:0=sine,tri,usw,dsw,sq,rnd,noise=6
} SPLFORec;
typedef SPLFORec SCellLFORec;
//=============================================================================
typedef struct
{
// Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short RampTime; // 0/99: 0=fastest
} SPRampGeneratorRec;
typedef SPRampGeneratorRec SCellRampGeneratorRec;
//=============================================================================
typedef struct
{
// Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short Input; // 0/16: the mod source input to track generator
short TrackPoints[kSCellINumTrackPoints]; // 0/99
}
SPTrackGeneratorRec;
typedef struct
{
// Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short Input; // 0/16: the mod source input to track generator
short TrackPoints[kSCellIINumTrackPoints]; // 0/99
} SCellTrackGeneratorRec;
//=============================================================================
typedef struct
{
// Actual Sample Player parameters: DO NOT CHANGE POSITION OR ORDER
short Gate; // 0/1: 0=OFF,1=ON
short Source; // 0/16
short Destination; // 0/25
short Amplitude; // -99/+99
}
SPModPathRec;
typedef SPModPathRec SCellModPathRec;
//=============================================================================
// Record definitions for information that the application requires but that is
// not directly used by the Sample Player.
// digi's internal way of doing FSSpec stuff before FSSpec existed
typedef struct
{
Str31 FileName;
Str27 VolumeName;
short VolRefNum;
long DirID;
OSType FileType;
} FindFileRec;
typedef struct
{
FindFileRec FindFileInfo; // file pointer to the SampleFile
short Channel; // which channel from the file should we load
long SampleStart; // sample number to start loading from in file
short SampleFineTune; // 0/126: 63=0 fine tune sample rate for this sample
short Loop1Enable; // 0/1: 0=disable loop, 1=enable
short Loop1FineTune; // 0/126: 63=0 fine tune for loop1 speed
short Loop2Enable; // 0/1: 0=disable loop, 1=enable
short Loop2FineTune; // 0/126: 63=0 fine tune for loop1 speed
}
SPVelocityZoneFileRec;
/* RECORD of an ARRAY as opposed to a two dimensional array as an object
field is so the structure mirrors the SPKeyGroupRec structure and in
addition it allows key groups to be moved using block move. */
typedef struct
{
SPVelocityZoneFileRec VelocityZoneFiles[kSCellINumVelocityZones];
}
SPKeyGroupFileRec;
//==============================================================================
typedef struct
{
short NumKeyGroups; // 1/20
long TotalSampleBytes; // 0..?
}
ChannelInfoRec;
typedef struct
{
long fileIndex; // 0 based index into files dictionary (ie FILP or FILA)
long regionID; // id from SDII file if this came from one, otherwise -1
short audioChannel; // channel this region refers to ie 1 = left, 2 = right??
long startFrame; // first sample frame in the region
long stopFrame; // frame after the last frame in the region
Str31 sampleName; // name of the region/sample
long sampleStart; // where to start playback relative to start of region
short sampleFineTune; // sample fine tune
short loop1Enabled; // 1 = enabled, 0 = not enabled
short loop1FineTune; // loop fine tune
short loop2Enabled; // 1 = enabled, 0 = not enabled
short loop2FineTune; // loop fine tune
} SCellSampleRec;
#endif