This struct represents an MPE Zone. More...

Public Member Functions

 MPEZone (int masterChannel, int numNoteChannels, int perNotePitchbendRange=48, int masterPitchbendRange=2) noexcept
 Constructor. More...
 
int getMasterChannel () const noexcept
 
int getNumNoteChannels () const noexcept
 Returns the number of note channels occupied by this zone. More...
 
int getFirstNoteChannel () const noexcept
 
int getLastNoteChannel () const noexcept
 
Range< int > getNoteChannelRange () const noexcept
 Returns the MIDI channel numbers (in the range 1-16) of the note channels of this zone as a Range. More...
 
bool isUsingChannel (int channel) const noexcept
 Returns true if the MIDI channel (in the range 1-16) is used by this zone either as a note channel or as the master channel; false otherwise. More...
 
bool isUsingChannelAsNoteChannel (int channel) const noexcept
 Returns true if the MIDI channel (in the range 1-16) is used by this zone as a note channel; false otherwise. More...
 
int getPerNotePitchbendRange () const noexcept
 Returns the per-note pitchbend range in semitones set for this zone. More...
 
int getMasterPitchbendRange () const noexcept
 Returns the master pitchbend range in semitones set for this zone. More...
 
void setPerNotePitchbendRange (int rangeInSemitones) noexcept
 Sets the per-note pitchbend range in semitones for this zone. More...
 
void setMasterPitchbendRange (int rangeInSemitones) noexcept
 Sets the master pitchbend range in semitones for this zone. More...
 
bool overlapsWith (MPEZone other) const noexcept
 Returns true if the MIDI channels occupied by this zone overlap with those occupied by the other zone. More...
 
bool truncateToFit (MPEZone zoneToAvoid) noexcept
 Tries to truncate this zone in such a way that the range of MIDI channels it occupies do not overlap with the other zone, by reducing this zone's number of note channels. More...
 
bool operator== (const MPEZone &other) const noexcept
 
bool operator!= (const MPEZone &other) const noexcept
 

Detailed Description

This struct represents an MPE Zone.

An MPE Zone occupies one master MIDI channel and an arbitrary number of note channels that immediately follow the master channel. It also defines a pitchbend range (in semitones) to be applied for per-note pitchbends and master pitchbends, respectively.

See also
MPEZoneLayout

Constructor & Destructor Documentation

◆ MPEZone()

MPEZone::MPEZone ( int  masterChannel,
int  numNoteChannels,
int  perNotePitchbendRange = 48,
int  masterPitchbendRange = 2 
)
noexcept

Constructor.

Creates an MPE zone with the given master channel and number of note channels.

Parameters
masterChannelThe master MIDI channel of the new zone. All master (not per-note) messages should be send to this channel. Must be between 1 and 15. Otherwise, the behaviour is undefined.
numNoteChannelsThe number of note channels that the new zone should use. The first note channel will be one higher than the master channel. The number of note channels must be at least 1 and no greater than 16 - masterChannel. Otherwise, the behaviour is undefined.
perNotePitchbendRangeThe per-note pitchbend range in semitones of the new zone. Must be between 0 and 96. Otherwise the behaviour is undefined. If unspecified, the default setting of +/- 48 semitones will be used.
masterPitchbendRangeThe master pitchbend range in semitones of the new zone. Must be between 0 and 96. Otherwise the behaviour is undefined. If unspecified, the default setting of +/- 2 semitones will be used.

Member Function Documentation

◆ getMasterChannel()

int MPEZone::getMasterChannel ( ) const
noexcept

◆ getNumNoteChannels()

int MPEZone::getNumNoteChannels ( ) const
noexcept

Returns the number of note channels occupied by this zone.

◆ getFirstNoteChannel()

int MPEZone::getFirstNoteChannel ( ) const
noexcept

◆ getLastNoteChannel()

int MPEZone::getLastNoteChannel ( ) const
noexcept

◆ getNoteChannelRange()

Range<int> MPEZone::getNoteChannelRange ( ) const
noexcept

Returns the MIDI channel numbers (in the range 1-16) of the note channels of this zone as a Range.

◆ isUsingChannel()

bool MPEZone::isUsingChannel ( int  channel) const
noexcept

Returns true if the MIDI channel (in the range 1-16) is used by this zone either as a note channel or as the master channel; false otherwise.

◆ isUsingChannelAsNoteChannel()

bool MPEZone::isUsingChannelAsNoteChannel ( int  channel) const
noexcept

Returns true if the MIDI channel (in the range 1-16) is used by this zone as a note channel; false otherwise.

◆ getPerNotePitchbendRange()

int MPEZone::getPerNotePitchbendRange ( ) const
noexcept

Returns the per-note pitchbend range in semitones set for this zone.

◆ getMasterPitchbendRange()

int MPEZone::getMasterPitchbendRange ( ) const
noexcept

Returns the master pitchbend range in semitones set for this zone.

◆ setPerNotePitchbendRange()

void MPEZone::setPerNotePitchbendRange ( int  rangeInSemitones)
noexcept

Sets the per-note pitchbend range in semitones for this zone.

◆ setMasterPitchbendRange()

void MPEZone::setMasterPitchbendRange ( int  rangeInSemitones)
noexcept

Sets the master pitchbend range in semitones for this zone.

◆ overlapsWith()

bool MPEZone::overlapsWith ( MPEZone  other) const
noexcept

Returns true if the MIDI channels occupied by this zone overlap with those occupied by the other zone.

◆ truncateToFit()

bool MPEZone::truncateToFit ( MPEZone  zoneToAvoid)
noexcept

Tries to truncate this zone in such a way that the range of MIDI channels it occupies do not overlap with the other zone, by reducing this zone's number of note channels.

Returns
true if the truncation succeeded or if no truncation is necessary because the zones do not overlap. False if the zone cannot be truncated in a way that would remove the overlap (in this case you need to delete the zone to remove the overlap).

◆ operator==()

bool MPEZone::operator== ( const MPEZone other) const
noexcept
Returns
true if this zone is equal to the one passed in.

◆ operator!=()

bool MPEZone::operator!= ( const MPEZone other) const
noexcept
Returns
true if this zone is not equal to the one passed in.

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