|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
V/Oct pitch CV input with smoothing and calibration. More...
#include <voct.hpp>
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 VoctCalibration & | calibration () 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. | |
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
|
inlineexplicit |
|
inline |
|
inline |
Frequency in Hz (via pitch tables)
Definition at line 113 of file voct.hpp.
References sbl::dsp::note_to_frequency(), and semitones().
|
inline |
Phase increment for wavetable oscillator.
Definition at line 123 of file voct.hpp.
References sbl::dsp::note_to_phase_increment(), and semitones().
|
inline |
Frequency ratio relative to A4 (440 Hz)
Definition at line 118 of file voct.hpp.
References sbl::dsp::note_to_ratio(), and semitones().
|
inline |
Last raw (unfiltered) ADC value.
Definition at line 128 of file voct.hpp.
References sbl::components::cv::CvInput::raw().
Referenced by update().
|
inline |
Reset filter state.
Definition at line 134 of file voct.hpp.
References sbl::components::cv::CvInput::reset().
|
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().
|
inline |
|
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().
|
inline |
Current smoothed ADC value (0–65535)
Definition at line 131 of file voct.hpp.
References sbl::components::cv::CvInput::value().