Forum Discussion
Altera_Forum
Honored Contributor
12 years agoRegarding to the rom contents, for example if the 1st note is la ( 440Hz ) and system clock is 50MHz, you may store as first value in the rom table:
50MHz/440Hz = 113636 It's a huge value, you'll need many bits. You may slow down 50MHz so you get a smaller divisor number. If you generate a tick of 1MHz this divisor factor is: 1MHz/440Hz = 2273 ( this will be the first value on rom table ). In the second table you store the duration. For example, if the note lenght is 250ms and the note period: 1/440Hz=2,27ms The duration is 110 clock periods ( you put this as first value in the duration's table ). And so on.