Re: Mono display from a poly moduation source
Posted: Thu Mar 22, 2018 5:18 pm
tulamide wrote:KG_is_back wrote:This could also be adapted to get the lowest voice ID, but I can't quite figure out how at the moment.
When doing 2^x, every voice id has its own bit, which would scream for bitwise logicals, no?
Yes, that is another way of interpreting it. However, it should theoretically work with any base, not just 2.
martinvicanek wrote:Since the Combiner prim works with floats, you have only 23 mantisa bits to work with. So you would need two floats to fully encode which of the 32 voices are active.
Yes that is true. However, in this example we do not care which voices are active. We only care for the highest voice aka the highest bit. When more than 23 voices are playing, the lower ones get rounded out in the floating point logic. We only care about the order (aka the exponent). The mantissa is irrelevant. I fact, the algorithm can be heavily optimized by simply not calculating the mantissa when doing the power and log functions. It would effectively boil down to two bitshifts, some bitmasking and float<->int conversion.