Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
pot.hpp File Reference

Potentiometer component - smoothed, calibrated ADC with a [0, 1] output. More...

Detailed Description

Potentiometer component - smoothed, calibrated ADC with a [0, 1] output.

Pot is a source adapter: raw ADC counts in, normalized signal units out. Pipeline: raw -> EWMA (raw domain) -> two-point calibration -> [0, 1]. Deadband operates on that value.

Acquisition is owned by the component: feed values with update(), or read straight from a DMA scan buffer with update_dma() (ISR-safe).

Usage:

knob.update_dma(adc_buf, 0);
if (knob.changed()) { apply(knob.value()); } // deadbanded
filter.process(in, out, frames, knob.smoothed()); // full resolution, as a scalar port
Potentiometer with EWMA smoothing, calibration and deadband.
Definition pot.hpp:47
bool changed()
True if value moved past deadband since last check.
Definition pot.hpp:111
void update_dma(const uint16_t *buffer, uint8_t channel_index)
Read one channel from a DMA scan buffer and update.
Definition pot.hpp:82
float value() const
Stable (deadbanded) value in [0, 1].
Definition pot.hpp:87
float smoothed() const
Calibrated, smoothed value in [0, 1] - no deadband.
Definition pot.hpp:95

Definition in file pot.hpp.

Go to the source code of this file.

Classes

struct  sbl::control::input::PotConfig
 Pot construction settings. More...
 
class  sbl::control::input::Pot
 Potentiometer with EWMA smoothing, calibration and deadband. More...
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::control
 The control stack: scheduler, event queue, merge, CC mapping, calibration.
 
namespace  sbl::control::input
 Inputs: debounce, decoding, smoothing and scaling of raw samples.