I spent an hour or two playing with the render stage to improve the output and make the code a little saner.
I removed the 8-bit multtable[] (even AVRs can do hardware multiplication now, no need for this lookup), stuck in a real sine wave instead of the 16-level quantized one, and reworked the formnat synthesis to do 8-bit generation and accumulation of the 3 sources. Then I had it actually generate intermediate values instead of simply repeating single the calculated sample (i.e. no staircases anymore in generated waveform).
To my ears the output sounds a little easier to understand, and visually the waveforms are looking much nicer:
There's little additional computation (probably it is faster on the ESP8266 where reading from multtable[] in program memory is very slow over I2C!), so it shouldn't break any modern microcontroller.
I spent an hour or two playing with the render stage to improve the output and make the code a little saner.
I removed the 8-bit multtable[] (even AVRs can do hardware multiplication now, no need for this lookup), stuck in a real sine wave instead of the 16-level quantized one, and reworked the formnat synthesis to do 8-bit generation and accumulation of the 3 sources. Then I had it actually generate intermediate values instead of simply repeating single the calculated sample (i.e. no staircases anymore in generated waveform).
To my ears the output sounds a little easier to understand, and visually the waveforms are looking much nicer:![image](https://user-images.githubusercontent.com/11875/31196027-10ce9444-a901-11e7-852a-b926002c599b.png)
There's little additional computation (probably it is faster on the ESP8266 where reading from multtable[] in program memory is very slow over I2C!), so it shouldn't break any modern microcontroller.