Hi all, how do I accurately send a pitch CV from my Bela Pepper to my modular?

I'd like to convert from MIDI notes to pitch CV and send it to one of Pepper's analogue outs to tune an oscillator.

What formulas are you using? I'm likely to use SuperCollider for experimentation and C++ to finalise but happy to work with PureData or any other scripts you have for now!

Many thanks,
Tristan

The pepper analog outs are 0V : 5V and this is mapped to values 0 : 1 in PureData.

The base conversion is therefore:

analog = digital * 5V

where analog is the analog voltage and digital is the value inside Pd or C++.. I.e.:

DigitalAnalog
00V
0.21V
0.42V
0.63V
0.84V
1.05V*

* in practice 5V is hard to achieve because the power supply may saturate slightly below that.

Now, these values may not be mV accurate, so some calibration may be needed. That could be done by adding per-channel scaling and offset.
See here for a complete approach: https://forum.bela.io/d/3859-volt-per-octave-out-for-pepper