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.

100 lines
2.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: midi.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /*
  11. * MIDI definitions
  12. *
  13. * midi.h
  14. *
  15. */
  16. #define MIDI_CHANNELS 16
  17. #define MIDI_NOTES 128
  18. #define MIDI_NOTE_MAP_SIZE (MIDI_CHANNELS * MIDI_NOTES)
  19. #define MIDI_NOTE_OFF(note,channel) \
  20. (0x007F0080 | ((note) << 8) | (channel))
  21. #define MIDI_SUSTAIN(value,channel) \
  22. (0x000040B0 | ((value) << 16) | (channel))
  23. #define IS_SYSEX(b) (b == 0xF0)
  24. #define IS_DATA_BYTE(b) ((b & 0x80) == 0)
  25. #define IS_EOX(b) (b == 0xF7)
  26. #define IS_REALTIME(b) (((b) & 0xF8) == 0xF8)
  27. #define IS_SYSTEM(b) (((b) & 0xF0) == 0xF0)
  28. #define IS_CHANNEL(b) ((b) & 0x80)
  29. #define IS_STATUS(b) ((b) & 0x80)
  30. #define MIDI_CHANNEL(b) ((b) & 0x0F)
  31. #define MIDI_STATUS(b) ((b) & 0xF0)
  32. #define MIDI_NOTEOFF 0x80
  33. #define MIDI_NOTEON 0x90
  34. #define MIDI_PTOUCH 0xA0
  35. #define MIDI_CCHANGE 0xB0
  36. #define MIDI_PCHANGE 0xC0
  37. #define MIDI_MTOUCH 0xD0
  38. #define MIDI_PBEND 0xE0
  39. #define MIDI_SYSX 0xF0
  40. #define MIDI_MTC 0xF1
  41. #define MIDI_SONGPP 0xF2
  42. #define MIDI_SONGS 0xF3
  43. #define MIDI_TUNEREQ 0xF6
  44. #define MIDI_EOX 0xF7
  45. #define MIDI_CLOCK 0xF8
  46. #define MIDI_START 0xFA
  47. #define MIDI_CONTINUE 0xFB
  48. #define MIDI_STOP 0xFC
  49. #define MIDI_SENSE 0xFE
  50. #define MIDI_SYSRESET 0xFF
  51. // controller numbers
  52. #define CC_BANKSELECTH 0x00
  53. #define CC_BANKSELECTL 0x20
  54. #define CC_MODWHEEL 0x01
  55. #define CC_VOLUME 0x07
  56. #define CC_PAN 0x0A
  57. #define CC_EXPRESSION 0x0B
  58. #define CC_SUSTAIN 0x40
  59. #define CC_ALLSOUNDSOFF 0x78
  60. #define CC_RESETALL 0x79
  61. #define CC_ALLNOTESOFF 0x7B
  62. #define CC_MONOMODE 0x7E
  63. #define CC_POLYMODE 0x7F
  64. // rpn controllers
  65. #define CC_DATAENTRYMSB 0x06
  66. #define CC_DATAENTRYLSB 0x26
  67. #define CC_NRPN_LSB 0x62
  68. #define CC_NRPN_MSB 0x63
  69. #define CC_RPN_LSB 0x64
  70. #define CC_RPN_MSB 0x65
  71. // registered parameter numbers
  72. #define RPN_PITCHBEND 0x00
  73. #define RPN_FINETUNE 0x01
  74. #define RPN_COARSETUNE 0x02
  75. /*XLATOFF */
  76. #pragma warning (disable:4200) // turn off 0 length array warning
  77. typedef struct
  78. {
  79. ULONG msDelta;
  80. ULONG cbSize;
  81. BYTE abMidiEvents[0];
  82. } MIDIFORMAT, *PMIDIFORMAT;
  83. #pragma warning (default:4200) // turn on 0 length array warning
  84. /*XLATON*/