I think there is a problem in the logic of the code, in way you change the frequency: during a frame, ie. a 1/60th of second, you change the frequency (and amplitude) for each dot? What is the expected result?
At best, you can ear the lastly set frequency during the frame duration.
At best, you can ear the lastly set frequency during the frame duration.