OpenShot Library | libopenshot-audio  0.1.9
juce::MPEZoneLayout Class Reference

This class represents the current MPE zone layout of a device capable of handling MPE. More...

#include <juce_MPEZoneLayout.h>

Classes

class  Listener
 Listener class. More...
 
struct  Zone
 This struct represents an MPE zone. More...
 

Public Member Functions

 MPEZoneLayout () noexcept
 Default constructor. More...
 
 MPEZoneLayout (const MPEZoneLayout &other)
 Copy constuctor. More...
 
MPEZoneLayoutoperator= (const MPEZoneLayout &other)
 Copy assignment operator. More...
 
void setLowerZone (int numMemberChannels=0, int perNotePitchbendRange=48, int masterPitchbendRange=2) noexcept
 Sets the lower zone of this layout. More...
 
void setUpperZone (int numMemberChannels=0, int perNotePitchbendRange=48, int masterPitchbendRange=2) noexcept
 Sets the upper zone of this layout. More...
 
const Zone getLowerZone () const noexcept
 Returns a struct representing the lower MPE zone. More...
 
const Zone getUpperZone () const noexcept
 Returns a struct representing the upper MPE zone. More...
 
void clearAllZones ()
 Clears the lower and upper zones of this layout, making them both inactive and disabling MPE mode.
 
void processNextMidiEvent (const MidiMessage &message)
 Pass incoming MIDI messages to an object of this class if you want the zone layout to properly react to MPE RPN messages like an MPE device. More...
 
void processNextMidiBuffer (const MidiBuffer &buffer)
 Pass incoming MIDI buffers to an object of this class if you want the zone layout to properly react to MPE RPN messages like an MPE device. More...
 
void addListener (Listener *const listenerToAdd) noexcept
 Adds a listener. More...
 
void removeListener (Listener *const listenerToRemove) noexcept
 Removes a listener. More...
 

Detailed Description

This class represents the current MPE zone layout of a device capable of handling MPE.

An MPE device can have up to two zones: a lower zone with master channel 1 and allocated MIDI channels increasing from channel 2, and an upper zone with master channel 16 and allocated MIDI channels decreasing from channel 15. MPE mode is enabled on a device when one of these zones is active and disabled when both are inactive.

Use the MPEMessages helper class to convert the zone layout represented by this object to MIDI message sequences that you can send to an Expressive MIDI device to set its zone layout, add zones etc.

See also
MPEInstrument

Definition at line 48 of file juce_MPEZoneLayout.h.

Constructor & Destructor Documentation

◆ MPEZoneLayout() [1/2]

juce::MPEZoneLayout::MPEZoneLayout ( )
noexcept

Default constructor.

This will create a layout with inactive lower and upper zones, representing a device with MPE mode disabled.

You can set the lower or upper MPE zones using the setZone() method.

See also
setZone

Definition at line 26 of file juce_MPEZoneLayout.cpp.

◆ MPEZoneLayout() [2/2]

juce::MPEZoneLayout::MPEZoneLayout ( const MPEZoneLayout other)

Copy constuctor.

This will not copy the listeners registered to the MPEZoneLayout.

Definition at line 28 of file juce_MPEZoneLayout.cpp.

Member Function Documentation

◆ operator=()

MPEZoneLayout & juce::MPEZoneLayout::operator= ( const MPEZoneLayout other)

Copy assignment operator.

This will not copy the listeners registered to the MPEZoneLayout.

Definition at line 34 of file juce_MPEZoneLayout.cpp.

References juce::MPEZoneLayout::Listener::zoneLayoutChanged().

◆ setLowerZone()

void juce::MPEZoneLayout::setLowerZone ( int  numMemberChannels = 0,
int  perNotePitchbendRange = 48,
int  masterPitchbendRange = 2 
)
noexcept

◆ setUpperZone()

void juce::MPEZoneLayout::setUpperZone ( int  numMemberChannels = 0,
int  perNotePitchbendRange = 48,
int  masterPitchbendRange = 2 
)
noexcept

Sets the upper zone of this layout.

Definition at line 82 of file juce_MPEZoneLayout.cpp.

Referenced by juce::MPEChannelRemapper::clearSource(), processNextMidiEvent(), removeListener(), and juce::MPEMessages::setZoneLayout().

◆ getLowerZone()

◆ getUpperZone()

◆ processNextMidiEvent()

void juce::MPEZoneLayout::processNextMidiEvent ( const MidiMessage message)

Pass incoming MIDI messages to an object of this class if you want the zone layout to properly react to MPE RPN messages like an MPE device.

MPEMessages::rpnNumber will add or remove zones; RPN 0 will set the per-note or master pitchbend ranges.

Any other MIDI messages will be ignored by this class.

See also
MPEMessages

Definition at line 96 of file juce_MPEZoneLayout.cpp.

References juce::MidiRPNMessage::channel, juce::MidiMessage::getChannel(), juce::MidiMessage::getControllerNumber(), juce::MidiMessage::getControllerValue(), juce::MidiMessage::isController(), juce::MidiRPNMessage::parameterNumber, juce::MidiRPNDetector::parseControllerMessage(), setLowerZone(), setUpperZone(), juce::MidiRPNMessage::value, and juce::MPEMessages::zoneLayoutMessagesRpnNumber.

Referenced by processNextMidiBuffer(), juce::MPEInstrument::processNextMidiEvent(), and removeListener().

◆ processNextMidiBuffer()

void juce::MPEZoneLayout::processNextMidiBuffer ( const MidiBuffer buffer)

Pass incoming MIDI buffers to an object of this class if you want the zone layout to properly react to MPE RPN messages like an MPE device.

MPEMessages::rpnNumber will add or remove zones; RPN 0 will set the per-note or master pitchbend ranges.

Any other MIDI messages will be ignored by this class.

See also
MPEMessages

Definition at line 170 of file juce_MPEZoneLayout.cpp.

References juce::MidiBuffer::Iterator::getNextEvent(), and processNextMidiEvent().

Referenced by removeListener().

◆ addListener()

void juce::MPEZoneLayout::addListener ( Listener *const  listenerToAdd)
noexcept

Adds a listener.

Definition at line 181 of file juce_MPEZoneLayout.cpp.

◆ removeListener()

void juce::MPEZoneLayout::removeListener ( Listener *const  listenerToRemove)
noexcept

The documentation for this class was generated from the following files: