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
cv_input.hpp File Reference

CV Input component - smoothed ADC reading with a signal output. More...

Detailed Description

CV Input component - smoothed ADC reading with a signal output.

CvInput is a source adapter: it takes raw ADC counts, applies EWMA smoothing in the raw domain, and emits normalized signal units at its output. The jack's musical role (unipolar / bipolar / V/Oct) is a structural parameter that defaults to unipolar; the conditioning constants live in CvConditioning. The mapping can be changed at runtime, for example per mode.

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

Usage:

jack.set_electrical(sbl::hw::electrical::cv_5); // Board::init() does this for you
jack.set_mapping(CvMapping::VOct);
jack.update_dma(adc_buf, 4);
float pitch_offset = jack.value(); // octaves under VOct
Smoothed CV input emitting normalized signal units.
Definition cv_input.hpp:98
void set_electrical(const sbl::hal::adc::Electrical &e)
Definition cv_input.hpp:150

Definition in file cv_input.hpp.

#include <cstdint>
#include <sbl/control/input/ewma.hpp>
#include <sbl/hw/hal/adc/electrical.hpp>

Go to the source code of this file.

Classes

struct  sbl::control::input::CvConditioning
 Conditioning constants for the analog front end. More...
 
struct  sbl::control::input::CvInputConfig
 CvInput construction settings. More...
 
class  sbl::control::input::CvInput
 Smoothed CV input emitting normalized signal units. 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.
 

Enumerations

enum class  sbl::control::input::Smoothing : uint8_t { sbl::control::input::None = 0 , sbl::control::input::Light = 1 , sbl::control::input::Medium = 3 , sbl::control::input::Heavy = 5 }
 Smoothing presets for the raw-domain EWMA filter. More...
 
enum class  sbl::control::input::CvMapping : uint8_t { sbl::control::input::Unipolar , sbl::control::input::Bipolar , sbl::control::input::VOct }
 Musical interpretation of the jack - a structural parameter. More...