Tempo Tapper
1.0.0
A simple library to implement a tempo tapper
|
Defines code shared accross all target platform s. More...
Go to the source code of this file.
Functions | |
unsigned long | tt_period_us (tempo_tapper *tapper) |
Returns the period of a tempo in microseconds. More... | |
void | tt_tap (tempo_tapper *tapper) |
"Taps" the tempo tapper More... | |
tempo_tapper * | tt_new () |
Creates a new tempo tapper instance. More... | |
BPM_t | tt_bpm (tempo_tapper *tapper) |
Returns the tempo in BPM. More... | |
void | tt_reset (tempo_tapper *tapper) |
Resets the tempo tapper. More... | |
Defines code shared accross all target platform s.
The following file defines tempo tapper functions that are shared across all target platforms.
All function descriptions can be found in the tempo_tapper.h file.
Definition in file tempo_tapper_common.cxx.
BPM_t tt_bpm | ( | tempo_tapper * | tapper | ) |
Returns the tempo in BPM.
The following function returns the tempo of the tempo tapper in BPM. The decimal precision is platform dependant.
Definition at line 72 of file tempo_tapper_common.cxx.
References tt_period_us().
Referenced by tempo_tapper_cpp::bpm().
tempo_tapper* tt_new | ( | ) |
Creates a new tempo tapper instance.
The following function creates and initializes a tempo tapper struct instance.
Definition at line 61 of file tempo_tapper_common.cxx.
References tt_reset().
Referenced by tempo_tapper_cpp::tempo_tapper_cpp().
unsigned long tt_period_us | ( | tempo_tapper * | tapper | ) |
Returns the period of a tempo in microseconds.
The following function returns the time in microseconds for a period of the current tempo set by the tempo tapper struct.
Definition at line 37 of file tempo_tapper_common.cxx.
References tempo_tapper::prd_sum, tempo_tapper::taps, and time_to_us().
Referenced by tempo_tapper_cpp::period_us(), and tt_bpm().
void tt_reset | ( | tempo_tapper * | tapper | ) |
Resets the tempo tapper.
The following function resets the tempo tapper to its iniital values.
Definition at line 83 of file tempo_tapper_common.cxx.
References tempo_tapper::prd_sum, reset_time(), and tempo_tapper::taps.
Referenced by tempo_tapper_cpp::reset(), and tt_new().
void tt_tap | ( | tempo_tapper * | tapper | ) |
"Taps" the tempo tapper
The following function is used to "tap" a tempo tapper struct instance. Calling this function on a tempo tapper struct will increase the value of taps, add the time that has passed since the last tap to prd_sum and update lst_t to the current clock time.
Definition at line 46 of file tempo_tapper_common.cxx.
References add_time(), current_time(), tempo_tapper::lst_t, tempo_tapper::prd_sum, sub_time(), and tempo_tapper::taps.
Referenced by tempo_tapper_cpp::tap().