Forum Discussion
Altera_Forum
Honored Contributor
8 years agoI suspect you have a subtle typo somewhere. However, it's not evident in the code you've posted.
A more general observation - a counter per note is fine. However, you're controlling and selecting each counter based on your switched. May I suggest running the note counters continuously, each with their own 'dac_out' signal, and selecting which one you wish to pipe to the DAC. This will simplify your code greatly. Simpler code leaves less room for error. Alternatively, a single counter, and single 'dac_out' signal, but with selectable wrap points based on note selection. Either way, I'm sure the simpler code that would result, from either method, will help. Cheers, Alex