metrasynth / radiant-voices

Work with SunVox file format tools (create, modify, read, write)
https://radiant-voices.rtfd.io/
Other
40 stars 3 forks source link

MultiCtl - map/quantize values in a SunVox-compatible manner #9

Closed matthewryanscott closed 6 years ago

matthewryanscott commented 8 years ago

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),