#include "Musimat.h"#include <iostream>Go to the source code of this file.
Classes | |
| class | Rhythm |
| Rhythm class implements standard methods and data structures to manipulate musical rhythm arithmetically. More... | |
Functions | |
| Real | metronome (Rhythm B, Real T) |
| Calculate the tempo coefficient corresponding to some rhythmic duration B at some tempo T. | |
| Real | Duration (Real x) |
| Calculate the actual duration of a Real with the implicit tempo scale applied, as a fraction of a whole note. | |
| Real | Duration (Rhythm x) |
| Calculate the actual duration of a Rhythm with the implicit tempo scale applied, as a fraction of a whole note. | |
| Real | AbsDuration (Real x) |
| Calculate the absolute duration of a Real without the implicit tempo scale applied, as a fraction of a whole note. | |
| Real | AbsDuration (Rhythm x) |
| Calculate the absolute duration of a Rhythm without the implicit tempo scale applied, as a fraction of a whole note. | |
| Void | SetTempoScale (Real ts) |
| Set the tempo used by all instances of Rhythm. | |
Variables | |
| Rhythm | Whole |
| Duration of a whole note. | |
| Rhythm | Half |
| Duration of a half note. | |
| Rhythm | Quarter |
| Duration of a quarter note. | |
| Rhythm | Eighth |
| Duration of a eighth note. | |
| Rhythm | Sixteenth |
| < Duration of a sixteenth note | |
Rhythm class.
Definition in file Rhythm.h.
Calculate the absolute duration of a Real without the implicit tempo scale applied, as a fraction of a whole note.
Definition at line 49 of file Rhythm.cpp.
References Return.
Calculate the absolute duration of a Rhythm without the implicit tempo scale applied, as a fraction of a whole note.
Definition at line 60 of file Rhythm.cpp.
References Rhythm::absDuration(), and Return.
{
Return y.absDuration();
}
Calculate the actual duration of a Real with the implicit tempo scale applied, as a fraction of a whole note.
For example, SetTempoScale( 0.5 ); Print( Duration( 1.0/4.0 ) ); prints 0.125.
Definition at line 37 of file Rhythm.cpp.
References Return.
Calculate the actual duration of a Rhythm with the implicit tempo scale applied, as a fraction of a whole note.
Definition at line 55 of file Rhythm.cpp.
References Rhythm::absDuration(), and Return.
{
Return y.absDuration();
}
Calculate the tempo coefficient corresponding to some rhythmic duration B at some tempo T.
B can be expressed as a ratio of reals, e.g., 1.0/4.0 for a quarternote. The expression metronome( 1.0/4.0, 60.0 ) returns the tempo coefficient for "quarter note gets the beat and there are sixty beats per minute". Hence, it returns 1.0.
Definition at line 32 of file Rhythm.cpp.
References Rhythm::absDuration(), and Return.
{
Return( 1.0 / (4.0 * B.absDuration()) * 60.0 / T );
}
| Void SetTempoScale | ( | Real | ts ) |
Set the tempo used by all instances of Rhythm.
Definition at line 27 of file Rhythm.cpp.
References Rhythm::tempo().
{
Rhythm::tempo(ts);
}
1.7.2