CLAM::MIDI2Melody Class Reference

#include <MIDI2Melody.hxx>

Inheritance diagram for CLAM::MIDI2Melody:

CLAM::Control2Data CLAM::Processing

List of all members.


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.


Public Member Functions

 MIDI2Melody ()
virtual ~MIDI2Melody ()

Public Attributes

OutPort< MIDIMelodymOutput
 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< 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.

Constructor & Destructor Documentation

CLAM::MIDI2Melody::MIDI2Melody (  ) 

Definition at line 26 of file MIDI2Melody.cxx.

References ConcreteConfigure().

virtual CLAM::MIDI2Melody::~MIDI2Melody (  )  [inline, virtual]

Definition at line 41 of file MIDI2Melody.hxx.


Member Function Documentation

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.

See also:
Control2Data::ConcreteConfigure

Reimplemented from CLAM::Control2Data.

Definition at line 90 of file MIDI2Melody.cxx.

References CLAM::Control2Data::ConcreteConfigure().

Referenced by MIDI2Melody().

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 100 of file MIDI2Melody.cxx.

References mKeys, and CLAM::Array< T >::Size().

Referenced by DeleteNote(), GenerateOutputData(), and ModifyVelocity().

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

void CLAM::MIDI2Melody::ModifyVelocity ( int  key,
int  newVelocity 
) [protected]

Modifies midi velocity for given midi note.

Definition at line 133 of file MIDI2Melody.cxx.

References FindNote(), and mVelocities.

Referenced by GenerateOutputData().


Member Data Documentation

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

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

Last key added to internal container.

Definition at line 82 of file MIDI2Melody.hxx.

Referenced by GenerateOutputData().


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

Generated on Tue Aug 12 22:33:49 2008 for CLAM by  doxygen 1.5.5