Audio plugin host https://kx.studio/carla
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.

juce_MPEMessages.h 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_MPEMESSAGES_H_INCLUDED
  18. #define JUCE_MPEMESSAGES_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. This helper class contains the necessary helper functions to generate
  22. MIDI messages that are exclusive to MPE, such as defining
  23. MPE zones and setting per-note and master pitchbend ranges.
  24. You can then send them to your MPE device using
  25. MidiOutput::sendBlockOfMessagesNow.
  26. All other MPE messages like per-note pitchbend, pressure, and third
  27. dimension, are ordinary MIDI messages that should be created using the MidiMessage
  28. class instead. You just need to take care to send them to the appropriate
  29. per-note MIDI channel.
  30. Note: if you are working with an MPEZoneLayout object inside your app,
  31. you should not use the message sequences provided here. Instead, you should
  32. change the zone layout programmatically with the member functions provided in the
  33. MPEZoneLayout class itself. You should also make sure that the Expressive
  34. MIDI zone layout of your C++ code and of the MPE device are kept in sync.
  35. @see MidiMessage, MPEZoneLayout, MPEZone
  36. */
  37. class JUCE_API MPEMessages
  38. {
  39. public:
  40. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  41. MIDI device, will define a new MPE zone.
  42. */
  43. static MidiBuffer addZone (MPEZone zone);
  44. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  45. MIDI device, will change the per-note pitchbend range of an
  46. existing MPE zone.
  47. */
  48. static MidiBuffer perNotePitchbendRange (MPEZone zone);
  49. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  50. MIDI device, will change the master pitchbend range of an
  51. existing MPE zone.
  52. */
  53. static MidiBuffer masterPitchbendRange (MPEZone zone);
  54. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  55. MIDI device, will erase all currently defined MPE zones.
  56. */
  57. static MidiBuffer clearAllZones();
  58. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  59. MIDI device, will reset the whole MPE zone layout of the
  60. device to the laoyut passed in. This will first clear all currently
  61. defined MPE zones, then add all zones contained in the
  62. passed-in zone layout, and set their per-note and master pitchbend
  63. ranges to their current values.
  64. */
  65. static MidiBuffer setZoneLayout (const MPEZoneLayout& layout);
  66. /** The RPN number used for MPE zone layout messages.
  67. Note: This number can change in later versions of MPE.
  68. Pitchbend range messages (both per-note and master) are instead sent
  69. on RPN 0 as in standard MIDI 1.0.
  70. */
  71. static const int zoneLayoutMessagesRpnNumber = 6;
  72. };
  73. #endif // JUCE_MPEMESSAGES_H_INCLUDED