libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::VoctCalibration Class Reference

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

Detailed Description

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

#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)
 

Constructor & Destructor Documentation

◆ VoctCalibration()

daisy::VoctCalibration::VoctCalibration ( )
inline

◆ ~VoctCalibration()

daisy::VoctCalibration::~VoctCalibration ( )
inline

Member Function Documentation

◆ GetData()

bool daisy::VoctCalibration::GetData ( float scale,
float offset 
)
inline

Get the scale and offset data from the calibration

Return values
returnstrue if calibration has been performed.

◆ ProcessInput()

float daisy::VoctCalibration::ProcessInput ( const float  inval)
inline

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

◆ Record()

bool daisy::VoctCalibration::Record ( float  val1V,
float  val3V 
)
inline

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.

Parameters
val1VADC reading for 1 volt
val3VADC reading for 3 volts
Return values
returnstrue 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.

◆ SetData()

void daisy::VoctCalibration::SetData ( float  scale,
float  offset 
)
inline

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.


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