OpenShot Library | libopenshot-audio  0.2.0
juce_MPEMessages.h
1 
2 /** @weakgroup juce_audio_basics-mpe
3  * @{
4  */
5 /*
6  ==============================================================================
7 
8  This file is part of the JUCE library.
9  Copyright (c) 2017 - ROLI Ltd.
10 
11  JUCE is an open source library subject to commercial or open-source
12  licensing.
13 
14  The code included in this file is provided under the terms of the ISC license
15  http://www.isc.org/downloads/software-support-policy/isc-license. Permission
16  To use, copy, modify, and/or distribute this software for any purpose with or
17  without fee is hereby granted provided that the above copyright notice and
18  this permission notice appear in all copies.
19 
20  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22  DISCLAIMED.
23 
24  ==============================================================================
25 */
26 
27 namespace juce
28 {
29 
30 //==============================================================================
31 /**
32  This helper class contains the necessary helper functions to generate
33  MIDI messages that are exclusive to MPE, such as defining the upper and lower
34  MPE zones and setting per-note and master pitchbend ranges.
35  You can then send them to your MPE device using MidiOutput::sendBlockOfMessagesNow.
36 
37  All other MPE messages like per-note pitchbend, pressure, and third
38  dimension, are ordinary MIDI messages that should be created using the MidiMessage
39  class instead. You just need to take care to send them to the appropriate
40  per-note MIDI channel.
41 
42  Note: If you are working with an MPEZoneLayout object inside your app,
43  you should not use the message sequences provided here. Instead, you should
44  change the zone layout programmatically with the member functions provided in the
45  MPEZoneLayout class itself. You should also make sure that the Expressive
46  MIDI zone layout of your C++ code and of the MPE device are kept in sync.
47 
48  @see MidiMessage, MPEZoneLayout
49 
50  @tags{Audio}
51 */
53 {
54 public:
55  /** Returns the sequence of MIDI messages that, if sent to an Expressive
56  MIDI device, will set the lower MPE zone.
57  */
58  static MidiBuffer setLowerZone (int numMemberChannels = 0,
59  int perNotePitchbendRange = 48,
60  int masterPitchbendRange = 2);
61 
62  /** Returns the sequence of MIDI messages that, if sent to an Expressive
63  MIDI device, will set the upper MPE zone.
64  */
65  static MidiBuffer setUpperZone (int numMemberChannels = 0,
66  int perNotePitchbendRange = 48,
67  int masterPitchbendRange = 2);
68 
69  /** Returns the sequence of MIDI messages that, if sent to an Expressive
70  MIDI device, will set the per-note pitchbend range of the lower MPE zone.
71  */
72  static MidiBuffer setLowerZonePerNotePitchbendRange (int perNotePitchbendRange = 48);
73 
74  /** Returns the sequence of MIDI messages that, if sent to an Expressive
75  MIDI device, will set the per-note pitchbend range of the upper MPE zone.
76  */
77  static MidiBuffer setUpperZonePerNotePitchbendRange (int perNotePitchbendRange = 48);
78 
79  /** Returns the sequence of MIDI messages that, if sent to an Expressive
80  MIDI device, will set the master pitchbend range of the lower MPE zone.
81  */
82  static MidiBuffer setLowerZoneMasterPitchbendRange (int masterPitchbendRange = 2);
83 
84  /** Returns the sequence of MIDI messages that, if sent to an Expressive
85  MIDI device, will set the master pitchbend range of the upper MPE zone.
86  */
87  static MidiBuffer setUpperZoneMasterPitchbendRange (int masterPitchbendRange = 2);
88 
89  /** Returns the sequence of MIDI messages that, if sent to an Expressive
90  MIDI device, will clear the lower zone.
91  */
92  static MidiBuffer clearLowerZone();
93 
94  /** Returns the sequence of MIDI messages that, if sent to an Expressive
95  MIDI device, will clear the upper zone.
96  */
97  static MidiBuffer clearUpperZone();
98 
99  /** Returns the sequence of MIDI messages that, if sent to an Expressive
100  MIDI device, will clear the lower and upper zones.
101  */
102  static MidiBuffer clearAllZones();
103 
104  /** Returns the sequence of MIDI messages that, if sent to an Expressive
105  MIDI device, will reset the whole MPE zone layout of the
106  device to the laoyut passed in. This will first clear the current lower and upper
107  zones, then then set the zones contained in the passed-in zone layout, and set their
108  per-note and master pitchbend ranges to their current values.
109  */
110  static MidiBuffer setZoneLayout (MPEZoneLayout layout);
111 
112  /** The RPN number used for MPE zone layout messages.
113 
114  Pitchbend range messages (both per-note and master) are instead sent
115  on RPN 0 as in standard MIDI 1.0.
116  */
117  static const int zoneLayoutMessagesRpnNumber = 6;
118 };
119 
120 } // namespace juce
121 
122 /** @}*/
juce::MPEMessages
This helper class contains the necessary helper functions to generate MIDI messages that are exclusiv...
Definition: juce_MPEMessages.h:52
JUCE_API
#define JUCE_API
This macro is added to all JUCE public class declarations.
Definition: juce_StandardHeader.h:143
juce::MidiBuffer
Holds a sequence of time-stamped midi events.
Definition: juce_MidiBuffer.h:46
juce::MPEZoneLayout
This class represents the current MPE zone layout of a device capable of handling MPE.
Definition: juce_MPEZoneLayout.h:48