Tweet
Replying to @josecastillo
The LEDs, on the other hand, make use of whatever period the buzzer is set at: we just set their compare value to whatever fraction of that period corresponds to the desired duty cycle. I had to remove a few low-frequency notes to make this work, but it’s a worthwhile tradeoff.
(original)