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.

103 lines
4.2KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2016 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of the ISC license
  6. http://www.isc.org/downloads/software-support-policy/isc-license/
  7. Permission to use, copy, modify, and/or distribute this software for any
  8. purpose with or without fee is hereby granted, provided that the above
  9. copyright notice and this permission notice appear in all copies.
  10. THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
  11. TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  12. FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
  13. OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  14. USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  16. OF THIS SOFTWARE.
  17. -----------------------------------------------------------------------------
  18. To release a closed-source product which uses other parts of JUCE not
  19. licensed under the ISC terms, commercial licenses are available: visit
  20. www.juce.com for more information.
  21. ==============================================================================
  22. */
  23. #ifndef JUCE_MPEMESSAGES_H_INCLUDED
  24. #define JUCE_MPEMESSAGES_H_INCLUDED
  25. //==============================================================================
  26. /**
  27. This helper class contains the necessary helper functions to generate
  28. MIDI messages that are exclusive to MPE, such as defining
  29. MPE zones and setting per-note and master pitchbend ranges.
  30. You can then send them to your MPE device using
  31. MidiOutput::sendBlockOfMessagesNow.
  32. All other MPE messages like per-note pitchbend, pressure, and third
  33. dimension, are ordinary MIDI messages that should be created using the MidiMessage
  34. class instead. You just need to take care to send them to the appropriate
  35. per-note MIDI channel.
  36. Note: if you are working with an MPEZoneLayout object inside your app,
  37. you should not use the message sequences provided here. Instead, you should
  38. change the zone layout programmatically with the member functions provided in the
  39. MPEZoneLayout class itself. You should also make sure that the Expressive
  40. MIDI zone layout of your C++ code and of the MPE device are kept in sync.
  41. @see MidiMessage, MPEZoneLayout, MPEZone
  42. */
  43. class JUCE_API MPEMessages
  44. {
  45. public:
  46. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  47. MIDI device, will define a new MPE zone.
  48. */
  49. static MidiBuffer addZone (MPEZone zone);
  50. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  51. MIDI device, will change the per-note pitchbend range of an
  52. existing MPE zone.
  53. */
  54. static MidiBuffer perNotePitchbendRange (MPEZone zone);
  55. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  56. MIDI device, will change the master pitchbend range of an
  57. existing MPE zone.
  58. */
  59. static MidiBuffer masterPitchbendRange (MPEZone zone);
  60. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  61. MIDI device, will erase all currently defined MPE zones.
  62. */
  63. static MidiBuffer clearAllZones();
  64. /** Returns the sequence of MIDI messages that, if sent to an Expressive
  65. MIDI device, will reset the whole MPE zone layout of the
  66. device to the laoyut passed in. This will first clear all currently
  67. defined MPE zones, then add all zones contained in the
  68. passed-in zone layout, and set their per-note and master pitchbend
  69. ranges to their current values.
  70. */
  71. static MidiBuffer setZoneLayout (const MPEZoneLayout& layout);
  72. /** The RPN number used for MPE zone layout messages.
  73. Note: This number can change in later versions of MPE.
  74. Pitchbend range messages (both per-note and master) are instead sent
  75. on RPN 0 as in standard MIDI 1.0.
  76. */
  77. static const int zoneLayoutMessagesRpnNumber = 6;
  78. };
  79. #endif // JUCE_MPEMESSAGES_H_INCLUDED