Public Types | Static Public Member Functions | List of all members
TempoSyncer Class Reference

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...
 

Detailed Description

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.

Member Enumeration Documentation

enum Tempo

The note values.

Enumerator
Whole 

a whole note (1/1)

HalfDuet 

a half note duole (1/2D)

Half 

a half note (1/2)

HalfTriplet 

a half triplet note (1/2T)

QuarterDuet 

a quarter note duole (1/4D)

Quarter 

a quarter note (1/4)

QuarterTriplet 

a quarter triplet note (1/4T)

EighthDuet 

a eight note duole (1/8D)

Eighth 

a eighth note (1/8)

EighthTriplet 

a eighth triplet note (1/8T)

SixteenthDuet 

a sixteenth duole (1/16D)

Sixteenth 

a sixteenth note (1/16)

SixteenthTriplet 

a sixteenth triplet (1/16T)

ThirtyTwoDuet 

a 32th duole (1/32D)

ThirtyTwo 

a 32th note (1/32)

ThirtyTwoTriplet 

a 32th triplet (1/32T)

SixtyForthDuet 

a 64th duole (1/64D)

SixtyForth 

a 64th note (1/64)

numTempos 

a 64th triplet 1/64T)

Member Function Documentation

static Tempo getTempoIndex ( const String &  t)
inlinestatic

Returns the index of the tempo with the name 't'.

static Tempo getTempoIndexForTime ( double  currentBpm,
double  milliSeconds 
)
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.

static float getTempoInHertz ( double  hostTempoBpm,
Tempo  t 
)
inlinestatic

Returns the tempo as frequency (in Hertz).

static float getTempoInMilliSeconds ( double  hostTempoBpm,
Tempo  t 
)
inlinestatic

Returns the time for the specified tempo in milliseconds.

static int getTempoInSamples ( double  hostTempoBpm,
double  sampleRate,
Tempo  t 
)
inlinestatic

Returns the sample amount for the specified tempo.

static String getTempoName ( int  t)
inlinestatic

Returns the name of the tempo with the index 't'.

static void initTempoData ( )
inlinestatic

Fills the internal arrays.

Call this on application start.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.