OpenWareLaboratory
|
Implementation of MPE (MIDI Polyphonic Expression) message processing. More...
Public Member Functions | |
void | allNotesOff () |
void | allNotesOn () |
void | channelPressure (MidiMessage msg) |
void | controlChange (MidiMessage msg) |
uint8_t | findFreeVoice (MidiMessage msg) |
uint8_t | getNoteChannel (MidiMessage msg) |
float | getPitchBendRange () |
bool | getSustain () |
float | getTuning () |
SynthVoice * | getVoice (size_t index) |
bool | isMasterChannel (MidiMessage msg) |
MidiPolyphonicExpressionProcessor () | |
virtual void | modulate (MidiMessage msg) |
void | noteOff (MidiMessage msg) |
void | noteOn (MidiMessage msg) |
void | pitchbend (MidiMessage msg) |
void | polyKeyPressure (MidiMessage msg) |
virtual void | process (MidiMessage msg) |
void | releaseVoicesForNote (MidiMessage msg) |
void | rpn (uint16_t id, uint8_t msb, uint8_t lsb, MidiMessage msg) |
void | setDynamicRange (float range) |
Set the MIDI velocity dynamic range in dB, default 72dB. More... | |
void | setModulationDepthRange (float range) |
Set modulation depth range, from 0 to 1.0. More... | |
void | setParameter (uint8_t parameter_id, float value) |
void | setPitchBendRange (float range) |
Set pitch bend range in semitones. More... | |
void | setSustain (bool value) |
void | setTuning (float frequency) |
void | setVoice (size_t index, SynthVoice *obj) |
void | sustain (MidiMessage msg) |
void | sustainOff () |
virtual | ~MidiPolyphonicExpressionProcessor () |
Protected Member Functions | |
void | release (uint8_t ch) |
void | take (uint8_t ch, MidiMessage msg) |
Static Protected Member Functions | |
static float | frequencyToNote (float freq) |
static float | noteToFrequency (float note) |
Protected Attributes | |
uint16_t | allocated |
uint16_t | allocation [VOICES] |
bool | dosustain = false |
uint8_t | master_channel = 1 |
float | mod_range = 0.5/127.0f |
float | modulation [VOICES] |
float | note_pitchbend_range = 48 |
uint8_t | notes [VOICES] |
float | pb_range = 2/8192.0f |
float | pressure [VOICES] |
uint16_t | rpn_id = 0 |
uint8_t | rpn_msb = 0 |
uint8_t | tuning_semitones = 69 |
SynthVoice * | voice [VOICES] |
float | zone_modulation = 0 |
float | zone_pitchbend = 0 |
float | zone_pressure = 0 |
Static Protected Attributes | |
static const uint16_t | TAKEN = 0xffff |
Implementation of MPE (MIDI Polyphonic Expression) message processing.
We are controlling an AbstractSynth with: X: Pitch Bend: setFrequency() Y: CC74 or CC1 : setModulation() Z: Channel Pressure : setPressure()
Definition at line 16 of file MidiPolyphonicExpressionProcessor.h.
|
inline |
Definition at line 46 of file MidiPolyphonicExpressionProcessor.h.
|
inlinevirtual |
Definition at line 47 of file MidiPolyphonicExpressionProcessor.h.
|
inlineinherited |
Definition at line 53 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
Referenced by VoiceAllocator< SynthVoice, VOICES >::controlChange().
|
inlineinherited |
Definition at line 58 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
|
inlinevirtual |
Reimplemented from MidiProcessor.
Definition at line 181 of file MidiPolyphonicExpressionProcessor.h.
References MidiMessage::getChannelPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::getNoteChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::isMasterChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pressure, VoiceAllocator< SynthVoice, VOICES >::voice, and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::zone_pressure.
|
inlinevirtual |
Reimplemented from MidiProcessor.
Definition at line 94 of file MidiPolyphonicExpressionProcessor.h.
References VoiceAllocator< SynthVoice, VOICES >::controlChange(), MidiMessage::getControllerNumber(), MidiMessage::getControllerValue(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::getNoteChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::isMasterChannel(), MIDI_CC_FREQ_CUTOFF, MIDI_CC_MODULATION, VoiceAllocator< SynthVoice, VOICES >::mod_range, MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::modulation, VoiceAllocator< SynthVoice, VOICES >::voice, and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::zone_modulation.
|
inline |
Definition at line 49 of file MidiPolyphonicExpressionProcessor.h.
References MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::allocation, MidiMessage::getNote(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::notes.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOn().
|
inlinestaticprotectedinherited |
Definition at line 17 of file VoiceAllocator.h.
|
inline |
Definition at line 155 of file MidiPolyphonicExpressionProcessor.h.
References MidiMessage::getChannel(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::master_channel.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::channelPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::controlChange(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOff(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOn(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pitchbend().
|
inlineinherited |
Definition at line 21 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pitchbend().
|
inlineinherited |
Definition at line 78 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::dosustain.
|
inlineinherited |
Definition at line 46 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
|
inlineinherited |
Definition at line 66 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
|
inline |
Definition at line 152 of file MidiPolyphonicExpressionProcessor.h.
References MidiMessage::getChannel(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::master_channel.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::channelPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::controlChange(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOff(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOn(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pitchbend(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::polyKeyPressure(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::rpn().
|
inlinevirtualinherited |
Reimplemented in PolyphonicProcessor< SynthVoice, VOICES >, MonophonicProcessor< SynthVoice >, and AbstractSynth.
Definition at line 17 of file MidiProcessor.h.
Referenced by VoiceAllocator< SynthVoice, VOICES >::controlChange().
|
inlinevirtual |
Reimplemented from MidiProcessor.
Definition at line 85 of file MidiPolyphonicExpressionProcessor.h.
References MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::getNoteChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::isMasterChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::release(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::releaseVoicesForNote().
|
inlinevirtual |
Reimplemented from MidiProcessor.
Definition at line 75 of file MidiPolyphonicExpressionProcessor.h.
References MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::findFreeVoice(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::getNoteChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::isMasterChannel(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::take().
|
inlinestaticprotectedinherited |
Definition at line 14 of file VoiceAllocator.h.
Referenced by VoiceAllocator< SynthVoice, VOICES >::rpn().
|
inlinevirtual |
Reimplemented from MidiProcessor.
Definition at line 165 of file MidiPolyphonicExpressionProcessor.h.
References MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::getNoteChannel(), MidiMessage::getPitchBend(), VoiceAllocator< SynthVoice, VOICES >::getPitchBendRange(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::isMasterChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::note_pitchbend_range, VoiceAllocator< SynthVoice, VOICES >::voice, and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::zone_pitchbend.
|
inlinevirtual |
Reimplemented from MidiProcessor.
Definition at line 198 of file MidiPolyphonicExpressionProcessor.h.
References MidiMessage::getNote(), MidiMessage::getPolyKeyPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::isMasterChannel(), and VoiceAllocator< SynthVoice, VOICES >::voice.
|
inlinevirtualinherited |
Definition at line 22 of file MidiProcessor.h.
References MidiProcessor::channelPressure(), MidiProcessor::controlChange(), MidiMessage::isChannelPressure(), MidiMessage::isControlChange(), MidiMessage::isNoteOff(), MidiMessage::isNoteOn(), MidiMessage::isPitchBend(), MidiMessage::isPolyKeyPressure(), MidiProcessor::noteOff(), MidiProcessor::noteOn(), MidiProcessor::pitchbend(), and MidiProcessor::polyKeyPressure().
|
inlineprotected |
Definition at line 40 of file MidiPolyphonicExpressionProcessor.h.
References MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::allocated, MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::allocation, VoiceAllocator< SynthVoice, VOICES >::dosustain, and VoiceAllocator< SynthVoice, VOICES >::voice.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOff(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::releaseVoicesForNote(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::take().
|
inline |
Definition at line 68 of file MidiPolyphonicExpressionProcessor.h.
References MidiMessage::getNote(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::notes, and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::release().
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOff().
|
inline |
Definition at line 120 of file MidiPolyphonicExpressionProcessor.h.
References MidiMessage::getChannel(), MidiMessage::getControllerValue(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::isMasterChannel(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::master_channel, MIDI_RPN_MPE_CONFIGURATION, MIDI_RPN_PITCH_BEND_RANGE, MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::note_pitchbend_range, VoiceAllocator< SynthVoice, VOICES >::rpn(), and VoiceAllocator< SynthVoice, VOICES >::setPitchBendRange().
|
inlineinherited |
Set the MIDI velocity dynamic range in dB, default 72dB.
Definition at line 42 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
|
inlineinherited |
Set modulation depth range, from 0 to 1.0.
Definition at line 35 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
Referenced by VoiceAllocator< SynthVoice, VOICES >::rpn().
|
inlineinherited |
Definition at line 71 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
|
inlineinherited |
Set pitch bend range in semitones.
Does not update the frequency; effective from next pitch bend change
Definition at line 28 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::rpn(), and VoiceAllocator< SynthVoice, VOICES >::rpn().
|
inlineinherited |
Definition at line 81 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::dosustain, and VoiceAllocator< SynthVoice, VOICES >::sustainOff().
Referenced by VoiceAllocator< SynthVoice, VOICES >::sustain().
|
inlineinherited |
Definition at line 49 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
Referenced by VoiceAllocator< SynthVoice, VOICES >::rpn().
|
inlineinherited |
Definition at line 62 of file VoiceAllocator.h.
References VoiceAllocator< SynthVoice, VOICES >::voice.
|
inlinevirtualinherited |
Reimplemented from MidiProcessor.
Definition at line 75 of file VoiceAllocator.h.
References MidiMessage::getControllerValue(), and VoiceAllocator< SynthVoice, VOICES >::setSustain().
Referenced by VoiceAllocator< SynthVoice, VOICES >::controlChange().
|
inlinevirtual |
Reimplemented from VoiceAllocator< SynthVoice, VOICES >.
Definition at line 207 of file MidiPolyphonicExpressionProcessor.h.
References MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::allocation, MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::TAKEN, and VoiceAllocator< SynthVoice, VOICES >::voice.
|
inlineprotected |
Definition at line 34 of file MidiPolyphonicExpressionProcessor.h.
References MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::allocation, MidiMessage::getNote(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::notes, MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::release(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::TAKEN, and VoiceAllocator< SynthVoice, VOICES >::voice.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::noteOn().
|
protected |
Definition at line 24 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::release().
|
protected |
Definition at line 23 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::findFreeVoice(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::release(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::sustainOff(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::take().
|
protectedinherited |
|
protected |
|
protectedinherited |
Definition at line 9 of file VoiceAllocator.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::controlChange().
|
protected |
Definition at line 26 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::controlChange().
|
protected |
Definition at line 33 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pitchbend(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::rpn().
|
protected |
Definition at line 22 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::findFreeVoice(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::releaseVoicesForNote(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::take().
|
protectedinherited |
Definition at line 8 of file VoiceAllocator.h.
|
protected |
Definition at line 25 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::channelPressure().
|
protectedinherited |
Definition at line 11 of file VoiceAllocator.h.
Referenced by VoiceAllocator< SynthVoice, VOICES >::controlChange().
|
protectedinherited |
Definition at line 12 of file VoiceAllocator.h.
Referenced by VoiceAllocator< SynthVoice, VOICES >::controlChange().
|
staticprotected |
Definition at line 21 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::sustainOff(), and MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::take().
|
protectedinherited |
Definition at line 13 of file VoiceAllocator.h.
Referenced by VoiceAllocator< SynthVoice, VOICES >::rpn().
|
protectedinherited |
Definition at line 7 of file VoiceAllocator.h.
Referenced by VoiceAllocator< SynthVoice, VOICES >::allNotesOff(), VoiceAllocator< SynthVoice, VOICES >::allNotesOn(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::channelPressure(), PolyphonicProcessor< SynthVoice, VOICES >::channelPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::controlChange(), VoiceAllocator< SynthVoice, VOICES >::getPitchBendRange(), VoiceAllocator< SynthVoice, VOICES >::getTuning(), VoiceAllocator< SynthVoice, VOICES >::getVoice(), PolyphonicProcessor< SynthVoice, VOICES >::modulate(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pitchbend(), PolyphonicProcessor< SynthVoice, VOICES >::pitchbend(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::polyKeyPressure(), PolyphonicProcessor< SynthVoice, VOICES >::polyKeyPressure(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::release(), PolyphonicProcessor< SynthVoice, VOICES >::release(), VoiceAllocator< SynthVoice, VOICES >::setDynamicRange(), VoiceAllocator< SynthVoice, VOICES >::setModulationDepthRange(), VoiceAllocator< SynthVoice, VOICES >::setParameter(), VoiceAllocator< SynthVoice, VOICES >::setPitchBendRange(), VoiceAllocator< SynthVoice, VOICES >::setTuning(), VoiceAllocator< SynthVoice, VOICES >::setVoice(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::sustainOff(), PolyphonicProcessor< SynthVoice, VOICES >::sustainOff(), MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::take(), and PolyphonicProcessor< SynthVoice, VOICES >::take().
|
protected |
Definition at line 32 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::controlChange().
|
protected |
Definition at line 30 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::pitchbend().
|
protected |
Definition at line 31 of file MidiPolyphonicExpressionProcessor.h.
Referenced by MidiPolyphonicExpressionProcessor< SynthVoice, VOICES >::channelPressure().