If you're making a digital sequencer with CV outputs to interface with a synthesiser, at some point you'll want to know just how many bits are enough to represent a pitch without it sounding out of tune.
This is pretty straightforward to work out, bearing in mind that at 1V/Oct, a range of 0 to +5V gives you 61 notes (notes 0 through to 60).
Using the following Python code:
print('Bits Highest Steps/semitone Cents/step') for bits in range(4,25): highestValue = 2 ** bits - 1 stepsPerSemitone = highestValue / 60 centsPerStep = 6000 / highestValue print('%4i %8i %14.6f %10.6f' % (bits, highestValue, stepsPerSemitone, centsPerStep))
...you can work out the following table of data:
Bits Highest Steps/semitone Cents/step 4 15 0.250000 400.000000 5 31 0.516667 193.548387 6 63 1.050000 95.238095 7 127 2.116667 47.244094 8 255 4.250000 23.529412 9 511 8.516667 11.741683 10 1023 17.050000 5.865103 11 2047 34.116667 2.931119 12 4095 68.250000 1.465201 13 8191 136.516667 0.732511 14 16383 273.050000 0.366233 15 32767 546.116667 0.183111 16 65535 1092.250000 0.091554 17 131071 2184.516667 0.045777 18 262143 4369.050000 0.022888 19 524287 8738.116667 0.011444 20 1048575 17476.250000 0.005722 21 2097151 34952.516667 0.002861 22 4194303 69905.050000 0.001431 23 8388607 139810.116667 0.000715 24 16777215 279620.250000 0.000358
With a scale of 0V to +5V, a 12-bit DAC should be sufficient, and a 16-bit DAC should be overkill. Given how cheap and plentiful 12-bit DACs are, this is good news.
Furthermore, if you can proportionally increase the voltages coming from the DAC so that the highest is +5.(3)V instead of +5V, then you can have a range of 64 notes (notes 0 through to 63) rather than 61. As 64 is a power of 2, all of the twelve-tone equal temperament pitches can be exactly expressed by a DAC that can hold at least 64 values. See this code:
print('Bits Highest Steps/semitone Cents/step') for bits in range(4,25): highestValue = 2 ** bits - 1 stepsPerSemitone = highestValue / 63 centsPerStep = 6300 / highestValue print('%4i %8i %14.6f %10.6f' % (bits, highestValue, stepsPerSemitone, centsPerStep))
...and these figures:
Bits Highest Steps/semitone Cents/step 4 15 0.238095 420.000000 5 31 0.492063 203.225806 6 63 1.000000 100.000000 7 127 2.015873 49.606299 8 255 4.047619 24.705882 9 511 8.111111 12.328767 10 1023 16.238095 6.158358 11 2047 32.492063 3.077675 12 4095 65.000000 1.538462 13 8191 130.015873 0.769137 14 16383 260.047619 0.384545 15 32767 520.111111 0.192267 16 65535 1040.238095 0.096132 17 131071 2080.492063 0.048066 18 262143 4161.000000 0.024033 19 524287 8322.015873 0.012016 20 1048575 16644.047619 0.006008 21 2097151 33288.111111 0.003004 22 4194303 66576.238095 0.001502 23 8388607 133152.492063 0.000751 24 16777215 266305.000000 0.000376
With a scale of 0V to +5.(3)V, a mere 6-bit DAC is sufficient. This makes sense as 2 to the power of 6 is 64. However, you'll still need to represent more than 6 bits if you'd like to implement portamento or an alternative system of tuning, so a 12-bit DAC is still recommendable. This is just as well considering they're easier to get than 6-bit ones.