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

Classes

class  Listener
 Listener class. More...
 

Public Member Functions

 MPEZoneLayout () noexcept
 Default constructor. More...
 
 MPEZoneLayout (const MPEZoneLayout &other)
 Copy constuctor. More...
 
MPEZoneLayoutoperator= (const MPEZoneLayout &other)
 Copy assignment operator. More...
 
bool addZone (MPEZone newZone)
 Adds a new MPE zone to the layout. More...
 
void clearAllZones ()
 Removes all currently present MPE zones. More...
 
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...
 
int getNumZones () const noexcept
 Returns the current number of MPE zones. More...
 
MPEZonegetZoneByIndex (int index) const noexcept
 Returns a pointer to the MPE zone at the given index, or nullptr if there is no such zone. More...
 
MPEZonegetZoneByChannel (int midiChannel) const noexcept
 Returns a pointer to the zone which uses the specified channel (1-16), or nullptr if there is no such zone. More...
 
MPEZonegetZoneByMasterChannel (int midiChannel) const noexcept
 Returns a pointer to the zone which has the specified channel (1-16) as its master channel, or nullptr if there is no such zone. More...
 
MPEZonegetZoneByFirstNoteChannel (int midiChannel) const noexcept
 Returns a pointer to the zone which has the specified channel (1-16) as its first note channel, or nullptr if there is no such zone. More...
 
MPEZonegetZoneByNoteChannel (int midiChannel) const noexcept
 Returns a pointer to the zone which has the specified channel (1-16) as one of its note channels, or nullptr if there is no such zone. 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.

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
MPEZone, MPEInstrument

Constructor & Destructor Documentation

◆ MPEZoneLayout() [1/2]

MPEZoneLayout::MPEZoneLayout ( )
noexcept

Default constructor.

This will create a layout with no MPE zones. You can add an MPE zone using the method addZone.

◆ MPEZoneLayout() [2/2]

MPEZoneLayout::MPEZoneLayout ( const MPEZoneLayout other)

Copy constuctor.

This will not copy the listeners registered to the MPEZoneLayout.

Member Function Documentation

◆ operator=()

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

Copy assignment operator.

This will not copy the listeners registered to the MPEZoneLayout.

◆ addZone()

bool MPEZoneLayout::addZone ( MPEZone  newZone)

Adds a new MPE zone to the layout.

Parameters
newZoneThe zone to add.
Returns
true if the zone was added without modifying any other zones added previously to the same zone layout object (if any); false if any existing MPE zones had to be truncated or deleted entirely in order to to add this new zone. (Note: the zone itself will always be added with the channel bounds that were specified; this will not fail.)

◆ clearAllZones()

void MPEZoneLayout::clearAllZones ( )

Removes all currently present MPE zones.

◆ processNextMidiEvent()

void 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

◆ processNextMidiBuffer()

void 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

◆ getNumZones()

int MPEZoneLayout::getNumZones ( ) const
noexcept

Returns the current number of MPE zones.

◆ getZoneByIndex()

MPEZone* MPEZoneLayout::getZoneByIndex ( int  index) const
noexcept

Returns a pointer to the MPE zone at the given index, or nullptr if there is no such zone.

Zones are sorted by insertion order (most recently added zone last).

◆ getZoneByChannel()

MPEZone* MPEZoneLayout::getZoneByChannel ( int  midiChannel) const
noexcept

Returns a pointer to the zone which uses the specified channel (1-16), or nullptr if there is no such zone.

◆ getZoneByMasterChannel()

MPEZone* MPEZoneLayout::getZoneByMasterChannel ( int  midiChannel) const
noexcept

Returns a pointer to the zone which has the specified channel (1-16) as its master channel, or nullptr if there is no such zone.

◆ getZoneByFirstNoteChannel()

MPEZone* MPEZoneLayout::getZoneByFirstNoteChannel ( int  midiChannel) const
noexcept

Returns a pointer to the zone which has the specified channel (1-16) as its first note channel, or nullptr if there is no such zone.

◆ getZoneByNoteChannel()

MPEZone* MPEZoneLayout::getZoneByNoteChannel ( int  midiChannel) const
noexcept

Returns a pointer to the zone which has the specified channel (1-16) as one of its note channels, or nullptr if there is no such zone.

◆ addListener()

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

Adds a listener.

◆ removeListener()

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

Removes a listener.


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