Public Member Functions | Protected Types | Protected Attributes
MusicNoteLib::MIDIEventManager Class Reference

Takes care of MIDI Events, Tracks and Sequencing More...

#include <MIDIEventManager.h>

Inherited by MusicNoteLib::MIDIRenderer [private].

List of all members.

Public Member Functions

jdkmidi::MIDISequencer * GetSequencer ()
 Returns the Sequencer holding the collection of tracks
jdkmidi::MIDIMultiTrack * GetTracks ()
 Returns the Multitrack object
void Clear ()
void SetCurrentTrack (unsigned short nTrack)
void SetCurrentLayer (unsigned short nLayer)
unsigned long GetTrackTime () const
void SetTrackTime (unsigned long lNewTime)
void AdvanceTrackTime (unsigned long lDuration)
void AddChannelPressureEvent (unsigned char uPressure)
void AddControllerEvent (unsigned char uControlIndex, unsigned char uControlValue)
void AddKeySignatureEvent (signed char nKeySig, unsigned char MajMin)
void AddPitchBendEvent (unsigned char uLowByte, unsigned char uHighByte)
void AddPolyphonicPressureEvent (unsigned char uKey, unsigned char uPressure)
void AddProgramChangeEvent (unsigned char nInstrumentID)
void AddTempoEvent (unsigned short nTempo)
void AddNoteEvent (int noteValue, int attackVel, int decayVel, long lNoteDuration, bool addNoteOn, bool addNoteOff)

Protected Types

enum  { MAX_CHANNELS = 16, MAX_LAYERS = 16 }

Protected Attributes

unsigned short m_nCurrentTrack
unsigned short m_nCurrentLayer
unsigned short m_CurrentLayer [MAX_CHANNELS]
unsigned long m_Time [MAX_CHANNELS][MAX_LAYERS]
jdkmidi::MIDIMultiTrack m_Tracks
jdkmidi::MIDISequencer m_Sequencer

Detailed Description

Takes care of MIDI Events, Tracks and Sequencing


Member Function Documentation

Adds a Channel Pressure event to the current track

Parameters:
uPressurethe pressure value that should be applied to the notes on the current channel

References GetTrackTime().

void MusicNoteLib::MIDIEventManager::AddControllerEvent ( unsigned char  uControlIndex,
unsigned char  uControlValue 
)

Adds a MIDI controller event to the current track.

Parameters:
uControlIndexthe controller
uControlValuevalue for the controller

References GetTrackTime().

void MusicNoteLib::MIDIEventManager::AddKeySignatureEvent ( signed char  nKeySig,
unsigned char  MajMin 
)

Adds a short Key Singature event to the current track.

Parameters:
nKeySiga value in the range [-7, 7]
MajMinindicates if this is Major (0) scale or Min (1) scale

References GetTrackTime().

void MusicNoteLib::MIDIEventManager::AddNoteEvent ( int  noteValue,
int  attackVel,
int  decayVel,
long  lNoteDuration,
bool  addNoteOn,
bool  addNoteOff 
)

Adds a short NoteOn message event to the current track using attack/decay velocities. Automatically adds a NoteOff message using the specified duration. These NoteOn and NoteOff can be suppressed (useful when notes are tied).

Parameters:
noteValuethe MIDI note value. For example, Mid-C = 60
attackVelthe attack Velocity of the note
decayVelthe decay Velocity of the note
lNoteDurationduration of the MIDI note
addNoteOnindicates if NoteOn event should be created automatically. For the end of a tied note, this should be false; otherwise true;
addNoteOffindicates if NoteOff event should be created automatically. For the start of a tied note, this should be false; otherwise true;

References AdvanceTrackTime(), and GetTrackTime().

void MusicNoteLib::MIDIEventManager::AddPitchBendEvent ( unsigned char  uLowByte,
unsigned char  uHighByte 
)

Adds a PitchBend event to the current track.

Parameters:
uLowBytethe low byte value of the pitch bend
uHighBytethe high byte value of the pitch bend

References GetTrackTime().

void MusicNoteLib::MIDIEventManager::AddPolyphonicPressureEvent ( unsigned char  uKey,
unsigned char  uPressure 
)

Adds a key pressure event to the current track.

Parameters:
uKeythe note the pressure should be applied to
uPressurethe Pressure value that should be applied to the key

References GetTrackTime().

void MusicNoteLib::MIDIEventManager::AddProgramChangeEvent ( unsigned char  nInstrumentID)

Adds a short ProgramChange message event to the current track.

Parameters:
nInstrumentIDindicates the selected instrument that should be used for playing further notes;

References GetTrackTime().

void MusicNoteLib::MIDIEventManager::AddTempoEvent ( unsigned short  nTempo)

Adds a short Tempo message event to the current track.

Parameters:
nTempoindicates the selected Tempo value in BPM that should be used for playing further notes;

References GetTrackTime().

void MusicNoteLib::MIDIEventManager::AdvanceTrackTime ( unsigned long  lDuration)

Advances the timer for the current Track by the duration (specified in Pulses Per Quarter)

Referenced by AddNoteEvent().

Clears all the Events stored in the tracks and Resets the Track Timers

Reimplemented in MusicNoteLib::MIDIRenderer.

void MusicNoteLib::MIDIEventManager::SetCurrentTrack ( unsigned short  nTrack)

Sets the current Track/Channel to which new Events will be added

void MusicNoteLib::MIDIEventManager::SetTrackTime ( unsigned long  lNewTime)

Sets the current Track's time to the supplied new time (specified in Pulses Per Quarter)


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

CFugue, the C++ Music Programming Library © Copyright 2009 CineFx Digital Media Pvt Ltd. Gopalakrishna Palem