There are some inconsistencies in the way we quantize vs. the way SunVox quantizes.
For example, for this test case, we calculate a value of 128. This makes sense since there are 61 quantization steps, and 16384 is exactly in the middle of the range [0, 32768].
However, SunVox calculates 123. It only calculates 128 when the value becomes 16385.
# gain qsteps smin smax dmin dmax value expected
(256, 61, 0, 32768, 0, 256, 16384, 123),
There are some inconsistencies in the way we quantize vs. the way SunVox quantizes.
For example, for this test case, we calculate a value of 128. This makes sense since there are 61 quantization steps, and 16384 is exactly in the middle of the range [0, 32768].
However, SunVox calculates 123. It only calculates 128 when the value becomes 16385.