How do you read the CV value from an input on Daisy Patch?
I tried patch.GetCvValue(DaisyPatch::CV_1)
.
I took a look at the daisy_patch.h
and doesn’t look you can read the CV value but, I’m not really sure what I’m looking for. libDaisy/src/daisy_patch.h at master · electro-smith/libDaisy · GitHub
The new web page doesn’t show Daisy Patch: Hardware - Daisy
If I recall correctly, the CV inputs go through the pots CTRL_1-CTRL_4. CV is read exactly like reading the pots.
The new website still seems pretty useless as documentation.
corvin
3
One way to do this is to use the Parameter class
#include "daisysp.h"
#include "daisy_patch.h"
using namespace daisy;
using namespace daisysp;
DaisyPatch hw;
Parameter firstKnob;
Set the min max and your desired curve in main
int main(void)
{
hw.Init();
firstKnob.Init(hw.controls[0], 0.0, 1.0f, Parameter::LINEAR);
hw.StartAdc();
hw.StartAudio(AudioCallback);
while(1) {}
}
and in your AudioCallback
void AudioCallback(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size)
{
hw.ProcessAnalogControls();
hw.ProcessDigitalControls();
float first = firstKnob.Process();
With the Patch, CV input and pot are connected, which is different than the Patch.init
1 Like
That’s really useful thanks!
Try using patch.controls[CV_1].Process() before reading the CV value