This processing is a particular control-to-data converter that takes in MIDI control events and converts them into a MIDIMelody processing data. More...
#include <MIDI2Melody.hxx>
Public Member Functions | |
MIDI2Melody () | |
virtual | ~MIDI2Melody () |
Public Attributes | |
OutPort< MIDIMelody > | mOutput |
Concrete output port of type MIDIMelody. | |
FloatInControl | mTime |
Special input control for keeping trace of the time. | |
Protected Member Functions | |
bool | GenerateOutputData (int id, TControlData val) |
Particular implementation of this operation to generate data from enqueued controls. | |
bool | ConcreteConfigure (const ProcessingConfig &c) |
Concrete configuration, we hardcode the number of controls to use and pass it to the configuration of the base Control2Data configuration method. | |
int | FindNote (int key) |
Finds the given note (according to key number) in internal container. | |
void | AddNote (int key, int velocity, int time) |
Adds a note to internal container. | |
void | DeleteNote (int key) |
Deletes note from internal container using MIDI key. | |
void | DeleteNoteFromIndex (int index) |
Deletes note in given position in internal container. | |
void | ModifyVelocity (int key, int newVelocity) |
Modifies midi velocity for given midi note. | |
Protected Attributes | |
Array< int > | mKeys |
Contains an array of midi keys active at a given moment. | |
Array< int > | mVelocities |
Array of Midi velocities corresponding to the active midi notes. | |
Array< int > | mBeginTimes |
Array of begin times in milliseconds corresponding to the active midi notes. | |
int | mLastKey |
Last key added to internal container. |
This processing is a particular control-to-data converter that takes in MIDI control events and converts them into a MIDIMelody processing data.
Definition at line 37 of file MIDI2Melody.hxx.
CLAM::MIDI2Melody::MIDI2Melody | ( | ) |
Definition at line 25 of file MIDI2Melody.cxx.
References ConcreteConfigure().
virtual CLAM::MIDI2Melody::~MIDI2Melody | ( | ) | [inline, virtual] |
Definition at line 41 of file MIDI2Melody.hxx.
Adds a note to internal container.
Definition at line 113 of file MIDI2Melody.cxx.
References CLAM::Array< T >::AddElem(), mBeginTimes, mKeys, and mVelocities.
Referenced by GenerateOutputData().
bool CLAM::MIDI2Melody::ConcreteConfigure | ( | const ProcessingConfig & | c | ) | [protected, virtual] |
Concrete configuration, we hardcode the number of controls to use and pass it to the configuration of the base Control2Data configuration method.
Reimplemented from CLAM::Control2Data.
Definition at line 89 of file MIDI2Melody.cxx.
Referenced by MIDI2Melody().
void CLAM::MIDI2Melody::DeleteNote | ( | int | key | ) | [protected] |
Deletes note from internal container using MIDI key.
Definition at line 120 of file MIDI2Melody.cxx.
References DeleteNoteFromIndex(), and FindNote().
void CLAM::MIDI2Melody::DeleteNoteFromIndex | ( | int | index | ) | [protected] |
Deletes note in given position in internal container.
Definition at line 125 of file MIDI2Melody.cxx.
References CLAM::Array< T >::DeleteElem(), mBeginTimes, mKeys, and mVelocities.
Referenced by DeleteNote(), and GenerateOutputData().
Finds the given note (according to key number) in internal container.
Definition at line 99 of file MIDI2Melody.cxx.
References mKeys, and CLAM::Array< T >::Size().
Referenced by DeleteNote(), GenerateOutputData(), and ModifyVelocity().
bool CLAM::MIDI2Melody::GenerateOutputData | ( | int | id, | |
TControlData | val | |||
) | [protected, virtual] |
Particular implementation of this operation to generate data from enqueued controls.
Implements CLAM::Control2Data.
Definition at line 32 of file MIDI2Melody.cxx.
References AddNote(), CLAM_ASSERT, DeleteNoteFromIndex(), FindNote(), CLAM::OutPort< Token >::GetData(), CLAM::InControl< ControlDataType >::GetLastValue(), mBeginTimes, mLastKey, ModifyVelocity(), mOutput, mTime, mVelocities, and CLAM::DynamicType::UpdateData().
Modifies midi velocity for given midi note.
Definition at line 132 of file MIDI2Melody.cxx.
References FindNote(), and mVelocities.
Referenced by GenerateOutputData().
Array<int> CLAM::MIDI2Melody::mBeginTimes [protected] |
Array of begin times in milliseconds corresponding to the active midi notes.
Definition at line 80 of file MIDI2Melody.hxx.
Referenced by AddNote(), DeleteNoteFromIndex(), and GenerateOutputData().
Array<int> CLAM::MIDI2Melody::mKeys [protected] |
Contains an array of midi keys active at a given moment.
Definition at line 76 of file MIDI2Melody.hxx.
Referenced by AddNote(), DeleteNoteFromIndex(), and FindNote().
int CLAM::MIDI2Melody::mLastKey [protected] |
Last key added to internal container.
Definition at line 82 of file MIDI2Melody.hxx.
Referenced by GenerateOutputData().
Concrete output port of type MIDIMelody.
Definition at line 41 of file MIDI2Melody.hxx.
Referenced by GenerateOutputData().
Special input control for keeping trace of the time.
Definition at line 46 of file MIDI2Melody.hxx.
Referenced by GenerateOutputData().
Array<int> CLAM::MIDI2Melody::mVelocities [protected] |
Array of Midi velocities corresponding to the active midi notes.
Definition at line 78 of file MIDI2Melody.hxx.
Referenced by AddNote(), DeleteNoteFromIndex(), GenerateOutputData(), and ModifyVelocity().