Allolib  1.0
C++ Components For Interactive Multimedia
al::ParameterMIDI Class Reference

The ParameterMIDI class connects Parameter objects to MIDI messages. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/ui/al_ParameterMIDI.hpp>

Inheritance diagram for al::ParameterMIDI:
al::MIDIMessageHandler

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 &param, int controlNumber, int channel)
 
void connectControl (Parameter &param, int controlNumber, int channel, float min, float max)
 
void connectControls (ParameterMeta &param, std::vector< int > controlNumbers, int channel=1, std::vector< float > min={}, std::vector< float > max={})
 
void connectNoteToValue (Parameter &param, int channel, float min, int low, float max=-1, int high=-1)
 connectNoteToValue More...
 
void connectNoteToToggle (ParameterBool &param, int channel, int note)
 
void connectNoteToIncrement (Parameter &param, 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< ControlBindinggetCurrentControlBindings ()
 
std::vector< NoteBindinggetCurrentNoteBindings ()
 
void bindTo (RtMidiIn &RtMidiIn, unsigned port=0)
 Bind handler to a MIDI input.
 
void clearBindings ()
 

Protected Attributes

std::vector< BindingmBindings
 

Detailed Description

The ParameterMIDI class connects Parameter objects to MIDI messages.

Parameter Size("Size", "", 1.0, "", 0, 1.0);
Parameter Speed("Speed", "", 0.05, "", 0.01, 0.3);
ParameterMIDI parameterMIDI;
parameterMIDI.connectControl(Size, 1, 1);
parameterMIDI.connectControl(Speed, 10, 1);
parameterMIDI.init(0); // Open MIDI device

Definition at line 70 of file al_ParameterMIDI.hpp.

Member Function Documentation

◆ connectControls()

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

◆ connectNoteToValue()

void al::ParameterMIDI::connectNoteToValue ( Parameter param,
int  channel,
float  min,
int  low,
float  max = -1,
int  high = -1 
)

connectNoteToValue

Parameters
paramthe parameter to bind
channelMIDI channel (1-16)
minThe parameter value to map the lowest note
lowThe MIDI note number for the lowest (or only) note to map
maxThe value unto which the highest note is mapped
highThe highest MIDI note number to map

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