CLAM::MIDI2Melody Class Reference

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>

List of all members.

Public Member Functions

 MIDI2Melody ()
virtual ~MIDI2Melody ()

Public Attributes

OutPort< MIDIMelodymOutput
 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< intmKeys
 Contains an array of midi keys active at a given moment.
Array< intmVelocities
 Array of Midi velocities corresponding to the active midi notes.
Array< intmBeginTimes
 Array of begin times in milliseconds corresponding to the active midi notes.
int mLastKey
 Last key added to internal container.

Detailed Description

This processing is a particular control-to-data converter that takes in MIDI control events and converts them into a MIDIMelody processing data.

See also:
: Control2Data

Definition at line 37 of file MIDI2Melody.hxx.


Constructor & Destructor Documentation

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.


Member Function Documentation

void CLAM::MIDI2Melody::AddNote ( int  key,
int  velocity,
int  time 
) [protected]

Adds a note to internal container.

Parameters:
key note (MIDI key)
velocity is MIDI velocity
time is time in milliseconds

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.

See also:
Control2Data::ConcreteConfigure

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().

int CLAM::MIDI2Melody::FindNote ( int  key  )  [protected]

Finds the given note (according to key number) in internal container.

Returns:
the index of the given note 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]
void CLAM::MIDI2Melody::ModifyVelocity ( int  key,
int  newVelocity 
) [protected]

Modifies midi velocity for given midi note.

Definition at line 132 of file MIDI2Melody.cxx.

References FindNote(), and mVelocities.

Referenced by GenerateOutputData().


Member Data Documentation

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().

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().

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 of Midi velocities corresponding to the active midi notes.

Definition at line 78 of file MIDI2Melody.hxx.

Referenced by AddNote(), DeleteNoteFromIndex(), GenerateOutputData(), and ModifyVelocity().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3