A class that handles tempo syncing. More...
Public Types | |
enum | Tempo { Whole = 0, HalfDuet, Half, HalfTriplet, QuarterDuet, Quarter, QuarterTriplet, EighthDuet, Eighth, EighthTriplet, SixteenthDuet, Sixteenth, SixteenthTriplet, ThirtyTwoDuet, ThirtyTwo, ThirtyTwoTriplet, SixtyForthDuet, SixtyForth , numTempos } |
The note values. More... | |
Static Public Member Functions | |
static Tempo | getTempoIndex (const String &t) |
Returns the index of the tempo with the name 't'. More... | |
static Tempo | getTempoIndexForTime (double currentBpm, double milliSeconds) |
Returns the next Tempo index for the given time. More... | |
static float | getTempoInHertz (double hostTempoBpm, Tempo t) |
Returns the tempo as frequency (in Hertz). More... | |
static float | getTempoInMilliSeconds (double hostTempoBpm, Tempo t) |
Returns the time for the specified tempo in milliseconds. More... | |
static int | getTempoInSamples (double hostTempoBpm, double sampleRate, Tempo t) |
Returns the sample amount for the specified tempo. More... | |
static String | getTempoName (int t) |
Returns the name of the tempo with the index 't'. More... | |
static void | initTempoData () |
Fills the internal arrays. More... | |
A class that handles tempo syncing.
All methods are static and it holds no data, so you have to get the host bpm before you can use this class.
You can use the slider mode TempoSync, which automatically maps the slider values to the tempo indexes and shows the corresponding text representation.
If the supplied hostTempo is invalid (= 0.0), a default tempo of 120.0 is used.
enum Tempo |
The note values.
|
inlinestatic |
Returns the index of the tempo with the name 't'.
|
inlinestatic |
Returns the next Tempo index for the given time.
This is not a super fast operation, but it helps with dealing between the two realms.
|
inlinestatic |
Returns the tempo as frequency (in Hertz).
|
inlinestatic |
Returns the time for the specified tempo in milliseconds.
|
inlinestatic |
Returns the sample amount for the specified tempo.
|
inlinestatic |
Returns the name of the tempo with the index 't'.
|
inlinestatic |
Fills the internal arrays.
Call this on application start.