I believe I’ve found a bug in The Daisy Patch sequencer example . After using the sequencer to sequence a sound source module (Plaits), something didn’t sound quite right to me. I ran the output into a tuner (Mordax Data) and found that, for sequencer values of 0, the output was about a half a semitone sharp. I’ve tested this with multiple sound source modules to ensure that the issue is with Daisy.
Sequencer uses the following code to compute DAC output: (source)
patch.seed.dac.WriteValue(DacHandle::Channel::ONE, round((values[stepNumber] / 12.f) * 819.2f));
values[stepNumber] is a semitone value 0-60
I have no previous experience with hardware or DACs so I don’t know what to make of this conversion. I did figure out where the magic number 819.2f comes from: (According to this comment), 0=0v and 4095=5v. Since 4095/5=819, there are 819 (dac units?) per volt or octave.
Unfortunately, I can’t figure out what’s actually wrong with it. Does anybody know how to fix it so that semitone values of 0 are not out of tune? I’ve found that adding an offset of ~25 to non-zero DAC output values sort of does the trick, but it seems like a hacky solution.