Skip to content

daisy::VoctCalibration

Helper class for calibrating an input to 1V/oct response. More...

#include <VoctCalibration.h>

Public Functions

Name
VoctCalibration()
~VoctCalibration()
bool Record(float val1V, float val3V)
bool GetData(float & scale, float & offset)
void SetData(float scale, float offset)
float ProcessInput(const float inval)

Detailed Description

class daisy::VoctCalibration;

Helper class for calibrating an input to 1V/oct response.

Author: shensley

This provides a scale and offset value for converting incoming CV into MIDI note numbers accurately for musical pitch tracking.

To use, record both the 1V and 3V values using the specified functions once calibration is complete you can use the GetData function to retrieve the calibration values.

This can also be used for 100mV/Semitone calibration as used by Buchla synthesizer modules. To calibrate for this standard. You would send 1.2V, and 3.6V

Public Functions Documentation

function VoctCalibration

inline VoctCalibration()

function ~VoctCalibration

inline ~VoctCalibration()

function Record

inline bool Record(
    float val1V,
    float val3V
)

Parameters:

  • val1V ADC reading for 1 volt
  • val3V ADC reading for 3 volts

Returns:

  • returns true if the calibraiton is successful - this is always true

Todo: Add some sort of range validation. Originally we had a check for a valid range on the input, but given that the input circuit or the AnalogControl configuration can have a drastic effect on input, that could cause unintentional failure to calibrate, it was removed.

Uses the values retrieved for 1V and 3V in order to compute a scale and offset value that can be used to convert a CV input signal to a calibrated 1V/oct range.


function GetData

inline bool GetData(
    float & scale,
    float & offset
)

Returns:

  • returns true if calibration has been performed.

Get the scale and offset data from the calibration


function SetData

inline void SetData(
    float scale,
    float offset
)

Manually set the calibration data and mark internally as "calibrated" This is used to reset the data after a power cycle without having to redo the calibration procedure.


function ProcessInput

inline float ProcessInput(
    const float inval
)

Process a value through the calibrated data to get a MIDI Note number

---

Updated on 2024-01-03 at 19:41:01 +0000