Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a musical position within a MIDI sequence. More...
#include <omSoundMIDITime.h>
Public Member Functions | |
MIDITime () | |
Create a new default MIDI time object with the default tempo of 120 quarter notes per minute. More... | |
MIDITime (Float newTempo, Index newMeasure, Float newBeat, TimeSignature newTimeSignature) | |
Create a new MIDI Time object with the specified tempo, measure index, beat number, and time signature. More... | |
Float | getTempo () const |
Return the number of quarter notes per minutes for the current position in the MIDI sequence. More... | |
void | setTempo (Float newTempo) |
Return the number of quarter notes per minutes for the current position in the MIDI sequence. More... | |
Index | getMeasure () const |
The index of the current measure within the MIDI sequence. More... | |
void | setMeasure (Index newMeasure) |
Set the index of the current measure within the MIDI sequence. More... | |
Float | getBeat () const |
Return the fractional number of time signature beats since the beginning of the measure. More... | |
void | setBeat (Float newBeat) |
Set the fractional number of time signature beats since the beginning of the measure. More... | |
A class that represents a musical position within a MIDI sequence.
This position is used for MIDI playback and sequencing, as well as synchronizing audio effects with MIDI data.
The MIDI time is represented by a tempo, measure index, time signature, and fractional number of beats since the beginning of the measure.
|
inline |
Create a new default MIDI time object with the default tempo of 120 quarter notes per minute.
|
inline |
Create a new MIDI Time object with the specified tempo, measure index, beat number, and time signature.
|
inline |
Return the number of quarter notes per minutes for the current position in the MIDI sequence.
This value can be used to convert the beat value into a time in seconds.
|
inline |
Return the number of quarter notes per minutes for the current position in the MIDI sequence.
This value can be used to convert the beat value into a time in seconds.
The new tempo is clamped to be greater than or equal to 0.
|
inline |
The index of the current measure within the MIDI sequence.
This value should not be used to compute the current time position within the MIDI sequence (along with the time signature and tempo), because the time signature and tempo may change throughout a given sequence, making a simple computation of the current time impossible given only the measure index.
|
inline |
Set the index of the current measure within the MIDI sequence.
This value should not be used to compute the current time position within the MIDI sequence (along with the time signature and tempo), because the time signature and tempo may change throughout a given sequence, making a simple computation of the current time impossible given only the measure index.
|
inline |
Return the fractional number of time signature beats since the beginning of the measure.
This value is represented in units of the time signature, so if the time signature is 6/8, the beat value can be in the range from 0 to 5.99999 and indicates the number of eigth notes since the start of the measure.
|
inline |
Set the fractional number of time signature beats since the beginning of the measure.
This value is represented in units of the time signature, so if the time signature is 6/8, the beat value can be in the range from 0 to 5.99999 and indicates the number of eigth notes since the start of the measure.
The new beat value is clamped to be greater than 0.