Allolib
1.0
C++ Components For Interactive Multimedia
|
The ParameterMIDI class connects Parameter objects to MIDI messages. More...
Classes | |
struct | AbstractBinding |
struct | ControlBinding |
struct | IncrementBinding |
struct | NoteBinding |
struct | ToggleBinding |
Public Member Functions | |
ParameterMIDI (unsigned int deviceIndex, bool verbose=false) | |
void | open (unsigned int deviceIndex=0) |
void | open (int deviceIndex, bool verbose) |
void | init (int deviceIndex=0, bool verbose=false) |
void | close () |
void | connectControl (Parameter ¶m, int controlNumber, int channel) |
void | connectControl (Parameter ¶m, int controlNumber, int channel, float min, float max) |
void | connectControls (ParameterMeta ¶m, std::vector< int > controlNumbers, int channel=1, std::vector< float > min={}, std::vector< float > max={}) |
void | connectNoteToValue (Parameter ¶m, int channel, float min, int low, float max=-1, int high=-1) |
connectNoteToValue More... | |
void | connectNoteToToggle (ParameterBool ¶m, int channel, int note) |
void | connectNoteToIncrement (Parameter ¶m, int channel, int note, float increment) |
bool | isOpen () |
virtual void | onMIDIMessage (const MIDIMessage &m) override |
Called when a MIDI message is received. | |
void | verbose (bool v) |
std::vector< ControlBinding > | getCurrentControlBindings () |
std::vector< NoteBinding > | getCurrentNoteBindings () |
void | bindTo (RtMidiIn &RtMidiIn, unsigned port=0) |
Bind handler to a MIDI input. | |
void | clearBindings () |
Protected Attributes | |
std::vector< Binding > | mBindings |
The ParameterMIDI class connects Parameter objects to MIDI messages.
Definition at line 70 of file al_ParameterMIDI.hpp.
void al::ParameterMIDI::connectControls | ( | ParameterMeta & | param, |
std::vector< int > | controlNumbers, | ||
int | channel = 1 , |
||
std::vector< float > | min = {} , |
||
std::vector< float > | max = {} |
||
) |
Connect multiple MIDI controls to multivalue parameter.
This allows connecting 3 different MIDI controls to the R,G,B values of ParameterColor or to the x,y,z values of ParameterPose
void al::ParameterMIDI::connectNoteToValue | ( | Parameter & | param, |
int | channel, | ||
float | min, | ||
int | low, | ||
float | max = -1 , |
||
int | high = -1 |
||
) |
connectNoteToValue
param | the parameter to bind |
channel | MIDI channel (1-16) |
min | The parameter value to map the lowest note |
low | The MIDI note number for the lowest (or only) note to map |
max | The value unto which the highest note is mapped |
high | The highest MIDI note number to map |