#include <MIDI2Melody.hxx>
Definition at line 37 of file MIDI2Melody.hxx.
Public Member Functions | |
MIDI2Melody () | |
virtual | ~MIDI2Melody () |
Public Attributes | |
OutPort< MIDIMelody > | mOutput |
Concrete output port of type MIDIMelody. | |
InControl | 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. |
CLAM::MIDI2Melody::MIDI2Melody | ( | ) |
virtual CLAM::MIDI2Melody::~MIDI2Melody | ( | ) | [inline, virtual] |
Definition at line 41 of file MIDI2Melody.hxx.
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 33 of file MIDI2Melody.cxx.
References AddNote(), CLAM_ASSERT, DeleteNoteFromIndex(), FindNote(), CLAM::InControl::GetLastValue(), mBeginTimes, mLastKey, ModifyVelocity(), mOutput, mTime, mVelocities, and CLAM::DynamicType::UpdateData().
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 90 of file MIDI2Melody.cxx.
References CLAM::Control2Data::ConcreteConfigure().
Referenced by MIDI2Melody().
Finds the given note (according to key number) in internal container.
Definition at line 100 of file MIDI2Melody.cxx.
References mKeys, and CLAM::Array< T >::Size().
Referenced by DeleteNote(), GenerateOutputData(), and ModifyVelocity().
Adds a note to internal container.
Definition at line 114 of file MIDI2Melody.cxx.
References CLAM::Array< T >::AddElem(), mBeginTimes, mKeys, and mVelocities.
Referenced by GenerateOutputData().
void CLAM::MIDI2Melody::DeleteNote | ( | int | key | ) | [protected] |
Deletes note from internal container using MIDI key.
Definition at line 121 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 126 of file MIDI2Melody.cxx.
References CLAM::Array< T >::DeleteElem(), mBeginTimes, mKeys, and mVelocities.
Referenced by DeleteNote(), and GenerateOutputData().
Modifies midi velocity for given midi note.
Definition at line 133 of file MIDI2Melody.cxx.
References FindNote(), and mVelocities.
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::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().
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().
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().
int CLAM::MIDI2Melody::mLastKey [protected] |
Last key added to internal container.
Definition at line 82 of file MIDI2Melody.hxx.
Referenced by GenerateOutputData().