benirose / O_C-BenisphereSuite

Benisphere Suite is a continuation of Hemisphere Suite, an alternate firmware for Ornament and Crime, featuring a dual-applet framework with dozens of different modular functions.
168 stars 17 forks source link

Fix transpose in quantizer #51

Closed qiemem closed 1 year ago

qiemem commented 1 year ago

Updated to a couple other fixes for corner cases, discussed in discord, plus a stability improvement. Let me know if you'd prefer the changes in separate PRs or anything.

qiemem commented 1 year ago

Oh yes, good call. Discussion is here.

Summary of how hysteresis works in the quantizer and what the stability change does:

The boundaries will be at a distance from the quantized pitch as a ratio of the distance to next lowest/highest quantized pitch. The ratio is determined by this line (and the similar line a couple down from it): https://github.com/qiemem/O_C-HemisphereSuite/blob/trig-and-tides/software/o_c_REV/braids_quantizer.cpp#L94

So, by default, the boundary will be 9/16ths of the way to the next lowest/highest number. Semitones are 128 apart. So if you're at 0 and the next highest is 128, the upper boundary will be at 9 128 / 16 = 72. If you're at 128, the lower boundary will be at 7 128 / 16 = 56. Distance between the boundaries (which is what should be bigger than noise range to avoid instability) is then 72 - 56 = 16 for semitones. I noticed that noise on reading CV values will often be in the 20s, which is why 16 will exhibit occasional instability, so I changed the values from 9,7 to 10,6, which gives 32 for semitones instead.

Summary of bugs fixed:

benirose commented 1 year ago

Finally got around to testing this and it looks and sounds good!