Takes care of MIDI Events, Tracks and Sequencing More...
#include <MIDIEventManager.h>
Inherited by MusicNoteLib::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 |
Takes care of MIDI Events, Tracks and Sequencing
void MusicNoteLib::MIDIEventManager::AddChannelPressureEvent | ( | unsigned char | uPressure | ) |
Adds a Channel Pressure event to the current track
uPressure | the 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.
uControlIndex | the controller |
uControlValue | value 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.
nKeySig | a value in the range [-7, 7] |
MajMin | indicates 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).
noteValue | the MIDI note value. For example, Mid-C = 60 |
attackVel | the attack Velocity of the note |
decayVel | the decay Velocity of the note |
lNoteDuration | duration of the MIDI note |
addNoteOn | indicates if NoteOn event should be created automatically. For the end of a tied note, this should be false; otherwise true; |
addNoteOff | indicates 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.
uLowByte | the low byte value of the pitch bend |
uHighByte | the 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.
uKey | the note the pressure should be applied to |
uPressure | the 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.
nInstrumentID | indicates 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.
nTempo | indicates 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.
unsigned long MusicNoteLib::MIDIEventManager::GetTrackTime | ( | ) | const |
Returns the Timer value for the current track (in Pulses Per Quarter)
Referenced by AddChannelPressureEvent(), AddControllerEvent(), AddKeySignatureEvent(), AddNoteEvent(), AddPitchBendEvent(), AddPolyphonicPressureEvent(), AddProgramChangeEvent(), and AddTempoEvent().
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)
CFugue, the C++ Music Programming Library | © Copyright 2009 CineFx Digital Media Pvt Ltd. | Gopalakrishna Palem |