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.

1234 lines
29 KiB

  1. /*
  2. *
  3. */
  4. #ifndef _DMUSICF_
  5. #define _DMUSICF_
  6. #include <windows.h>
  7. #define COM_NO_WINDOWS_H
  8. #include <objbase.h>
  9. #include <mmsystem.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. interface IDirectMusicCollection;
  14. #ifndef __cplusplus
  15. typedef interface IDirectMusicCollection IDirectMusicCollection;
  16. #endif
  17. typedef struct _DMUS_COMMAND_PARAM
  18. {
  19. BYTE bCommand;
  20. BYTE bGrooveLevel;
  21. BYTE bGrooveRange;
  22. } DMUS_COMMAND_PARAM;
  23. /* The following structures are used by the Tracks, and are the packed structures */
  24. /* that are passed to the Tracks inside the IStream. */
  25. typedef struct _DMUS_IO_SEQ_ITEM
  26. {
  27. long lTime;
  28. long lDuration;
  29. BYTE bEventType;
  30. BYTE bStatus;
  31. BYTE bByte1;
  32. BYTE bByte2;
  33. BYTE bType;
  34. BYTE bPad[3];
  35. } DMUS_IO_SEQ_ITEM;
  36. typedef struct _DMUS_IO_TEMPO_ITEM
  37. {
  38. long lTime;
  39. double dblTempo;
  40. } DMUS_IO_TEMPO_ITEM;
  41. typedef struct _DMUS_IO_SYSEX_ITEM
  42. {
  43. long lTime;
  44. DWORD dwSysExLength;
  45. BYTE* pbSysExData;
  46. } DMUS_IO_SYSEX_ITEM;
  47. typedef struct _DMUS_IO_BANKSELECT_ITEM
  48. {
  49. BYTE byLSB;
  50. BYTE byMSB;
  51. BYTE byPad[2];
  52. } DMUS_IO_BANKSELECT_ITEM;
  53. typedef struct _DMUS_IO_PATCH_ITEM
  54. {
  55. long lTime;
  56. BYTE byStatus;
  57. BYTE byByte1;
  58. BYTE byByte2;
  59. BYTE byMSB;
  60. BYTE byLSB;
  61. BYTE byPad[3];
  62. DWORD dwFlags;
  63. IDirectMusicCollection* pIDMCollection;
  64. struct _DMUS_IO_PATCH_ITEM* pNext;
  65. } DMUS_IO_PATCH_ITEM;
  66. typedef struct _DMUS_IO_TIMESIGNATURE_ITEM
  67. {
  68. long lTime;
  69. BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */
  70. BYTE bBeat; /* what note receives the beat (bottom of time sig.) */
  71. /* we can assume that 0 means 256th note */
  72. WORD wGridsPerBeat; /* grids per beat */
  73. } DMUS_IO_TIMESIGNATURE_ITEM;
  74. typedef struct _DMUS_SUBCHORD
  75. {
  76. DWORD dwChordPattern; /* Notes in the subchord */
  77. DWORD dwScalePattern; /* Notes in the scale */
  78. DWORD dwInversionPoints; /* Where inversions can occur */
  79. DWORD dwLevels; /* Which levels are supported by this subchord */
  80. BYTE bChordRoot; /* Root of the subchord */
  81. BYTE bScaleRoot; /* Root of the scale */
  82. } DMUS_SUBCHORD;
  83. typedef struct _DMUS_CHORD_PARAM
  84. {
  85. WCHAR wszName[16]; /* Name of the chord */
  86. WORD wMeasure; /* Measure this falls on */
  87. BYTE bBeat; /* Beat this falls on */
  88. BYTE bSubChordCount; /* Number of chords in the list of subchords */
  89. DMUS_SUBCHORD SubChordList[DMUS_MAXSUBCHORD]; /* List of sub chords */
  90. } DMUS_CHORD_PARAM;
  91. typedef struct _DMUS_RHYTHM_PARAM
  92. {
  93. DMUS_TIMESIGNATURE TimeSig;
  94. DWORD dwRhythmPattern;
  95. } DMUS_RHYTHM_PARAM;
  96. typedef struct _DMUS_TEMPO_PARAM
  97. {
  98. MUSIC_TIME mtTime;
  99. double dblTempo;
  100. } DMUS_TEMPO_PARAM;
  101. typedef struct _DMUS_MUTE_PARAM
  102. {
  103. DWORD dwPChannel;
  104. DWORD dwPChannelMap;
  105. } DMUS_MUTE_PARAM;
  106. /* Style chunks */
  107. #define DMUS_FOURCC_STYLE_FORM mmioFOURCC('D','M','S','T')
  108. #define DMUS_FOURCC_STYLE_UNDO_FORM mmioFOURCC('s','t','u','n')
  109. #define DMUS_FOURCC_STYLE_CHUNK mmioFOURCC('s','t','y','h')
  110. #define DMUS_FOURCC_STYLE_UI_CHUNK mmioFOURCC('s','t','y','u')
  111. #define DMUS_FOURCC_GUID_CHUNK mmioFOURCC('g','u','i','d')
  112. #define DMUS_FOURCC_INFO_LIST mmioFOURCC('I','N','F','O')
  113. #define DMUS_FOURCC_CATEGORY_CHUNK mmioFOURCC('c','a','t','g')
  114. #define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s')
  115. #define DMUS_FOURCC_PART_LIST mmioFOURCC('p','a','r','t')
  116. #define DMUS_FOURCC_PART_CHUNK mmioFOURCC('p','r','t','h')
  117. #define DMUS_FOURCC_NOTE_CHUNK mmioFOURCC('n','o','t','e')
  118. #define DMUS_FOURCC_CURVE_CHUNK mmioFOURCC('c','r','v','e')
  119. #define DMUS_FOURCC_PATTERN_LIST mmioFOURCC('p','t','t','n')
  120. #define DMUS_FOURCC_PATTERN_CHUNK mmioFOURCC('p','t','n','h')
  121. #define DMUS_FOURCC_PATTERN_UI_CHUNK mmioFOURCC('p','t','n','u')
  122. #define DMUS_FOURCC_RHYTHM_CHUNK mmioFOURCC('r','h','t','m')
  123. #define DMUS_FOURCC_PARTREF_LIST mmioFOURCC('p','r','e','f')
  124. #define DMUS_FOURCC_PARTREF_CHUNK mmioFOURCC('p','r','f','c')
  125. #define DMUS_FOURCC_OLDGUID_CHUNK mmioFOURCC('j','o','g','c')
  126. #define DMUS_FOURCC_PATTERN_DESIGN mmioFOURCC('j','p','n','d')
  127. #define DMUS_FOURCC_PART_DESIGN mmioFOURCC('j','p','t','d')
  128. #define DMUS_FOURCC_PARTREF_DESIGN mmioFOURCC('j','p','f','d')
  129. #define DMUS_FOURCC_PIANOROLL_LIST mmioFOURCC('j','p','r','l')
  130. #define DMUS_FOURCC_PIANOROLL_CHUNK mmioFOURCC('j','p','r','c')
  131. #define DMUS_PLAYMODE_SCALE_ROOT 1
  132. #define DMUS_PLAYMODE_CHORD_ROOT 2
  133. #define DMUS_PLAYMODE_SCALE_INTERVALS 4
  134. #define DMUS_PLAYMODE_CHORD_INTERVALS 8
  135. #define DMUS_PLAYMODE_NONE 16
  136. #define DMUS_PLAYMODE_FIXED 0
  137. #define DMUS_PLAYMODE_FIXEDTOSCALE DMUS_PLAYMODE_SCALE_ROOT
  138. #define DMUS_PLAYMODE_FIXEDTOCHORD DMUS_PLAYMODE_CHORD_ROOT
  139. #define DMUS_PLAYMODE_PEDALPOINT (DMUS_PLAYMODE_SCALE_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS)
  140. #define DMUS_PLAYMODE_PURPLEIZED (DMUS_PLAYMODE_SCALE_INTERVALS | DMUS_PLAYMODE_CHORD_INTERVALS | \
  141. DMUS_PLAYMODE_CHORD_ROOT)
  142. #define DMUS_PLAYMODE_NORMALCHORD (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS)
  143. #pragma pack(2)
  144. typedef struct _DMUS_IO_TIMESIG
  145. {
  146. /* Time signatures define how many beats per measure, which note receives */
  147. /* the beat, and the grid resolution. */
  148. BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */
  149. BYTE bBeat; /* what note receives the beat (bottom of time sig.) */
  150. /* we can assume that 0 means 256th note */
  151. WORD wGridsPerBeat; /* grids per beat */
  152. } DMUS_IO_TIMESIG;
  153. typedef struct _DMUS_IO_STYLE
  154. {
  155. DMUS_IO_TIMESIG timeSig; /* Styles have a default Time Signature */
  156. double dblTempo;
  157. } DMUS_IO_STYLE;
  158. typedef struct _DMUS_IO_VERSION
  159. {
  160. DWORD dwVersionMS; /* Version # high-order 32 bits */
  161. DWORD dwVersionLS; /* Version # low-order 32 bits */
  162. } DMUS_IO_VERSION;
  163. typedef struct _DMUS_IO_PATTERN
  164. {
  165. DMUS_IO_TIMESIG timeSig; /* Patterns can override the Style's Time sig. */
  166. BYTE bGrooveBottom; /* bottom of groove range */
  167. BYTE bGrooveTop; /* top of groove range */
  168. WORD wEmbellishment; /* Fill, Break, Intro, End, Normal, Motif */
  169. WORD wNbrMeasures; /* length in measures */
  170. } DMUS_IO_PATTERN;
  171. typedef struct _DMUS_IO_STYLEPART
  172. {
  173. DMUS_IO_TIMESIG timeSig; /* can override pattern's */
  174. DWORD dwVariationChoices[32]; /* // MOAW choice bitfield */
  175. GUID guidPartID; /* identifies the part */
  176. WORD wNbrMeasures; /* length of the Part */
  177. BYTE bPlayModeFlags; /* see PLAYMODE flags */
  178. BYTE bInvertUpper; /* inversion upper limit */
  179. BYTE bInvertLower; /* inversion lower limit */
  180. } DMUS_IO_STYLEPART;
  181. typedef struct _DMUS_IO_PARTREF
  182. {
  183. GUID guidPartID; /* unique ID for matching up with parts */
  184. WORD wLogicalPartID; /* corresponds to port/device/midi channel */
  185. BYTE bVariationLockID; /* parts with the same ID lock variations. */
  186. /* high bit is used to identify master Part */
  187. BYTE bSubChordLevel; /* tells which sub chord level this part wants */
  188. BYTE bPriority; /* 256 priority levels. Parts with lower priority */
  189. /* aren't played first when a device runs out of */
  190. /* notes */
  191. BYTE bRandomVariation; /* when set, matching variations play in random order */
  192. /* when clear, matching variations play sequentially */
  193. } DMUS_IO_PARTREF;
  194. typedef struct _DMUS_IO_STYLENOTE
  195. {
  196. MUSIC_TIME mtGridStart; /* when this note occurs */
  197. DWORD dwVariation; /* variation bits */
  198. MUSIC_TIME mtDuration; /* how long this note lasts */
  199. short nTimeOffset; /* offset from mtGridStart */
  200. WORD wMusicValue; /* Position in scale. */
  201. BYTE bVelocity; /* Note velocity. */
  202. BYTE bTimeRange; /* Range to randomize start time. */
  203. BYTE bDurRange; /* Range to randomize duration. */
  204. BYTE bVelRange; /* Range to randomize velocity. */
  205. BYTE bInversionID; /* Identifies inversion group to which this note belongs */
  206. BYTE bPlayModeFlags; /* Can override part */
  207. } DMUS_IO_STYLENOTE;
  208. typedef struct _DMUS_IO_STYLECURVE
  209. {
  210. MUSIC_TIME mtGridStart; /* when this curve occurs */
  211. DWORD dwVariation; /* variation bits */
  212. MUSIC_TIME mtDuration; /* how long this curve lasts */
  213. MUSIC_TIME mtResetDuration; /* how long after the end of the curve to reset the curve */
  214. short nTimeOffset; /* offset from mtGridStart */
  215. short nStartValue; /* curve's start value */
  216. short nEndValue; /* curve's end value */
  217. short nResetValue; /* the value to which to reset the curve */
  218. BYTE bEventType; /* type of curve */
  219. BYTE bCurveShape; /* shape of curve */
  220. BYTE bCCData; /* CC# */
  221. BYTE bFlags; /* Bit 1=TRUE means to send nResetValue. Otherwise, don't.
  222. Other bits are reserved. */
  223. } DMUS_IO_STYLECURVE;
  224. #pragma pack()
  225. /*
  226. RIFF
  227. (
  228. 'STYL' // Style
  229. <styh-ck> // Style header chunk
  230. <guid-ck> // Every Style has a GUID
  231. [<INFO-list>] // Name, author, copyright info., comments
  232. [<vers-ck>] // version chunk
  233. <part-list> // List of parts in the Style, used by patterns
  234. <pttn-list> // List of patterns in the Style
  235. <band-list> // List of bands in the Style
  236. [<motf-list>] // List of motifs in the Style
  237. )
  238. // <styh-ck>
  239. styh
  240. (
  241. <DMUS_IO_STYLE>
  242. )
  243. // <guid-ck>
  244. guid
  245. (
  246. <GUID>
  247. )
  248. // <vers-ck>
  249. vers
  250. (
  251. <DMUS_IO_VERSION>
  252. )
  253. // <part-list>
  254. LIST
  255. (
  256. 'part'
  257. <prth-ck> // Part header chunk
  258. [<INFO-list>]
  259. [<note-ck>] // List of notes in Part
  260. [<crve-ck>] // List of curves in Part
  261. )
  262. // <orth-ck>
  263. prth
  264. (
  265. <DMUS_IO_STYLEPART>
  266. )
  267. // <note-ck>
  268. 'note'
  269. (
  270. // sizeof DMUS_IO_STYLENOTE:DWORD
  271. <DMUS_IO_STYLENOTE>...
  272. )
  273. // <crve-ck>
  274. 'crve'
  275. (
  276. // sizeof DMUS_IO_STYLECURVE:DWORD
  277. <DMUS_IO_STYLECURVE>...
  278. )
  279. // <pttn-list>
  280. LIST
  281. (
  282. 'pttn'
  283. <ptnh-ck> // Pattern header chunk
  284. <rhtm-ck> // List of rhythms for chord matching
  285. [<INFO-list>]
  286. <pref-list> // List of part reference id's
  287. )
  288. // <ptnh-ck>
  289. ptnh
  290. (
  291. <DMUS_IO_PATTERN>
  292. )
  293. // <rhtm-ck>
  294. 'rhtm'
  295. (
  296. // DWORD's representing rhythms for chord matching based on number
  297. // of measures in the pattern
  298. )
  299. // pref-list
  300. LIST
  301. (
  302. 'pref'
  303. <prfc-ck> // part ref chunk
  304. )
  305. // <prfc-ck>
  306. prfc
  307. (
  308. <DMUS_IO_PARTREF>
  309. )
  310. */
  311. /* Chord and command file formats */
  312. #define DMUS_FOURCC_CHORDTRACK_LIST mmioFOURCC('c','o','r','d')
  313. #define DMUS_FOURCC_CHORDTRACKHEADER_CHUNK mmioFOURCC('c','r','d','h')
  314. #define DMUS_FOURCC_CHORDTRACKBODY_CHUNK mmioFOURCC('c','r','d','b')
  315. #define DMUS_FOURCC_COMMANDTRACK_CHUNK mmioFOURCC('c','m','n','d')
  316. typedef struct _DMUS_IO_CHORD
  317. {
  318. WCHAR wszName[16]; /* Name of the chord */
  319. MUSIC_TIME mtTime; /* Time of this chord */
  320. WORD wMeasure; /* Measure this falls on */
  321. BYTE bBeat; /* Beat this falls on */
  322. } DMUS_IO_CHORD;
  323. typedef struct _DMUS_IO_SUBCHORD
  324. {
  325. DWORD dwChordPattern; /* Notes in the subchord */
  326. DWORD dwScalePattern; /* Notes in the scale */
  327. DWORD dwInversionPoints; /* Where inversions can occur */
  328. DWORD dwLevels; /* Which levels are supported by this subchord */
  329. BYTE bChordRoot; /* Root of the subchord */
  330. BYTE bScaleRoot; /* Root of the scale */
  331. } DMUS_IO_SUBCHORD;
  332. typedef struct _DMUS_IO_COMMAND
  333. {
  334. MUSIC_TIME mtTime; /* Time of this command */
  335. WORD wMeasure; /* Measure this falls on */
  336. BYTE bBeat; /* Beat this falls on */
  337. BYTE bCommand; /* Command type (see #defines below) */
  338. BYTE bGrooveLevel; /* Groove level (0 if command is not a groove) */
  339. BYTE bGrooveRange; /* Groove range */
  340. } DMUS_IO_COMMAND;
  341. /*
  342. // <chrd-list>
  343. LIST
  344. (
  345. 'chrd'
  346. <crdh-ck>
  347. <crdb-ck> // Chord body chunk
  348. )
  349. // <crdh-ck>
  350. crdh
  351. (
  352. // Scale: dword (upper 8 bits for root, lower 24 for scale)
  353. )
  354. // <crdb-ck>
  355. crdb
  356. (
  357. // sizeof DMUS_IO_CHORD:dword
  358. <DMUS_IO_CHORD>
  359. // # of DMUS_IO_SUBCHORDS:dword
  360. // sizeof DMUS_IO_SUBCHORDS:dword
  361. // a number of <DMUS_IO_SUBCHORD>
  362. )
  363. // <cmnd-list>
  364. 'cmnd'
  365. (
  366. //sizeof DMUS_IO_COMMAND: DWORD
  367. <DMUS_IO_COMMAND>...
  368. )
  369. */
  370. /*
  371. RIFF
  372. (
  373. 'DMPF' // DirectMusic Performance chunk
  374. [<prfh-ck>] // Performance header chunk
  375. [<guid-ck>] // GUID for performance
  376. [<vers-ck>] // Optional version info
  377. [<INFO-list>] // Name, author, copyright info., comments
  378. [<ptgl-list>] // List of Port groups, which are lists of desired port properties and
  379. // the PChannels to assign the Port.
  380. [<ntfl-list>] // List of notifications
  381. [<glbl-list>] // List of global data
  382. [<DMTG-form>] // Optional ToolGraph
  383. )
  384. // <prfh-ck>
  385. 'prfh' // Performance header
  386. (
  387. <DMUS_IO_PERFORMANCE_HEADER>
  388. )
  389. // <guid-ck>
  390. 'guid'
  391. (
  392. <GUID>
  393. )
  394. // <vers-ck>
  395. vers
  396. (
  397. <DMUS_IO_VERSION>
  398. )
  399. // <ptgl-list>
  400. LIST
  401. (
  402. 'ptgl' // List of Port groups
  403. <pspl-list> // List of support items for this group
  404. )
  405. // <ntfl-list>
  406. LIST
  407. (
  408. 'ntfl' // List of notifications
  409. <guid-ck> // Notification guid
  410. )
  411. // <glbl-list>
  412. LIST
  413. (
  414. 'glbl' // List of global data
  415. <glbd-ck> // The data.
  416. )
  417. // <glbd-ck>
  418. 'glbd'
  419. (
  420. <DMUS_IO_GLOBAL_DATA>
  421. )
  422. // <pspl-list>
  423. LIST
  424. (
  425. 'pspl' // List of port support items
  426. <psph-ck> // Port support item header chunk
  427. <pchn-ck> // PChannels that want this Port
  428. )
  429. // <pchn-ck>
  430. 'pchn'
  431. (
  432. <DMUS_IO_PCHANNELS>
  433. )
  434. // <psph-ck> // Port support item header chunk
  435. (
  436. 'psph' // Port support item header
  437. <DMUS_IO_PORT_SUPPORT_HEADER>
  438. )
  439. */
  440. /* File io for DirectMusic Tool and ToolGraph objects
  441. */
  442. /* RIFF ids: */
  443. #define DMUS_FOURCC_TOOLGRAPH_FORM mmioFOURCC('D','M','T','G')
  444. #define DMUS_FOURCC_TOOL_LIST mmioFOURCC('t','o','l','l')
  445. #define DMUS_FOURCC_TOOL_FORM mmioFOURCC('D','M','T','L')
  446. #define DMUS_FOURCC_TOOL_CHUNK mmioFOURCC('t','o','l','h')
  447. /* io structures: */
  448. typedef struct _DMUS_IO_TOOL_HEADER
  449. {
  450. GUID guidClassID; /* Class id of tool. */
  451. long lIndex; /* Position in graph. */
  452. DWORD cPChannels; /* Number of items in channels array. */
  453. FOURCC ckid; /* chunk ID of tool's data chunk if 0 fccType valid. */
  454. FOURCC fccType; /* list type if NULL ckid valid. */
  455. DWORD dwPChannels[1]; /* Array of PChannels, size determined by cPChannels. */
  456. } DMUS_IO_TOOL_HEADER;
  457. /*
  458. RIFF
  459. (
  460. 'DMTG' // DirectMusic ToolGraph chunk
  461. [<guid-ck>] // GUID for ToolGraph
  462. [<vers-ck>] // Optional version info
  463. [<INFO-list>] // Name, author, copyright info., comments
  464. <toll-list> // List of Tools
  465. )
  466. // <guid-ck>
  467. 'guid'
  468. (
  469. <GUID>
  470. )
  471. // <vers-ck>
  472. vers
  473. (
  474. <DMUS_IO_VERSION>
  475. )
  476. // <toll-list>
  477. LIST
  478. (
  479. 'toll' // List of tools
  480. <DMTL-form>... // Each tool is encapsulated in a RIFF chunk
  481. )
  482. // <DMTL-form> // Tools can be embedded in a graph or stored as separate files.
  483. RIFF
  484. (
  485. 'DMTL'
  486. <tolh-ck>
  487. [<guid-ck>] // Optional GUID for tool object instance (not to be confused with Class id in track header)
  488. [<vers-ck>] // Optional version info
  489. [<INFO-list>] // Optional name, author, copyright info., comments
  490. [<data>] // Tool data. Must be a RIFF readable chunk.
  491. )
  492. // <tolh-ck> // Tool header chunk
  493. (
  494. 'tolh'
  495. <DMUS_IO_TOOL_HEADER> // Tool header
  496. )
  497. */
  498. /* File io for DirectMusic Band Track object */
  499. /* RIFF ids: */
  500. #define DMUS_FOURCC_BANDTRACK_FORM mmioFOURCC('D','M','B','T')
  501. #define DMUS_FOURCC_BANDTRACK_CHUNK mmioFOURCC('b','d','t','h')
  502. #define DMUS_FOURCC_BANDS_LIST mmioFOURCC('l','b','d','l')
  503. #define DMUS_FOURCC_BAND_LIST mmioFOURCC('l','b','n','d')
  504. #define DMUS_FOURCC_BANDITEM_CHUNK mmioFOURCC('b','n','i','h')
  505. /* io structures */
  506. typedef struct _DMUS_IO_BAND_TRACK_HEADER
  507. {
  508. BOOL bAutoDownload; /* Determines if Auto-Download is enabled. */
  509. } DMUS_IO_BAND_TRACK_HEADER;
  510. typedef struct _DMUS_IO_BAND_ITEM_HEADER
  511. {
  512. MUSIC_TIME lBandTime; /* Position in track list. */
  513. } DMUS_IO_BAND_ITEM_HEADER;
  514. /*
  515. RIFF
  516. (
  517. 'DMBT' // DirectMusic Band Track form-type
  518. [<bdth-ck>] // Band track header
  519. [<guid-ck>] // GUID for band track
  520. [<vers-ck>] // Optional version info
  521. [<INFO-list>] // Name, author, copyright info., comments
  522. <lbdl-list> // List of Band Lists
  523. )
  524. // <bnth-ck>
  525. 'bdth'
  526. (
  527. <DMUS_IO_BAND_TRACK_HEADER>
  528. )
  529. // <guid-ck>
  530. 'guid'
  531. (
  532. <GUID>
  533. )
  534. // <vers-ck>
  535. vers
  536. (
  537. <DMUS_IO_VERSION>
  538. )
  539. // <lbdl-list>
  540. LIST
  541. (
  542. 'lbdl' // List of bands
  543. <lbnd-list> // Each band is encapsulated in a list
  544. )
  545. // <lbnd-list>
  546. LIST
  547. (
  548. 'lbnd'
  549. <bdih-ck>
  550. <DMBD-form> // Band
  551. ) )
  552. // <bdih-ck> // band item header
  553. (
  554. <DMUS_IO_BAND_ITEM_HEADER> // Band item header
  555. )
  556. */
  557. /* File io for DirectMusic Band object
  558. */
  559. /* RIFF ids: */
  560. #define DMUS_FOURCC_BAND_FORM mmioFOURCC('D','M','B','D')
  561. #define DMUS_FOURCC_INSTRUMENTS_LIST mmioFOURCC('l','b','i','l')
  562. #define DMUS_FOURCC_INSTRUMENT_LIST mmioFOURCC('l','b','i','n')
  563. #define DMUS_FOURCC_INSTRUMENT_CHUNK mmioFOURCC('b','i','n','s')
  564. // Flags for DMUS_IO_INSTRUMENT
  565. #define DMUS_IO_INST_PATCH (1 << 0) // dwPatch is valid.
  566. #define DMUS_IO_INST_BANKSELECT_MSB (1 << 1) // dwPatch contains a valid Bank Select MSB part
  567. #define DMUS_IO_INST_BANKSELECT_LSB (1 << 2) // dwPatch contains a valid Bank Select LSB part
  568. #define DMUS_IO_INST_ASSIGN_PATCH (1 << 3) // dwAssignPatch is valid
  569. #define DMUS_IO_INST_NOTERANGES (1 << 4) // dwNoteRanges is valid
  570. #define DMUS_IO_INST_PAN (1 << 5) // bPan is valid
  571. #define DMUS_IO_INST_VOLUME (1 << 6 ) // bVolume is valid
  572. #define DMUS_IO_INST_TRANSPOSE (1 << 7) // nTranspose is valid
  573. #define DMUS_IO_INST_GM (1 << 8) // Instrument is from GM collection
  574. #define DMUS_IO_INST_GS (1 << 9) // Instrument is from GS collection
  575. #define DMUS_IO_INST_VPATCH (1 << 10) // Instrument dwPatch is a virtual patch
  576. /* io structures */
  577. typedef struct _DMUS_IO_INSTRUMENT
  578. {
  579. DWORD dwPatch; /* MSB, LSB and Program change to define instrument */
  580. DWORD dwAssignPatch; /* MSB, LSB and Program change to assign to instrument when downloading */
  581. DWORD dwNoteRanges[4]; /* 128 bits; one for each MIDI note instrument needs to able to play */
  582. DWORD dwPChannel; /* PChannel instrument plays on */
  583. DWORD dwFlags; /* DMUS_IO_INST_ flags */
  584. BYTE bPan; /* Pan for instrument */
  585. BYTE bVolume; /* Volume for instrument */
  586. short nTranspose; /* Number of semitones to transpose notes */
  587. } DMUS_IO_INSTRUMENT;
  588. /*
  589. RIFF
  590. (
  591. 'DMBD' // DirectMusic Band chunk
  592. [<guid-ck>] // GUID for band
  593. [<vers-ck>] // Optional version info
  594. [<INFO-list>] // Name, author, copyright info., comments
  595. <lbil-list> // List of Instruments
  596. )
  597. // <guid-ck>
  598. 'guid'
  599. (
  600. <GUID>
  601. )
  602. // <vers-ck>
  603. vers
  604. (
  605. <DMUS_IO_VERSION>
  606. )
  607. // <lbil-list>
  608. LIST
  609. (
  610. 'lbil' // List of instruments
  611. <lbin-list> // Each instrument is encapsulated in a list
  612. )
  613. // <lbin-list>
  614. LIST
  615. (
  616. 'lbin'
  617. <bins-ck>
  618. [<DMRF-list>] // Optional reference to DLS Collection file.
  619. )
  620. // <bins-ck> // Instrument chunk
  621. (
  622. 'bins'
  623. <DMUS_IO_INSTRUMENT> // Instrument header
  624. )
  625. */
  626. /* File io for DirectMusic Segment object */
  627. /* RIFF ids: */
  628. #define DMUS_FOURCC_SEGMENT_FORM mmioFOURCC('D','M','S','G')
  629. #define DMUS_FOURCC_SEGMENT_CHUNK mmioFOURCC('s','e','g','h')
  630. #define DMUS_FOURCC_TRACK_LIST mmioFOURCC('t','r','k','l')
  631. #define DMUS_FOURCC_TRACK_FORM mmioFOURCC('D','M','T','K')
  632. #define DMUS_FOURCC_TRACK_CHUNK mmioFOURCC('t','r','k','h')
  633. /* io structures:*/
  634. typedef struct _DMUS_IO_SEGMENT_HEADER
  635. {
  636. DWORD dwRepeats; /* Number of repeats. By default, 0. */
  637. MUSIC_TIME mtLength; /* Length, in music time. */
  638. MUSIC_TIME mtPlayStart; /* Start of playback. By default, 0. */
  639. MUSIC_TIME mtLoopStart; /* Start of looping portion. By default, 0. */
  640. MUSIC_TIME mtLoopEnd; /* End of loop. Must be greater than dwPlayStart. By default equal to length. */
  641. DWORD dwResolution; /* Default resolution. */
  642. } DMUS_IO_SEGMENT_HEADER;
  643. typedef struct _DMUS_IO_TRACK_HEADER
  644. {
  645. GUID guidClassID; /* Class id of track. */
  646. DWORD dwPosition; /* Position in track list. */
  647. DWORD dwGroup; /* Group bits for track. */
  648. FOURCC ckid; /* chunk ID of track's data chunk if 0 fccType valid. */
  649. FOURCC fccType; /* list type if NULL ckid valid */
  650. } DMUS_IO_TRACK_HEADER;
  651. /*
  652. RIFF
  653. (
  654. 'DMSG' // DirectMusic Segment chunk
  655. <segh-ck> // Segment header chunk
  656. [<guid-ck>] // GUID for segment
  657. [<vers-ck>] // Optional version info
  658. [<INFO-list>] // Name, author, copyright info., comments
  659. <trkl-list> // List of Tracks
  660. [<DMTG-form>] // Optional ToolGraph
  661. )
  662. // <segh-ck>
  663. 'segh'
  664. (
  665. <DMUS_IO_SEGMENT_HEADER>
  666. )
  667. // <guid-ck>
  668. 'guid'
  669. (
  670. <GUID>
  671. )
  672. // <vers-ck>
  673. vers
  674. (
  675. <DMUS_IO_VERSION>
  676. )
  677. // <trkl-list>
  678. LIST
  679. (
  680. 'trkl' // List of tracks
  681. <DMTK-form>... // Each track is encapsulated in a RIFF chunk
  682. )
  683. // <DMTK-form> // Tracks can be embedded in a segment or stored as separate files.
  684. RIFF
  685. (
  686. 'DMTK'
  687. <trkh-ck>
  688. [<guid-ck>] // Optional GUID for track object instance (not to be confused with Class id in track header)
  689. [<vers-ck>] // Optional version info
  690. [<INFO-list>] // Optional name, author, copyright info., comments
  691. [<data>] // Track data. Must be a RIFF readable chunk.
  692. )
  693. // <trkh-ck> // Track header chunk
  694. (
  695. 'trkh'
  696. <DMUS_IO_TRACK_HEADER> // Track header
  697. )
  698. */
  699. /* File io for DirectMusic reference chunk.
  700. This is used to embed a reference to an object.
  701. */
  702. /* RIFF ids: */
  703. #define DMUS_FOURCC_REF_LIST mmioFOURCC('D','M','R','F')
  704. #define DMUS_FOURCC_REF_CHUNK mmioFOURCC('r','e','f','h')
  705. #define DMUS_FOURCC_DATE_CHUNK mmioFOURCC('d','a','t','e')
  706. #define DMUS_FOURCC_NAME_CHUNK mmioFOURCC('n','a','m','e')
  707. #define DMUS_FOURCC_FILE_CHUNK mmioFOURCC('f','i','l','e')
  708. #define DMUS_FOURCC_CATEGORY_CHUNK mmioFOURCC('c','a','t','g')
  709. #define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s')
  710. typedef struct _DMUS_IO_REFERENCE
  711. {
  712. GUID guidClassID; /* Class id is always required. */
  713. DWORD dwValidData; /* Flags. */
  714. } DMUS_IO_REFERENCE;
  715. /*
  716. LIST
  717. (
  718. 'DMRF' // DirectMusic Reference chunk
  719. <refh-ck> // Reference header chunk
  720. [<guid-ck>] // Optional object GUID.
  721. [<date-ck>] // Optional file date.
  722. [<name-ck>] // Optional name.
  723. [<file-ck>] // Optional file name.
  724. [<catg-ck>] // Optional category name.
  725. [<vers-ck>] // Optional version info.
  726. )
  727. // <refh-ck>
  728. 'refh'
  729. (
  730. <DMUS_IO_REFERENCE>
  731. )
  732. // <guid-ck>
  733. 'guid'
  734. (
  735. <GUID>
  736. )
  737. // <date-ck>
  738. date
  739. (
  740. <FILETIME>
  741. )
  742. // <name-ck>
  743. name
  744. (
  745. // Name, stored as NULL terminated string of WCHARs
  746. )
  747. // <file-ck>
  748. file
  749. (
  750. // File name, stored as NULL terminated string of WCHARs
  751. )
  752. // <catg-ck>
  753. catg
  754. (
  755. // Category name, stored as NULL terminated string of WCHARs
  756. )
  757. // <vers-ck>
  758. vers
  759. (
  760. <DMUS_IO_VERSION>
  761. )
  762. */
  763. /* File i/o for DirectMusic Performance object */
  764. /* RIFF ids: */
  765. #define DMUS_FOURCC_PERFORMANCE_FORM mmioFOURCC('D','M','P','F')
  766. #define DMUS_FOURCC_PERFORMANCE_CHUNK mmioFOURCC('p','r','f','h')
  767. #define DMUS_FOURCC_PERF_PORTGROUP_LIST mmioFOURCC('p','t','g','l')
  768. #define DMUS_FOURCC_PERF_NOTIFICATION_LIST mmioFOURCC('n','t','f','l')
  769. #define DMUS_FOURCC_PERF_GLOBAL_DATA_LIST mmioFOURCC('g','l','b','l')
  770. #define DMUS_FOURCC_PERF_SUPPORT_LIST mmioFOURCC('p','s','p','l')
  771. #define DMUS_FOURCC_PERF_SUPPORT_CHUNK mmioFOURCC('p','s','p','h')
  772. #define DMUS_FOURCC_PERF_PCHANNELS_CHUNK mmioFOURCC('p','c','h','n')
  773. /* io structures: */
  774. typedef struct _DMUS_IO_PERFORMANCE_HEADER
  775. {
  776. DWORD dwPrepareTime; /* time ahead, in ms, to transport */
  777. DWORD dwPrePlayTime; /* time ahead, in ms, of latency clock to pack events */
  778. } DMUS_IO_PERFORMANCE_HEADER;
  779. typedef enum _DMUS_SUPPORTTYPE /* identifies the type of data in DMUS_IO_USSupportData */
  780. {
  781. DMUS_ST_BOOL = 0,
  782. DMUS_ST_DWORD = 1,
  783. DMUS_ST_LONG = 2
  784. } DMUS_SUPPORTTYPE;
  785. typedef struct _DMUS_IO_SUPPORT_DATA /* data used in DMUS_IO_USPortSupportHeader */
  786. {
  787. DMUS_SUPPORTTYPE type; /* identifies which member of the union is valid */
  788. union
  789. {
  790. BOOL fVal;
  791. DWORD dwVal;
  792. LONG lVal;
  793. };
  794. } DMUS_IO_SUPPORT_DATA;
  795. typedef struct _DMUS_IO_PORT_SUPPORT_HEADER /* identifies desired port properties */
  796. {
  797. GUID guidID; /* Support ID. */
  798. DMUS_IO_SUPPORT_DATA lowData; /* Low range of data, inclusive. If BOOL type, */
  799. /* ignore highData. Otherwise, combine lowData */
  800. /* and highData into a range. */
  801. DMUS_IO_SUPPORT_DATA highData; /* High range of data, inclusive */
  802. } DMUS_IO_PORT_SUPPORT_HEADER;
  803. typedef struct _DMUS_IO_PCHANNELS /* Holds the PChannels to assign to a Port */
  804. {
  805. DWORD cPChannels; /* Number of items in channels array. */
  806. DWORD adwPChannels[1];/* Array of PChannels, size determined by cPChannels. */
  807. } DMUS_IO_PCHANNELS;
  808. typedef struct _DMUS_IO_GLOBAL_DATA /* Holds the global data information */
  809. {
  810. GUID guid; /* The global data guid */
  811. DWORD dwSize; /* The size of the data */
  812. char acData[1]; /* Holds the data of the global data, size determine by dwSize */
  813. } DMUS_IO_GLOBAL_DATA;
  814. /* personalities */
  815. /* runtime chunks */
  816. #define DMUS_FOURCC_PERSONALITY_FORM mmioFOURCC('D','M','P','R')
  817. #define DMUS_FOURCC_IOPERSONALITY_CHUNK mmioFOURCC('p','e','r','h')
  818. #define DMUS_FOURCC_GUID_CHUNK mmioFOURCC('g','u','i','d')
  819. #define DMUS_FOURCC_INFO_LIST mmioFOURCC('I','N','F','O')
  820. #define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s')
  821. #define DMUS_FOURCC_SUBCHORD_CHUNK mmioFOURCC('c','h','d','t')
  822. #define DMUS_FOURCC_CHORDENTRY_CHUNK mmioFOURCC('c','h','e','h')
  823. #define DMUS_FOURCC_SUBCHORDID_CHUNK mmioFOURCC('s','b','c','n')
  824. #define DMUS_FOURCC_IONEXTCHORD_CHUNK mmioFOURCC('n','c','r','d')
  825. #define DMUS_FOURCC_NEXTCHORDSEQ_CHUNK mmioFOURCC('n','c','s','q')
  826. #define DMUS_FOURCC_IOSIGNPOST_CHUNK mmioFOURCC('s','p','s','h')
  827. #define DMUS_FOURCC_CHORDNAME_CHUNK mmioFOURCC('I','N','A','M')
  828. /* runtime list chunks */
  829. #define DMUS_FOURCC_CHORDENTRY_LIST mmioFOURCC('c','h','o','e')
  830. #define DMUS_FOURCC_CHORDMAP_LIST mmioFOURCC('c','m','a','p')
  831. #define DMUS_FOURCC_CHORD_LIST mmioFOURCC('c','h','r','d')
  832. #define DMUS_FOURCC_CHORDPALETTE_LIST mmioFOURCC('c','h','p','l')
  833. #define DMUS_FOURCC_CADENCE_LIST mmioFOURCC('c','a','d','e')
  834. #define DMUS_FOURCC_SIGNPOSTITEM_LIST mmioFOURCC('s','p','s','t')
  835. #define DMUS_FOURCC_SIGNPOST_LIST mmioFOURCC('s','p','s','q')
  836. /* run time data structs */
  837. typedef struct _DMUS_IO_PERSONALITY
  838. {
  839. WCHAR wszLoadName[20];
  840. DWORD dwScalePattern;
  841. DWORD dwFlags;
  842. } DMUS_IO_PERSONALITY;
  843. typedef struct _DMUS_IO_PERS_SUBCHORD
  844. {
  845. DWORD dwChordPattern;
  846. DWORD dwScalePattern;
  847. DWORD dwInvertPattern;
  848. BYTE bChordRoot;
  849. BYTE bScaleRoot;
  850. WORD wCFlags;
  851. DWORD dwLevels; /* parts or which subchord levels this chord supports */
  852. } DMUS_IO_PERS_SUBCHORD;
  853. typedef struct _DMUS_IO_CHORDENTRY
  854. {
  855. DWORD dwFlags;
  856. WORD wConnectionID; /* replaces runtime "pointer to this" */
  857. } DMUS_IO_CHORDENTRY;
  858. typedef struct _DMUS_IO_NEXTCHORD
  859. {
  860. DWORD dwFlags;
  861. WORD nWeight;
  862. WORD wMinBeats;
  863. WORD wMaxBeats;
  864. WORD wConnectionID; /* points to an ioChordEntry */
  865. } DMUS_IO_NEXTCHORD;
  866. typedef struct _DMUS_IO_PERS_SIGNPOST
  867. {
  868. DWORD dwChords; /* 1bit per group */
  869. DWORD dwFlags;
  870. } DMUS_IO_PERS_SIGNPOST;
  871. /*
  872. RIFF
  873. (
  874. 'DMPR'
  875. <perh-ck> // Personality header chunk
  876. [<guid-ck>] // guid chunk
  877. [<vers-ck>] // version chunk (two DWORDS)
  878. <INFO-list> // standard MS Info chunk
  879. <chdt-ck> // subchord database
  880. <chpl-list> // chord palette
  881. <cmap-list> // chord map
  882. <spst-list> // signpost list
  883. )
  884. <chdt> ::= chdt(<cbChordSize::WORD> <ioSubChord> ... )
  885. <chpl-list> ::= LIST('chpl'
  886. <chrd-list> ... // chord definition
  887. )
  888. <chrd-list> ::= LIST('chrd'
  889. <INAM-ck> // name of chord in wide char format
  890. <sbcn-ck> // list of subchords composing chord
  891. [<ched-ck>] // optional chord edit flags
  892. )
  893. <cmap-list> ::= LIST('cmap' <choe-list> )
  894. <choe-list> ::= LIST('choe'
  895. <cheh-ck> // chord entry data
  896. <chrd-list> // chord definition
  897. <ncsq-ck> // connecting(next) chords
  898. )
  899. <spst-list> ::= LIST('spst'
  900. <spsh-ck>
  901. <chrd-list>
  902. [<cade-list>]
  903. )
  904. <cade-list> ::= LIST('cade' <chrd-list> ...)
  905. <sbcn-ck> ::= sbcn(<cSubChordID:WORD>)
  906. <cheh-ck> ::= cheh(i<DMUS_IO_CHORDENTRY>)
  907. <ncrd-ck> ::= ncrd(<DMUS_IO_NEXTCHORD>)
  908. <ncsq-ck> ::= ncsq(<wNextChordSize:WORD> <DMUS_IO_NEXTCHORD>...)
  909. <spsh-ck> ::= spsh(<DMUS_IO_PERS_SIGNPOST>)
  910. */
  911. /* Signpost tracks */
  912. #define DMUS_FOURCC_SIGNPOST_TRACK_CHUNK mmioFOURCC( 's', 'g', 'n', 'p' )
  913. typedef struct _DMUS_IO_SIGNPOST
  914. {
  915. MUSIC_TIME mtTime;
  916. DWORD dwChords;
  917. WORD wMeasure;
  918. } DMUS_IO_SIGNPOST;
  919. /*
  920. // <sgnp-list>
  921. 'sgnp'
  922. (
  923. //sizeof DMUS_IO_SIGNPOST: DWORD
  924. <DMUS_IO_SIGNPOST>...
  925. )
  926. */
  927. #define DMUS_FOURCC_MUTE_CHUNK mmioFOURCC('m','u','t','e')
  928. typedef struct _DMUS_IO_MUTE
  929. {
  930. MUSIC_TIME mtTime;
  931. DWORD dwPChannel;
  932. DWORD dwPChannelMap;
  933. } DMUS_IO_MUTE;
  934. /*
  935. // <mute-list>
  936. 'mute'
  937. (
  938. //sizeof DMUS_IO_MUTE:DWORD
  939. <DMUS_IO_MUTE>...
  940. )
  941. */
  942. /* Used for both style and personality tracks */
  943. #define DMUS_FOURCC_TIME_STAMP_CHUNK mmioFOURCC('s', 't', 'm', 'p')
  944. /* Style tracks */
  945. #define DMUS_FOURCC_STYLE_TRACK_LIST mmioFOURCC('s', 't', 't', 'r')
  946. #define DMUS_FOURCC_STYLE_REF_LIST mmioFOURCC('s', 't', 'r', 'f')
  947. /*
  948. // <sttr-list>
  949. LIST('sttr'
  950. (
  951. // some number of <strf-list>
  952. )
  953. // <strf-list>
  954. LIST('strf'
  955. (
  956. <stmp-ck>
  957. <DMRF>
  958. )
  959. // <stmp-ck> defined in ..\dmcompos\dmcompp.h
  960. */
  961. /* Personality tracks */
  962. #define DMUS_FOURCC_PERS_TRACK_LIST mmioFOURCC('p', 'f', 't', 'r')
  963. #define DMUS_FOURCC_PERS_REF_LIST mmioFOURCC('p', 'f', 'r', 'f')
  964. /*
  965. // <pftr-list>
  966. LIST('pftr'
  967. (
  968. // some number of <pfrf-list>
  969. )
  970. // <pfrf-list>
  971. LIST('pfrf'
  972. (
  973. <stmp-ck>
  974. <DMRF>
  975. )
  976. // <stmp-ck>
  977. 'stmp'
  978. (
  979. // time:DWORD
  980. )
  981. */
  982. #define DMUS_FOURCC_TEMPO_TRACK mmioFOURCC('t','e','t','r')
  983. /*
  984. // tempo list
  985. 'tetr'
  986. (
  987. // sizeof DMUS_IO_TEMPO: DWORD
  988. <DMUS_IO_TEMPO>...
  989. )
  990. */
  991. #define DMUS_FOURCC_SEQ_TRACK mmioFOURCC('s','q','t','r')
  992. /*
  993. // sequence track
  994. 'sqtr'
  995. (
  996. // sizeof DMUS_IO_SEQ_ITEM: DWORD
  997. <DMUS_IO_SEQ_ITEM>...
  998. )
  999. */
  1000. #define DMUS_FOURCC_SYSEX_TRACK mmioFOURCC('s','y','s','x')
  1001. /*
  1002. // sysex track
  1003. 'sysx'
  1004. (
  1005. // list of:
  1006. // {
  1007. // time of the sys-ex message: long
  1008. // length of the sys-ex data: DWORD
  1009. // sys-ex: data
  1010. // }...
  1011. )
  1012. */
  1013. #define DMUS_FOURCC_TIMESIGNATURE_TRACK mmioFOURCC('t','i','m','s')
  1014. /*
  1015. // time signature track
  1016. 'tims'
  1017. (
  1018. // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
  1019. <DMUS_IO_TIMESIGNATURE_ITEM>...
  1020. )
  1021. */
  1022. #ifdef __cplusplus
  1023. }; /* extern "C" */
  1024. #endif
  1025. #endif /* #ifndef _DMUSICF_ */