CFugue
Public Member Functions | Protected Types | Protected Attributes | List of all members
CFugue::MIDIEventManager Class Reference

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

#include <MidiEventManager.h>

Inherited by CFugue::MIDIRenderer [private].

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

Definition at line 21 of file MidiEventManager.h.

Member Function Documentation

void CFugue::MIDIEventManager::AddChannelPressureEvent ( unsigned char  uPressure)

Adds a Channel Pressure event to the current track

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

Definition at line 107 of file MidiEventManager.h.

References GetTrackTime().

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

Adds a MIDI controller event to the current track.

Parameters
uControlIndexthe controller
uControlValuevalue for the controller

Definition at line 120 of file MidiEventManager.h.

References GetTrackTime().

void CFugue::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

Definition at line 133 of file MidiEventManager.h.

References GetTrackTime().

void CFugue::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;

Definition at line 202 of file MidiEventManager.h.

References AdvanceTrackTime(), and GetTrackTime().

void CFugue::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

Definition at line 146 of file MidiEventManager.h.

References GetTrackTime().

void CFugue::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

Definition at line 159 of file MidiEventManager.h.

References GetTrackTime().

void CFugue::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;

Definition at line 171 of file MidiEventManager.h.

References GetTrackTime().

void CFugue::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;

Definition at line 183 of file MidiEventManager.h.

References GetTrackTime().

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

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

Definition at line 98 of file MidiEventManager.h.

Referenced by AddNoteEvent().

void CFugue::MIDIEventManager::Clear ( )

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

Definition at line 57 of file MidiEventManager.h.

unsigned long CFugue::MIDIEventManager::GetTrackTime ( ) const

Returns the Timer value for the current track (in Pulses Per Quarter)

Definition at line 82 of file MidiEventManager.h.

Referenced by AddChannelPressureEvent(), AddControllerEvent(), AddKeySignatureEvent(), AddNoteEvent(), AddPitchBendEvent(), AddPolyphonicPressureEvent(), AddProgramChangeEvent(), and AddTempoEvent().

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

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

Definition at line 69 of file MidiEventManager.h.

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

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

Definition at line 90 of file MidiEventManager.h.


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

CFugue, the C++ Music Programming Library © Copyright 2009 Cenacle Research India Private Limited Gopalakrishna Palem