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.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. The code included in this file is provided under the terms of the ISC license
  8. http://www.isc.org/downloads/software-support-policy/isc-license. Permission
  9. To use, copy, modify, and/or distribute this software for any purpose with or
  10. without fee is hereby granted provided that the above copyright notice and
  11. this permission notice appear in all copies.
  12. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  13. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  14. DISCLAIMED.
  15. ==============================================================================
  16. */
  17. namespace juce
  18. {
  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. } // namespace juce