Pass every Nth trigger. More...
#include <trigger.hpp>
Public Member Functions | |
| void | set_division (int n) |
| int | division () const |
| void | reset_phase () |
| Realign so the next trigger passes. | |
| void | reset () |
| bool | process (bool trigger) |
| bool | process (SampleType clock) |
Static Public Attributes | |
| static constexpr int | kMinDivision = 1 |
| static constexpr int | kMaxDivision = 64 |
| static constexpr int | kDefaultDivision = 2 |
Pass every Nth trigger.
The first trigger after a reset always passes, so a divider that has just been phase-reset is in step with its master rather than N-1 events behind.
RT contract: two ints of state; everything allocates nothing.
USE: half- and quarter-time modulation from one master clock; polymeter by running a divide-by-3 and a divide-by-4 off the same trigger.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Realign so the next trigger passes.
|
inline |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |