3 ms·
This is maybe a little outside the scope of your article, but I've read about the DX7's log2 based sine wavetables in the past, and it makes sense from a math s
by kennywinker 5y ago
This is maybe a little outside the scope of your article, but I've read about the DX7's log2 based sine wavetables in the past, and it makes sense from a math standpoint (log2(x) + log2(y) = log2(x*y)). However, I find it confusing when I go to try to replicate it. My understanding is that these are NOT floating point numbers. In which case the output would be in the 8bit range of (0-257) or -127 to +127 if we're using signed values.
So assuming I want to represent a signal value of 127 (i.e. sin(t) = 127) using base 2 logs, I punch this into my calculator and i get log2(127) = 6.9886.
But that's not what's going to be stored in the signal LUT since it's a floating point number.
I think I'm probably missing something obvious, but any clarification would be amazing.
- danachow 5y ago6.9886 is not a floating point number - it’s just a number. Floating point is but one representation for approximation of real numbers, so called fixed point is another one. Having said that I believe the DX7 does use a floating point representation internally since floating point addition can be done with adds and bit shifts - both easy things to do in hardware.
- jimktrains2 5y agoMaybe it's stored as a fixed point? 4 bits for the signed whole number portion and 4 for the fractional part?
- kennywinker 5y agoI don't think that's enough precision? I.e. if you only have -7 to +7 range for the whole number and 0-16 for the fractional portion, how do you represent 6.9886? 1000/16 means increments of 62.5 so the closest numbers we can represent are either 7.000 or 6.9375 - but 6.93xx overlaps with log2(126) = 6.9773 and 7.000 overlaps with log2(128)
- danachow 5y agoIt’s not 8 bits. Most of the Yamaha chips seem to use 16 bits internally in 8.8 format (based on Raph Leviens work). Different models of Yamaha chips had different DAC setups, but on the DX7 the representation was 12.3 floating point - which I think was converted from the internal log scale fixed point to linear scale via a lookup table. So while the DX7 chips technically use both floating and fixed point it probably does all arithmetic in fixed point.
- thegardengnome 5y agoWhat danachow said makes sense to me. Under the "Logarithms and exponential" heading, it says the operator chip uses an exponential look-up room to convert this value back to a linear value. "This value" here refers to the output of log2(x*y). So I think it's implied that yes, the log2 calculation will yield a floating point number, but that floating point number will be converted back to a phase increment value that corresponds to the LUT. This is my shallow understanding of things
- kens 5y agoThe numbers are bigger than 8 bits. I'm still figuring out the exact sizes, but it looks like the phase values are 23 bits and the table lookups are 12 bits. There are also numbers that are sort of floating point, with the value shifted by a few bits depending on how large it is. (This is one reason that DX7 emulators don't exactly match the DX7, because the number of bits used isn't standard.)
- klodolph 5y agoThey’re all fixed-point. Some are logarithmic, some are linear. > In which case the output would be in the 8bit range of (0-257) or -127 to +127 if we're using signed values. The output is 12-bit. 8-bit is simply not good enough. Different internal signals have different widths. From what I understand: - Phase accumulator is 22 bits (linear) - Frequency is 14 bits - Amplitude is 12 bits (logarithmic) > So assuming I want to represent a signal value of 127 (i.e. sin(t) = 127) using base 2 logs, I punch this into my calculator and i get log2(127) = 6.9886. But that's not what's going to be stored in the signal LUT since it's a floating point number. sin(t) never equals 127. The highest value it will ever reach is 1.0. Instead of punching in log2(127), punch in log2(1.0). From what I understand, the values have 8 fractional bits. So if code value N represents a signal level of 1.00, then code value N-1 represents a signal level of 0.997. The synthesizer has two main lookup tables: one maps phase to log-sin, the other maps log to linear. Even with an incomplete understanding of how the chips work, it is believed that these widths are correct or very close.