32 : threshold_(threshold) {}
35 void arm(uint16_t entry_value) {
41 void update(uint16_t current_value) {
43 int32_t d =
static_cast<int32_t
>(current_value) -
static_cast<int32_t
>(entry_);
45 if (d >
static_cast<int32_t
>(threshold_)) {
51 bool live()
const {
return live_; }
void arm(uint16_t entry_value)
Lock the gate and record current knob position.
void update(uint16_t current_value)
Check if knob has moved enough from entry position to unlock.
void force_live()
Force the gate open (e.g., for the initial mode that needs no gating).
void set_threshold(uint16_t t)
Set threshold (0-65535).
KnobGate(uint16_t threshold=2000)
bool live() const
True when the gate is open (output allowed).
Root namespace for all Sound Byte Libs functionality.