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

Linear calibration parameters for V/Oct conversion. More...

#include <voct.hpp>

Collaboration diagram for sbl::components::cv::VoctCalibration:

Static Public Member Functions

static constexpr VoctCalibration default_3v3 ()
 Default calibration for 0–3.3V input, 1V/Oct, 16-bit ADC.
 
static constexpr VoctCalibration from_two_point (uint16_t adc_low, float note_low, uint16_t adc_high, float note_high)
 Compute calibration from two known points.
 

Public Attributes

float scale
 Semitones per ADC unit.
 
float offset
 MIDI note number at ADC=0.
 

Detailed Description

Linear calibration parameters for V/Oct conversion.

Maps smoothed ADC value to MIDI note number: note = adc_value * scale + offset

Definition at line 40 of file voct.hpp.

Member Function Documentation

◆ default_3v3()

static constexpr VoctCalibration sbl::components::cv::VoctCalibration::default_3v3 ( )
inlinestaticconstexpr

Default calibration for 0–3.3V input, 1V/Oct, 16-bit ADC.

3.3V × 12 semitones/V = 39.6 semitones across full ADC range. Base note C1 (MIDI 24) at ADC=0.

Definition at line 50 of file voct.hpp.

◆ from_two_point()

static constexpr VoctCalibration sbl::components::cv::VoctCalibration::from_two_point ( uint16_t  adc_low,
float  note_low,
uint16_t  adc_high,
float  note_high 
)
inlinestaticconstexpr

Compute calibration from two known points.

Apply known voltages, read the ADC values, and provide the expected MIDI note at each point. Scale and offset are derived from the two-point linear fit.

Parameters
adc_lowADC reading at the low calibration voltage
note_lowExpected MIDI note at the low point
adc_highADC reading at the high calibration voltage
note_highExpected MIDI note at the high point

Definition at line 66 of file voct.hpp.

Member Data Documentation

◆ offset

float sbl::components::cv::VoctCalibration::offset

MIDI note number at ADC=0.

Definition at line 42 of file voct.hpp.

Referenced by sbl::components::cv::VoctInput::semitones().

◆ scale

float sbl::components::cv::VoctCalibration::scale

Semitones per ADC unit.

Definition at line 41 of file voct.hpp.

Referenced by sbl::components::cv::VoctInput::semitones().


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