|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <beat_clock.hpp>
Public Member Functions | |
| BeatClock (uint16_t tick_rate_hz, uint8_t beats_per_bar=4) | |
| Construct with tick rate (Hz) and time signature. | |
| void | set_bpm (uint16_t bpm) |
| Set tempo. Recalculates all derived tick counts. | |
| void | set_gate_percent (uint8_t percent) |
| Set gate duration as percentage of bar (0-100). Default 75%. | |
| bool | advance () |
| Advance one tick. Returns true on bar boundary (tick wraps to 0). | |
| bool | at_beat () const |
| True when current tick is on a beat boundary. | |
| bool | at_gate_off () const |
| True at the gate-off point within the bar. | |
| void | reset () |
| Reset tick counter to start of bar. | |
| uint16_t | bpm () const |
| uint32_t | tick () const |
| uint32_t | ticks_per_bar () const |
| uint32_t | ticks_per_beat () const |
| uint8_t | beats_per_bar () const |
Definition at line 27 of file beat_clock.hpp.
|
inlineexplicit |
Construct with tick rate (Hz) and time signature.
Definition at line 30 of file beat_clock.hpp.
References set_bpm().
|
inline |
Advance one tick. Returns true on bar boundary (tick wraps to 0).
Definition at line 54 of file beat_clock.hpp.
|
inline |
True when current tick is on a beat boundary.
Definition at line 63 of file beat_clock.hpp.
|
inline |
True at the gate-off point within the bar.
Definition at line 68 of file beat_clock.hpp.
|
inline |
Definition at line 78 of file beat_clock.hpp.
|
inline |
Definition at line 74 of file beat_clock.hpp.
Referenced by set_bpm().
|
inline |
Reset tick counter to start of bar.
Definition at line 71 of file beat_clock.hpp.
|
inline |
Set tempo. Recalculates all derived tick counts.
Definition at line 38 of file beat_clock.hpp.
References bpm().
Referenced by BeatClock().
|
inline |
Set gate duration as percentage of bar (0-100). Default 75%.
Definition at line 47 of file beat_clock.hpp.
|
inline |
Definition at line 75 of file beat_clock.hpp.
|
inline |
Definition at line 76 of file beat_clock.hpp.
|
inline |
Definition at line 77 of file beat_clock.hpp.