JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::MPEZoneLayout Class Reference

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

#include <juce_MPEZoneLayout.h>

Collaboration diagram for juce::MPEZoneLayout:

Classes

class  Listener
 Listener class. More...
 

Public Member Functions

 MPEZoneLayout ()=default
 Creates a layout with inactive upper and lower zones. More...
 
 MPEZoneLayout (const MPEZoneLayout &other)
 
 MPEZoneLayout (MPEZone lower, MPEZone upper)
 Creates a layout with the given upper and lower zones. More...
 
 MPEZoneLayout (MPEZone singleZone)
 Creates a layout with a single upper or lower zone, leaving the other zone uninitialised. More...
 
void addListener (Listener *const listenerToAdd) noexcept
 Adds a listener. More...
 
void clearAllZones ()
 Clears the lower and upper zones of this layout, making them both inactive and disabling MPE mode. More...
 
MPEZone getLowerZone () const noexcept
 Returns a struct representing the lower MPE zone. More...
 
MPEZone getUpperZone () const noexcept
 Returns a struct representing the upper MPE zone. More...
 
bool isActive () const
 Returns true if either of the zones are active. More...
 
bool operator!= (const MPEZoneLayout &other) const
 
MPEZoneLayoutoperator= (const MPEZoneLayout &other)
 
bool operator== (const MPEZoneLayout &other) const
 
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 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 removeListener (Listener *const listenerToRemove) noexcept
 Removes a listener. 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...
 

Private Member Functions

void checkAndLimitZoneParameters (int, int, int &) noexcept
 
void processPitchbendRangeRpnMessage (MidiRPNMessage)
 
void processRpnMessage (MidiRPNMessage)
 
void processZoneLayoutRpnMessage (MidiRPNMessage)
 
void sendLayoutChangeMessage ()
 
void setZone (bool, int, int, int) noexcept
 
void updateMasterPitchbend (MPEZone &, int)
 
void updatePerNotePitchbendRange (MPEZone &, int)
 

Private Attributes

ListenerList< Listenerlisteners
 
MPEZone lowerZone { MPEZone::Type::lower, 0 }
 
MidiRPNDetector rpnDetector
 
MPEZone upperZone { MPEZone::Type::upper, 0 }
 

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

@tags{Audio}

Constructor & Destructor Documentation

◆ MPEZoneLayout() [1/4]

juce::MPEZoneLayout::MPEZoneLayout ( )
default

Creates a layout with inactive upper and lower zones.

◆ MPEZoneLayout() [2/4]

juce::MPEZoneLayout::MPEZoneLayout ( MPEZone  lower,
MPEZone  upper 
)

Creates a layout with the given upper and lower zones.

◆ MPEZoneLayout() [3/4]

juce::MPEZoneLayout::MPEZoneLayout ( MPEZone  singleZone)

Creates a layout with a single upper or lower zone, leaving the other zone uninitialised.

◆ MPEZoneLayout() [4/4]

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

Member Function Documentation

◆ addListener()

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

Adds a listener.

◆ checkAndLimitZoneParameters()

void juce::MPEZoneLayout::checkAndLimitZoneParameters ( int  ,
int  ,
int  
)
privatenoexcept

◆ clearAllZones()

void juce::MPEZoneLayout::clearAllZones ( )

Clears the lower and upper zones of this layout, making them both inactive and disabling MPE mode.

◆ getLowerZone()

MPEZone juce::MPEZoneLayout::getLowerZone ( ) const
inlinenoexcept

Returns a struct representing the lower MPE zone.

◆ getUpperZone()

MPEZone juce::MPEZoneLayout::getUpperZone ( ) const
inlinenoexcept

Returns a struct representing the upper MPE zone.

◆ isActive()

bool juce::MPEZoneLayout::isActive ( ) const
inline

Returns true if either of the zones are active.

References juce::MPEZone::isActive().

◆ operator!=()

bool juce::MPEZoneLayout::operator!= ( const MPEZoneLayout other) const
inline

References juce::operator==().

◆ operator=()

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

◆ operator==()

bool juce::MPEZoneLayout::operator== ( const MPEZoneLayout other) const
inline

References lowerZone, and upperZone.

◆ 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

◆ 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

◆ processPitchbendRangeRpnMessage()

void juce::MPEZoneLayout::processPitchbendRangeRpnMessage ( MidiRPNMessage  )
private

◆ processRpnMessage()

void juce::MPEZoneLayout::processRpnMessage ( MidiRPNMessage  )
private

◆ processZoneLayoutRpnMessage()

void juce::MPEZoneLayout::processZoneLayoutRpnMessage ( MidiRPNMessage  )
private

◆ removeListener()

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

Removes a listener.

◆ sendLayoutChangeMessage()

void juce::MPEZoneLayout::sendLayoutChangeMessage ( )
private

◆ setLowerZone()

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

Sets the lower zone of this layout.

◆ setUpperZone()

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

Sets the upper zone of this layout.

◆ setZone()

void juce::MPEZoneLayout::setZone ( bool  ,
int  ,
int  ,
int   
)
privatenoexcept

◆ updateMasterPitchbend()

void juce::MPEZoneLayout::updateMasterPitchbend ( MPEZone ,
int   
)
private

◆ updatePerNotePitchbendRange()

void juce::MPEZoneLayout::updatePerNotePitchbendRange ( MPEZone ,
int   
)
private

Member Data Documentation

◆ listeners

ListenerList<Listener> juce::MPEZoneLayout::listeners
private

◆ lowerZone

MPEZone juce::MPEZoneLayout::lowerZone { MPEZone::Type::lower, 0 }
private

Referenced by operator==().

◆ rpnDetector

MidiRPNDetector juce::MPEZoneLayout::rpnDetector
private

◆ upperZone

MPEZone juce::MPEZoneLayout::upperZone { MPEZone::Type::upper, 0 }
private

Referenced by operator==().


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