Difference in sample2hertz and volts2hertz

Hi, I am a bit confused, after reading into the owl.lib file I found functions that sound quite similar:
sample2hertz and volts2hertz. This first one take in an additional tune value, the second does not.

I am pretty sure, that sample2hertz is used for v/oct input control via DC coupled inputs. But when do you use volts2hertz ?

Thanks!

Samples should be used when you have an external signal. It requires your codec to be calibrated, which defines offset value that is considered 0 Volts level and another one that sets octave width in codec input/output data. Tune parameter allows you adding extra Volts (== octaves) to that offset, redefining the meaning of 0 volts.

Volts and Hertz are not related to codec, it’s something that you would use in your patch to describe audio frequency. Maybe it would make more sense if we used octaves instead of Volts in those function names, but we’ve just followed C++ Owl library naming.

There are some use cases when it’s more convenient to use Volts, mainly because we’re dealing with linear signal (compared to exponential relationships for Hertz):

  • quantizing incoming pitch CV - this is computationally cheaper then using Hz for equal temperament, because you’re dealing with linear scaling (i.e. mulitply by 12, round to integer value, divide by 12 to get 12 TET semitones)
  • making sequencers, because you’re effectively just using octaves/semitones in your math

It should be clear now that Volts/octaves are an alternative for Hertz, but not for samples.