Interesting. For my first experiments I don’t really mind - will just be happy to get sane output driven by midi!
From what I gather, the technique is to change the PWM in an interrupt continuously to match the amplitude of your output wave. During that 1ms, what happens? Does the PWM still output a regular wave but I can’t adjust it? Or does the PWM wave itself stop?
The first problem with doing this in arduino is that the pwm is interrupt based. So that limits the frequency. There is a tone library that can generate a pwm for a specific tone, but these are interrupt pwms and it cannot work correctly with the 1ms tick causing jitter. I see arduino projects every now and then as a consultant and one of them was to generate tones. It sounds scratchy out of the box if all you do is generate a tone. Had to modify arduino core for it to use hardware pwm. Why didn't they use hardware pwm in the first place? Its because they needed pwm to work on any pin not just the 8 or so pwm pins, and they sacrificed a lot of performance to do it. I love arduino for inventors to get something running, but for coders and engineers, you guys are smart just program on AVR in C, or better yet program on a modern arm cortex in C. If you want a blazing fast mcu check out the FRDM-K64F, this is 32 bits 150MHz vs the AVR's 8 bits and 20MHz, plus it has a nice DAC so you won't have to do pwm modulation, not to mention 256kb ram vs the arduino's 8kb.
From what I gather, the technique is to change the PWM in an interrupt continuously to match the amplitude of your output wave. During that 1ms, what happens? Does the PWM still output a regular wave but I can’t adjust it? Or does the PWM wave itself stop?