This week, I worked on implementing the basic waveforms in RTL. This process involves describing the 4 basic waves we set out to provide to the user, sine, square, saw, and triangle, and then allowing the user to play these notes out through the MIDI keyboard. In order to do this, I am using a LUT for the sine wave values. I generated this LUT using python, and then stored the values in BRAM. Then, I use a phase accumulator to index into the LUT table and play out the corresponding amplitude for that phase index. For playing different frequencies (AKA pitches), we can vary how much we increment the phase in every clock cycle. I have implemented this partially in RTL, but am now planning on verifying it by capturing the output and then comparing it with the sine wave we would expect for a given note. The next step will be to try to play the audio out of the CODEC, to verify that the generation is happening smoothly. Additionally, I will also work on the square, saw, and triangle wave, which will need interpolation in order to properly play and avoid harsh aliasing errors.
