libmetro
|
#include <libmetro.h>
Public Member Functions | |
Metronome (int bpm) | |
Metronome constructor. More... | |
void | add_measure (Measure &measure) |
add a measure More... | |
void | start () |
start the loop More... | |
void | start_and_loop () |
start the loop and block | |
Metronome class.
Metronome is the main ticker of libmetro.
The flow of libmetro goes something like:
The metronome will take care of emitting the notes on your output device and cycling through the measures at every tick appropriately.
metro::Metronome::Metronome | ( | int | bpm | ) |
Metronome constructor.
Create a metronome with the given bpm.
[in] | bpm | bpm to cycle through the measure |
void metro::Metronome::add_measure | ( | Measure & | measure | ) |
add a measure
Add a measure to the metronome which will be cycled through at a tempo set by the bpm param.
[in] | note_length | note length of the measure |
[in] | measure | measure |
void metro::Metronome::start | ( | ) |
start the loop
This method requires the user to block afterwards or else the code will exit. Useful if you want your own custom blocking logic e.g. waiting for user key presses.