Trigger in, fixed-length gate out. More...
#include <trigger.hpp>
Public Types | |
| enum class | Retrigger : std::uint8_t { restart , ignore , extend } |
Public Member Functions | |
| void | prepare (double sample_rate) |
| void | set_length_ms (double ms) |
| double | length_ms () const |
| void | set_length_samples (double samples) |
| Direct sample length, for synced use via units::division_to_samples(). | |
| void | set_retrigger (Retrigger policy) |
| void | set_levels (SampleType low_level, SampleType high_level) |
| void | reset () |
| bool | process (bool trigger) |
| SampleType | process (SampleType trigger) |
| bool | gate () const |
| bool | open () const |
Static Public Attributes | |
| static constexpr double | kMinLengthMs = 0.1 |
| static constexpr double | kMaxLengthMs = 10000.0 |
| static constexpr double | kDefaultLengthMs = 10.0 |
Trigger in, fixed-length gate out.
RT contract: prepare() and setters are control-side; process() and reset() allocate nothing.
USE: choke windows; trance-gate shapes driving a VcaT; giving an ArT or AdT a gate whose length is a musical value rather than however long a pad was held. The retrigger policy is the interesting control — restart is a machine gun, ignore protects the first hit, extend accumulates a roll into one long gate.
|
strong |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Direct sample length, for synced use via units::division_to_samples().
Call it after prepare(): it stores the equivalent time using the prepared sample rate, and a later prepare() re-derives the sample count from that time.
|
inline |
|
inline |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |