|
LMMS
|
#include <juce_MPEUtils.h>
Classes | |
| struct | MidiChannel |
Public Member Functions | |
| MPEChannelAssigner (MPEZoneLayout::Zone zoneToUse) | |
| MPEChannelAssigner (Range< int > channelRange=Range< int >(1, 17)) | |
| int | findMidiChannelForNewNote (int noteNumber) noexcept |
| int | findMidiChannelForExistingNote (int initialNoteOnNumber) noexcept |
| void | noteOff (int noteNumber, int midiChannel=-1) |
| void | allNotesOff () |
Private Member Functions | |
| int | findMidiChannelPlayingClosestNonequalNote (int noteNumber) noexcept |
Private Attributes | |
| bool | isLegacy = false |
| std::unique_ptr< MPEZoneLayout::Zone > | zone |
| int | channelIncrement |
| int | numChannels |
| int | firstChannel |
| int | lastChannel |
| int | midiChannelLastAssigned |
| std::array< MidiChannel, 17 > | midiChannels |
This class handles the assignment of new MIDI notes to member channels of an active MPE zone.
To use it, create an instance passing in the MPE zone that it should operate on and then call use the findMidiChannelForNewNote() method for all note-on messages and the noteOff() method for all note-off messages.
@tags{Audio}
| juce::MPEChannelAssigner::MPEChannelAssigner | ( | MPEZoneLayout::Zone | zoneToUse | ) |
Constructor.
This will assign channels within the range of the specified MPE zone.
Legacy mode constructor.
This will assign channels within the specified range.
| void juce::MPEChannelAssigner::allNotesOff | ( | ) |
Call this to clear all currently playing notes.
If a note has been added using findMidiChannelForNewNote() this will return the channel to which it was assigned, otherwise it will return -1.
This method will use a set of rules recommended in the MPE specification to determine which member channel the specified MIDI note should be assigned to and will return this channel number.
The rules have the following precedence:
| noteNumber | the MIDI note number to be assigned to a channel |
|
privatenoexcept |
You must call this method for all note-offs that you receive so that this class can keep track of the currently playing notes internally.
You can specify the channel number the note off happened on. If you don't, it will look through all channels to find the registered midi note matching the given note number.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |