1 |
bearsoft |
1.1 |
/*==========================================================================;
|
2 |
|
|
//
|
3 |
|
|
// dls1.h
|
4 |
|
|
//
|
5 |
|
|
//
|
6 |
|
|
// Description:
|
7 |
|
|
//
|
8 |
|
|
// Interface defines and structures for the Instrument Collection Form
|
9 |
|
|
// RIFF DLS.
|
10 |
|
|
//
|
11 |
|
|
//
|
12 |
|
|
// Written by Sonic Foundry 1996. Released for public use.
|
13 |
|
|
//
|
14 |
|
|
//=========================================================================*/
|
15 |
|
|
|
16 |
|
|
#ifndef _INC_DLS1
|
17 |
|
|
#define _INC_DLS1
|
18 |
|
|
|
19 |
|
|
/*//////////////////////////////////////////////////////////////////////////
|
20 |
|
|
//
|
21 |
|
|
//
|
22 |
|
|
// Layout of an instrument collection:
|
23 |
|
|
//
|
24 |
|
|
//
|
25 |
|
|
// RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
|
26 |
|
|
//
|
27 |
|
|
// INSTLIST
|
28 |
|
|
// LIST [] 'lins'
|
29 |
|
|
// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
|
30 |
|
|
// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
|
31 |
|
|
// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
|
32 |
|
|
//
|
33 |
|
|
// RGNLIST
|
34 |
|
|
// LIST [] 'lrgn'
|
35 |
|
|
// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
|
36 |
|
|
// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
|
37 |
|
|
// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
|
38 |
|
|
//
|
39 |
|
|
// ARTLIST
|
40 |
|
|
// LIST [] 'lart'
|
41 |
|
|
// 'art1' level 1 Articulation connection graph
|
42 |
|
|
// 'art2' level 2 Articulation connection graph
|
43 |
|
|
// '3rd1' Possible 3rd party articulation structure 1
|
44 |
|
|
// '3rd2' Possible 3rd party articulation structure 2 .... and so on
|
45 |
|
|
//
|
46 |
|
|
// WAVEPOOL
|
47 |
|
|
// ptbl [] [pool table]
|
48 |
|
|
// LIST [] 'wvpl'
|
49 |
|
|
// [path],
|
50 |
|
|
// [path],
|
51 |
|
|
// LIST [] 'wave' [dlid,RIFFWAVE]
|
52 |
|
|
// LIST [] 'wave' [dlid,RIFFWAVE]
|
53 |
|
|
// LIST [] 'wave' [dlid,RIFFWAVE]
|
54 |
|
|
// LIST [] 'wave' [dlid,RIFFWAVE]
|
55 |
|
|
// LIST [] 'wave' [dlid,RIFFWAVE]
|
56 |
|
|
//
|
57 |
|
|
// INFOLIST
|
58 |
|
|
// LIST [] 'INFO'
|
59 |
|
|
// 'icmt' 'One of those crazy comments.'
|
60 |
|
|
// 'icop' 'Copyright (C) 1996 Sonic Foundry'
|
61 |
|
|
//
|
62 |
|
|
/////////////////////////////////////////////////////////////////////////*/
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
/*/////////////////////////////////////////////////////////////////////////
|
66 |
|
|
// FOURCC's used in the DLS file
|
67 |
|
|
/////////////////////////////////////////////////////////////////////////*/
|
68 |
|
|
|
69 |
|
|
#define FOURCC_DLS mmioFOURCC('D','L','S',' ')
|
70 |
|
|
#define FOURCC_DLID mmioFOURCC('d','l','i','d')
|
71 |
|
|
#define FOURCC_COLH mmioFOURCC('c','o','l','h')
|
72 |
|
|
#define FOURCC_WVPL mmioFOURCC('w','v','p','l')
|
73 |
|
|
#define FOURCC_PTBL mmioFOURCC('p','t','b','l')
|
74 |
|
|
#define FOURCC_PATH mmioFOURCC('p','a','t','h')
|
75 |
|
|
#define FOURCC_wave mmioFOURCC('w','a','v','e')
|
76 |
|
|
#define FOURCC_LINS mmioFOURCC('l','i','n','s')
|
77 |
|
|
#define FOURCC_INS mmioFOURCC('i','n','s',' ')
|
78 |
|
|
#define FOURCC_INSH mmioFOURCC('i','n','s','h')
|
79 |
|
|
#define FOURCC_LRGN mmioFOURCC('l','r','g','n')
|
80 |
|
|
#define FOURCC_RGN mmioFOURCC('r','g','n',' ')
|
81 |
|
|
#define FOURCC_RGNH mmioFOURCC('r','g','n','h')
|
82 |
|
|
#define FOURCC_LART mmioFOURCC('l','a','r','t')
|
83 |
|
|
#define FOURCC_ART1 mmioFOURCC('a','r','t','1')
|
84 |
|
|
#define FOURCC_WLNK mmioFOURCC('w','l','n','k')
|
85 |
|
|
#define FOURCC_WSMP mmioFOURCC('w','s','m','p')
|
86 |
|
|
#define FOURCC_VERS mmioFOURCC('v','e','r','s')
|
87 |
|
|
|
88 |
|
|
/*/////////////////////////////////////////////////////////////////////////
|
89 |
|
|
// Articulation connection graph definitions
|
90 |
|
|
/////////////////////////////////////////////////////////////////////////*/
|
91 |
|
|
|
92 |
|
|
/* Generic Sources */
|
93 |
|
|
#define CONN_SRC_NONE 0x0000
|
94 |
|
|
#define CONN_SRC_LFO 0x0001
|
95 |
|
|
#define CONN_SRC_KEYONVELOCITY 0x0002
|
96 |
|
|
#define CONN_SRC_KEYNUMBER 0x0003
|
97 |
|
|
#define CONN_SRC_EG1 0x0004
|
98 |
|
|
#define CONN_SRC_EG2 0x0005
|
99 |
|
|
#define CONN_SRC_PITCHWHEEL 0x0006
|
100 |
|
|
|
101 |
|
|
/* Midi Controllers 0-127 */
|
102 |
|
|
#define CONN_SRC_CC1 0x0081
|
103 |
|
|
#define CONN_SRC_CC7 0x0087
|
104 |
|
|
#define CONN_SRC_CC10 0x008a
|
105 |
|
|
#define CONN_SRC_CC11 0x008b
|
106 |
|
|
|
107 |
|
|
/* Generic Destinations */
|
108 |
|
|
#define CONN_DST_NONE 0x0000
|
109 |
|
|
#define CONN_DST_ATTENUATION 0x0001
|
110 |
|
|
#define CONN_DST_PITCH 0x0003
|
111 |
|
|
#define CONN_DST_PAN 0x0004
|
112 |
|
|
|
113 |
|
|
/* LFO Destinations */
|
114 |
|
|
#define CONN_DST_LFO_FREQUENCY 0x0104
|
115 |
|
|
#define CONN_DST_LFO_STARTDELAY 0x0105
|
116 |
|
|
|
117 |
|
|
/* EG1 Destinations */
|
118 |
|
|
#define CONN_DST_EG1_ATTACKTIME 0x0206
|
119 |
|
|
#define CONN_DST_EG1_DECAYTIME 0x0207
|
120 |
|
|
#define CONN_DST_EG1_RELEASETIME 0x0209
|
121 |
|
|
#define CONN_DST_EG1_SUSTAINLEVEL 0x020a
|
122 |
|
|
|
123 |
|
|
/* EG2 Destinations */
|
124 |
|
|
#define CONN_DST_EG2_ATTACKTIME 0x030a
|
125 |
|
|
#define CONN_DST_EG2_DECAYTIME 0x030b
|
126 |
|
|
#define CONN_DST_EG2_RELEASETIME 0x030d
|
127 |
|
|
#define CONN_DST_EG2_SUSTAINLEVEL 0x030e
|
128 |
|
|
|
129 |
|
|
#define CONN_TRN_NONE 0x0000
|
130 |
|
|
#define CONN_TRN_CONCAVE 0x0001
|
131 |
|
|
|
132 |
|
|
typedef struct _DLSID {
|
133 |
|
|
ULONG ulData1;
|
134 |
|
|
USHORT usData2;
|
135 |
|
|
USHORT usData3;
|
136 |
|
|
BYTE abData4[8];
|
137 |
|
|
} DLSID, FAR *LPDLSID;
|
138 |
|
|
|
139 |
|
|
typedef struct _DLSVERSION {
|
140 |
|
|
DWORD dwVersionMS;
|
141 |
|
|
DWORD dwVersionLS;
|
142 |
|
|
}DLSVERSION, FAR *LPDLSVERSION;
|
143 |
|
|
|
144 |
|
|
|
145 |
|
|
typedef struct _CONNECTION {
|
146 |
|
|
USHORT usSource;
|
147 |
|
|
USHORT usControl;
|
148 |
|
|
USHORT usDestination;
|
149 |
|
|
USHORT usTransform;
|
150 |
|
|
LONG lScale;
|
151 |
|
|
}CONNECTION, FAR *LPCONNECTION;
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
/* Level 1 Articulation Data */
|
155 |
|
|
|
156 |
|
|
typedef struct _CONNECTIONLIST {
|
157 |
|
|
ULONG cbSize; /* size of the connection list structure */
|
158 |
|
|
ULONG cConnections; /* count of connections in the list */
|
159 |
|
|
} CONNECTIONLIST, FAR *LPCONNECTIONLIST;
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
/*/////////////////////////////////////////////////////////////////////////
|
164 |
|
|
// Generic type defines for regions and instruments
|
165 |
|
|
/////////////////////////////////////////////////////////////////////////*/
|
166 |
|
|
|
167 |
|
|
typedef struct _RGNRANGE {
|
168 |
|
|
USHORT usLow;
|
169 |
|
|
USHORT usHigh;
|
170 |
|
|
}RGNRANGE, FAR * LPRGNRANGE;
|
171 |
|
|
|
172 |
|
|
#define F_INSTRUMENT_DRUMS 0x80000000
|
173 |
|
|
|
174 |
|
|
typedef struct _MIDILOCALE {
|
175 |
|
|
ULONG ulBank;
|
176 |
|
|
ULONG ulInstrument;
|
177 |
|
|
}MIDILOCALE, FAR *LPMIDILOCALE;
|
178 |
|
|
|
179 |
|
|
/*/////////////////////////////////////////////////////////////////////////
|
180 |
|
|
// Header structures found in an DLS file for collection, instruments, and
|
181 |
|
|
// regions.
|
182 |
|
|
/////////////////////////////////////////////////////////////////////////*/
|
183 |
|
|
|
184 |
|
|
#define F_RGN_OPTION_SELFNONEXCLUSIVE 0x0001
|
185 |
|
|
|
186 |
|
|
typedef struct _RGNHEADER {
|
187 |
|
|
RGNRANGE RangeKey; /* Key range */
|
188 |
|
|
RGNRANGE RangeVelocity; /* Velocity Range */
|
189 |
|
|
USHORT fusOptions; /* Synthesis options for this range */
|
190 |
|
|
USHORT usKeyGroup; /* Key grouping for non simultaneous play */
|
191 |
|
|
/* 0 = no group, 1 up is group */
|
192 |
|
|
/* for Level 1 only groups 1-15 are allowed */
|
193 |
|
|
}RGNHEADER, FAR *LPRGNHEADER;
|
194 |
|
|
|
195 |
|
|
typedef struct _INSTHEADER {
|
196 |
|
|
ULONG cRegions; /* Count of regions in this instrument */
|
197 |
|
|
MIDILOCALE Locale; /* Intended MIDI locale of this instrument */
|
198 |
|
|
}INSTHEADER, FAR *LPINSTHEADER;
|
199 |
|
|
|
200 |
|
|
typedef struct _DLSHEADER {
|
201 |
|
|
ULONG cInstruments; /* Count of instruments in the collection */
|
202 |
|
|
}DLSHEADER, FAR *LPDLSHEADER;
|
203 |
|
|
|
204 |
|
|
/*////////////////////////////////////////////////////////////////////////////
|
205 |
|
|
// definitions for the Wave link structure
|
206 |
|
|
////////////////////////////////////////////////////////////////////////////*/
|
207 |
|
|
|
208 |
|
|
/* **** For level 1 only WAVELINK_CHANNEL_MONO is valid **** */
|
209 |
|
|
/* ulChannel allows for up to 32 channels of audio with each bit position */
|
210 |
|
|
/* specifiying a channel of playback */
|
211 |
|
|
|
212 |
|
|
#define WAVELINK_CHANNEL_LEFT 0x0001l
|
213 |
|
|
#define WAVELINK_CHANNEL_RIGHT 0x0002l
|
214 |
|
|
|
215 |
|
|
#define F_WAVELINK_PHASE_MASTER 0x0001
|
216 |
|
|
|
217 |
|
|
typedef struct _WAVELINK { /* any paths or links are stored right after struct */
|
218 |
|
|
USHORT fusOptions; /* options flags for this wave */
|
219 |
|
|
USHORT usPhaseGroup; /* Phase grouping for locking channels */
|
220 |
|
|
ULONG ulChannel; /* channel placement */
|
221 |
|
|
ULONG ulTableIndex; /* index into the wave pool table, 0 based */
|
222 |
|
|
}WAVELINK, FAR *LPWAVELINK;
|
223 |
|
|
|
224 |
|
|
#define POOL_CUE_NULL 0xffffffffl
|
225 |
|
|
|
226 |
|
|
typedef struct _POOLCUE {
|
227 |
|
|
ULONG ulOffset; /* Offset to the entry in the list */
|
228 |
|
|
}POOLCUE, FAR *LPPOOLCUE;
|
229 |
|
|
|
230 |
|
|
typedef struct _POOLTABLE {
|
231 |
|
|
ULONG cbSize; /* size of the pool table structure */
|
232 |
|
|
ULONG cCues; /* count of cues in the list */
|
233 |
|
|
} POOLTABLE, FAR *LPPOOLTABLE;
|
234 |
|
|
|
235 |
|
|
/*////////////////////////////////////////////////////////////////////////////
|
236 |
|
|
// Structures for the "wsmp" chunk
|
237 |
|
|
////////////////////////////////////////////////////////////////////////////*/
|
238 |
|
|
|
239 |
|
|
#define F_WSMP_NO_TRUNCATION 0x0001l
|
240 |
|
|
#define F_WSMP_NO_COMPRESSION 0x0002l
|
241 |
|
|
|
242 |
|
|
|
243 |
|
|
typedef struct _rwsmp {
|
244 |
|
|
ULONG cbSize;
|
245 |
|
|
USHORT usUnityNote; /* MIDI Unity Playback Note */
|
246 |
|
|
SHORT sFineTune; /* Fine Tune in log tuning */
|
247 |
|
|
LONG lAttenuation; /* Overall Attenuation to be applied to data */
|
248 |
|
|
ULONG fulOptions; /* Flag options */
|
249 |
|
|
ULONG cSampleLoops; /* Count of Sample loops, 0 loops is one shot */
|
250 |
|
|
} WSMPL, FAR *LPWSMPL;
|
251 |
|
|
|
252 |
|
|
|
253 |
|
|
/* This loop type is a normal forward playing loop which is continually */
|
254 |
|
|
/* played until the envelope reaches an off threshold in the release */
|
255 |
|
|
/* portion of the volume envelope */
|
256 |
|
|
|
257 |
|
|
#define WLOOP_TYPE_FORWARD 0
|
258 |
|
|
|
259 |
|
|
typedef struct _rloop {
|
260 |
|
|
ULONG cbSize;
|
261 |
|
|
ULONG ulType; /* Loop Type */
|
262 |
|
|
ULONG ulStart; /* Start of loop in samples */
|
263 |
|
|
ULONG ulLength; /* Length of loop in samples */
|
264 |
|
|
} WLOOP, FAR *LPWLOOP;
|
265 |
|
|
|
266 |
|
|
#endif /*_INC_DLS1 */
|
267 |
|
|
|