Another interesting "reading the Arduino serial port" question

Paul Miller's icon

Hello!

I'm trying to read the output of an old (but fully operational) hewlett packard function generator through Arduino Uno's analog input. I've also tried reading the audio-rate output signal of various modules in my Eurorack. My twisted goal is to use Ardino as a kind of interface with my plants, so I can read bio-voltage into MAX/MSP without purchasing more than the two Instruo Scion modules I currently own...

The problem seems to be that at most frequencies, I'm getting garbage. The patch reads the amplitude well though. Also, my Arduino code seems to be working correctly because the serial plotter in the Arduino app is right. Even so, I can't seem to get the signal through MAX properly. I wonder if there's some issue with the rate at which I have [metro] set, or the way in which ASCII codes get converted. Maybe sig~ can't keep up? Ugh.

I'm attaching two screen shots and the patch itself. A million thanks for any help on this.

link-to-function-generator.maxpat
Max Patch

Kind of nice input (but only works for narrow frequency bands related in the harmonic series).

Garbagy input -- help!