Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::components::cv::VoctInput Class Reference

V/Oct pitch CV input with smoothing and calibration. More...

#include <voct.hpp>

Collaboration diagram for sbl::components::cv::VoctInput:

Public Member Functions

 VoctInput (VoctCalibration cal=VoctCalibration::default_3v3(), Smoothing smoothing=Smoothing::Light)
 
void update (uint16_t raw)
 Feed a new raw ADC sample.
 
void set_calibration (VoctCalibration cal)
 Replace calibration at runtime.
 
const VoctCalibrationcalibration () const
 Current calibration.
 
float semitones () const
 MIDI note number (float) from calibrated input.
 
float frequency () const
 Frequency in Hz (via pitch tables)
 
float ratio () const
 Frequency ratio relative to A4 (440 Hz)
 
uint32_t phase_increment (float sample_rate) const
 Phase increment for wavetable oscillator.
 
uint16_t raw () const
 Last raw (unfiltered) ADC value.
 
uint16_t value () const
 Current smoothed ADC value (0–65535)
 
void reset ()
 Reset filter state.
 

Detailed Description

V/Oct pitch CV input with smoothing and calibration.

Owns a CvInput for EWMA smoothing and stores calibration state. Hardware-agnostic — takes raw ADC values, no driver calls.

V/Oct pitch CV input with smoothing, calibration, and pitch conversion

Note
All public methods are ISR-safe — pure state machine with no hardware I/O.

Definition at line 88 of file voct.hpp.

Constructor & Destructor Documentation

◆ VoctInput()

sbl::components::cv::VoctInput::VoctInput ( VoctCalibration  cal = VoctCalibration::default_3v3(),
Smoothing  smoothing = Smoothing::Light 
)
inlineexplicit

Definition at line 90 of file voct.hpp.

Member Function Documentation

◆ calibration()

const VoctCalibration & sbl::components::cv::VoctInput::calibration ( ) const
inline

Current calibration.

Definition at line 105 of file voct.hpp.

◆ frequency()

float sbl::components::cv::VoctInput::frequency ( ) const
inline

Frequency in Hz (via pitch tables)

Definition at line 113 of file voct.hpp.

References sbl::dsp::note_to_frequency(), and semitones().

Here is the call graph for this function:

◆ phase_increment()

uint32_t sbl::components::cv::VoctInput::phase_increment ( float  sample_rate) const
inline

Phase increment for wavetable oscillator.

Definition at line 123 of file voct.hpp.

References sbl::dsp::note_to_phase_increment(), and semitones().

Here is the call graph for this function:

◆ ratio()

float sbl::components::cv::VoctInput::ratio ( ) const
inline

Frequency ratio relative to A4 (440 Hz)

Definition at line 118 of file voct.hpp.

References sbl::dsp::note_to_ratio(), and semitones().

Here is the call graph for this function:

◆ raw()

uint16_t sbl::components::cv::VoctInput::raw ( ) const
inline

Last raw (unfiltered) ADC value.

Definition at line 128 of file voct.hpp.

References sbl::components::cv::CvInput::raw().

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void sbl::components::cv::VoctInput::reset ( )
inline

Reset filter state.

Definition at line 134 of file voct.hpp.

References sbl::components::cv::CvInput::reset().

Here is the call graph for this function:

◆ semitones()

float sbl::components::cv::VoctInput::semitones ( ) const
inline

MIDI note number (float) from calibrated input.

Definition at line 108 of file voct.hpp.

References sbl::components::cv::VoctCalibration::offset, sbl::components::cv::VoctCalibration::scale, and sbl::components::cv::CvInput::value().

Referenced by frequency(), phase_increment(), and ratio().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_calibration()

void sbl::components::cv::VoctInput::set_calibration ( VoctCalibration  cal)
inline

Replace calibration at runtime.

Definition at line 100 of file voct.hpp.

◆ update()

void sbl::components::cv::VoctInput::update ( uint16_t  raw)
inline

Feed a new raw ADC sample.

Definition at line 95 of file voct.hpp.

References raw(), and sbl::components::cv::CvInput::update().

Referenced by sbl::voct::read(), and sbl::voct::read_dma().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ value()

uint16_t sbl::components::cv::VoctInput::value ( ) const
inline

Current smoothed ADC value (0–65535)

Definition at line 131 of file voct.hpp.

References sbl::components::cv::CvInput::value().

Here is the call graph for this function:

The documentation for this class was generated from the following file: