Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

268 lines
8.9 KiB

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