I am trying to produce some waveforms using the PWM and a timer interrupt. The problem is I am also doing envelope and LFO calculations in the main loop.
So, at certain points, I can listen to the note being produced bend towards a lower pitch. The only way this could be happening is if my interrupt was delayed and therefore the sample rate dropped.
What kind of CPU operation could be causing the delayed ISR execution? Is there a way to give higher priority to the ISR?