Helper class for calibrating an input to 1V/oct response. More...
Helper class for calibrating an input to 1V/oct response.
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
#include <VoctCalibration.h>
Public Member Functions | |
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) |
|
inline |
|
inline |
Get the scale and offset data from the calibration
returns | true if calibration has been performed. |
Process a value through the calibrated data to get a MIDI Note number
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.
val1V | ADC reading for 1 volt |
val3V | ADC reading for 3 volts |
returns | true if the calibraiton is successful - this is always true |
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.