Closed morganpackard closed 10 years ago
That approach works. Fractional bit depths don't make sense in a conventional way, but you're right - that could be pretty interesting.
Ok. Wrote the class, but got tangled up in git/compile issues and don't want to jump out of creative time for organization time. Class is here: https://gist.github.com/morganpackard/5a45c855b81a7adca882
Done. Branch ready for merge.
Snap values to an arbitrary bit depth.
I think the way to do this is to find the max int for a given bit depth, multiply the current sample by that maximum depth, cast to an int, then divide back down by that max value to get to a float again. Like this:
Any reason I should force the bit depth to be an int? Fractional bit depths doesn't actually make sense, of course, but it could potentially be interesting musically.