42 deadline=audioTicks()+ticks;
51 void start(
unsigned int delay_milliseconds)
53 set(delay_milliseconds
);
65 set((
unsigned int) (60000.f/bpm)
);
77 unsigned long now = audioTicks();
78 if ((now<deadline) || stopped)
return false;
80 deadline=now-(now-deadline)+ticks;
Metronome(unsigned int delay_milliseconds=0)
Constructor.
EventDelay(unsigned int delay_milliseconds=0)
Constructor.
void setBPM(float bpm)
Set the beats per minute.
bool ready()
Call this in updateControl() or updateAudio() to check if it is time for a beat.
A metronome class which is like an EventDelay which retriggers itself when the delay time is up...
void start(unsigned int delay_milliseconds)
Set the time between beats and start the metronome.
A non-blocking replacement for Arduino's delay() function.
void start()
Start the metronome.
void set(unsigned int delay_milliseconds)
Set the delay time.