|
| MPEInstrument () noexcept |
| Constructor. More...
|
|
virtual | ~MPEInstrument () |
| Destructor. More...
|
|
void | addListener (Listener *listenerToAdd) |
| Adds a listener. More...
|
|
void | enableLegacyMode (int pitchbendRange=2, Range< int > channelRange=Range< int >(1, 17)) |
| Puts the instrument into legacy mode. More...
|
|
Range< int > | getLegacyModeChannelRange () const noexcept |
| Returns the range of MIDI channels (1-16) to be used for notes when in legacy mode. More...
|
|
int | getLegacyModePitchbendRange () const noexcept |
| Returns the pitchbend range in semitones (0-96) to be used for notes when in legacy mode. More...
|
|
MPENote | getMostRecentNote (int midiChannel) const noexcept |
| Returns the most recent note that is playing on the given midiChannel (this will be the note which has received the most recent note-on without a corresponding note-off), if there is such a note. More...
|
|
MPENote | getMostRecentNoteOtherThan (MPENote otherThanThisNote) const noexcept |
| Returns the most recent note that is not the note passed in. More...
|
|
MPENote | getNote (int index) const noexcept |
| Returns the note at the given index. More...
|
|
MPENote | getNote (int midiChannel, int midiNoteNumber) const noexcept |
| Returns the note currently playing on the given midiChannel with the specified initial MIDI note number, if there is such a note. More...
|
|
int | getNumPlayingNotes () const noexcept |
| Returns the number of MPE notes currently played by the instrument. More...
|
|
MPEZoneLayout | getZoneLayout () const noexcept |
| Returns the current zone layout of the instrument. More...
|
|
bool | isLegacyModeEnabled () const noexcept |
| Returns true if the instrument is in legacy mode, false otherwise. More...
|
|
bool | isMasterChannel (int midiChannel) const noexcept |
| Returns true if the given MIDI channel (1-16) is a master channel (channel 1 or 16). More...
|
|
bool | isMemberChannel (int midiChannel) noexcept |
| Returns true if the given MIDI channel (1-16) is a note channel in any of the MPEInstrument's MPE zones; false otherwise. More...
|
|
virtual void | noteOff (int midiChannel, int midiNoteNumber, MPEValue midiNoteOffVelocity) |
| Request a note-off. More...
|
|
virtual void | noteOn (int midiChannel, int midiNoteNumber, MPEValue midiNoteOnVelocity) |
| Request a note-on on the given channel, with the given initial note number and velocity. More...
|
|
virtual void | pitchbend (int midiChannel, MPEValue pitchbend) |
| Request a pitchbend on the given channel with the given value (in units of MIDI pitchwheel position). More...
|
|
virtual void | pressure (int midiChannel, MPEValue value) |
| Request a pressure change on the given channel with the given value. More...
|
|
virtual void | processNextMidiEvent (const MidiMessage &message) |
| Process a MIDI message and trigger the appropriate method calls (noteOn, noteOff etc.) More...
|
|
void | releaseAllNotes () |
| Discard all currently playing notes. More...
|
|
void | removeListener (Listener *listenerToRemove) |
| Removes a listener. More...
|
|
void | setLegacyModeChannelRange (Range< int > channelRange) |
| Re-sets the range of MIDI channels (1-16) to be used for notes when in legacy mode. More...
|
|
void | setLegacyModePitchbendRange (int pitchbendRange) |
| Re-sets the pitchbend range in semitones (0-96) to be used for notes when in legacy mode. More...
|
|
void | setPitchbendTrackingMode (TrackingMode modeToUse) |
| Set the MPE tracking mode for the pitchbend dimension. More...
|
|
void | setPressureTrackingMode (TrackingMode modeToUse) |
| Set the MPE tracking mode for the pressure dimension. More...
|
|
void | setTimbreTrackingMode (TrackingMode modeToUse) |
| Set the MPE tracking mode for the timbre dimension. More...
|
|
void | setZoneLayout (MPEZoneLayout newLayout) |
| Re-sets the zone layout of the instrument to the one passed in. More...
|
|
virtual void | sostenutoPedal (int midiChannel, bool isDown) |
| Request a sostenuto pedal press or release. More...
|
|
virtual void | sustainPedal (int midiChannel, bool isDown) |
| Request a sustain pedal press or release. More...
|
|
virtual void | timbre (int midiChannel, MPEValue value) |
| Request a third dimension (timbre) change on the given channel with the given value. More...
|
|
|
void | callListenersDimensionChanged (const MPENote &, const MPEDimension &) |
|
const MPENote * | getHighestNotePtr (int midiChannel) const noexcept |
|
MPENote * | getHighestNotePtr (int midiChannel) noexcept |
|
MPEValue | getInitialValueForNewNote (int midiChannel, MPEDimension &) const |
|
const MPENote * | getLastNotePlayedPtr (int midiChannel) const noexcept |
|
MPENote * | getLastNotePlayedPtr (int midiChannel) noexcept |
|
const MPENote * | getLowestNotePtr (int midiChannel) const noexcept |
|
MPENote * | getLowestNotePtr (int midiChannel) noexcept |
|
const MPENote * | getNotePtr (int midiChannel, int midiNoteNumber) const noexcept |
|
MPENote * | getNotePtr (int midiChannel, int midiNoteNumber) noexcept |
|
const MPENote * | getNotePtr (int midiChannel, TrackingMode) const noexcept |
|
MPENote * | getNotePtr (int midiChannel, TrackingMode) noexcept |
|
void | handlePressureLSB (int midiChannel, int value) noexcept |
|
void | handlePressureMSB (int midiChannel, int value) noexcept |
|
void | handleSustainOrSostenuto (int midiChannel, bool isDown, bool isSostenuto) |
|
void | handleTimbreLSB (int midiChannel, int value) noexcept |
|
void | handleTimbreMSB (int midiChannel, int value) noexcept |
|
void | processMidiChannelPressureMessage (const MidiMessage &) |
|
void | processMidiControllerMessage (const MidiMessage &) |
|
void | processMidiNoteOffMessage (const MidiMessage &) |
|
void | processMidiNoteOnMessage (const MidiMessage &) |
|
void | processMidiPitchWheelMessage (const MidiMessage &) |
|
void | processMidiResetAllControllersMessage (const MidiMessage &) |
|
void | updateDimension (int midiChannel, MPEDimension &, MPEValue) |
|
void | updateDimensionForNote (MPENote &, MPEDimension &, MPEValue) |
|
void | updateDimensionMaster (bool, MPEDimension &, MPEValue) |
|
void | updateNoteTotalPitchbend (MPENote &) |
|
This class represents an instrument handling MPE.
It has an MPE zone layout and maintans a state of currently active (playing) notes and the values of their dimensions of expression.
You can trigger and modulate notes:
- by passing MIDI messages with the method processNextMidiEvent;
- by directly calling the methods noteOn, noteOff etc.
The class implements the channel and note management logic specified in MPE. If you pass it a message, it will know what notes on what channels (if any) should be affected by that message.
The class has a Listener class with the three callbacks MPENoteAdded, MPENoteChanged, and MPENoteFinished. Implement such a Listener class to react to note changes and trigger some functionality for your application that depends on the MPE note state. For example, you can use this class to write an MPE visualiser.
If you want to write a real-time audio synth with MPE functionality, you should instead use the classes MPESynthesiserBase, which adds the ability to render audio and to manage voices.
- See also
- MPENote, MPEZoneLayout, MPESynthesiser
{Audio}
void juce::MPEInstrument::enableLegacyMode |
( |
int |
pitchbendRange = 2 , |
|
|
Range< int > |
channelRange = Range< int >(1, 17) |
|
) |
| |
Puts the instrument into legacy mode.
As a side effect, this will discard all currently playing notes, and call noteReleased for all of them.
This special zone layout mode is for backwards compatibility with non-MPE MIDI devices. In this mode, the instrument will ignore the current MPE zone layout. It will instead take a range of MIDI channels (default: all channels 1-16) and treat them as note channels, with no master channel. MIDI channels outside of this range will be ignored.
- Parameters
-
pitchbendRange | The note pitchbend range in semitones to use when in legacy mode. Must be between 0 and 96, otherwise behaviour is undefined. The default pitchbend range in legacy mode is +/- 2 semitones. |
channelRange | The range of MIDI channels to use for notes when in legacy mode. The default is to use all MIDI channels (1-16). |
To get out of legacy mode, set a new MPE zone layout using setZoneLayout.