Delay a trigger by a fixed time, through a small fixed-capacity queue. More...
#include <trigger.hpp>
Public Member Functions | |
| void | prepare (double sample_rate) |
| void | set_delay_ms (double ms) |
| double | delay_ms () const |
| void | set_delay_samples (double samples) |
| Direct sample delay, for synced use. | |
| void | reset () |
| bool | process (bool trigger) |
| bool | process (SampleType trigger) |
| long long | dropped () const |
| Triggers discarded because the queue was full since the last reset(). | |
Static Public Attributes | |
| static constexpr int | kCapacity = 8 |
| Eight in-flight triggers covers flams, doubles, and a full BurstGenT burst passing through; more would be a delay line, not a trigger delay. | |
| static constexpr double | kMinDelayMs = 0.0 |
| static constexpr double | kMaxDelayMs = 10000.0 |
| static constexpr double | kDefaultDelayMs = 0.0 |
Delay a trigger by a fixed time, through a small fixed-capacity queue.
Capacity is kCapacity in-flight triggers. A trigger arriving with the queue full is dropped and counted rather than silently overwriting one — dropping is the honest behavior for a bounded queue, and the counter is there so a caller can notice.
RT contract: a fixed-size array of counters. process() costs kCapacity integer operations per sample and allocates nothing.
USE: flams — run the dry trigger and a 15 ms delayed copy into two voices. Echo-triggering a second layer. Nudging one element of a drum pattern off the grid without touching the sequencer.
|
inline |
|
inline |
Triggers discarded because the queue was full since the last reset().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Direct sample delay, for synced use.
Call it after prepare() — see GateGenT::set_length_samples() for why.
|
staticconstexpr |
Eight in-flight triggers covers flams, doubles, and a full BurstGenT burst passing through; more would be a delay line, not a trigger delay.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |