June
2000, Issue 119
The
Chips are Alive with the Sound of Music
Imitatiing
the Dead Melody IC
TEA
FOR TWO
The
interrupt routine requires less than the 64 µs that
timer0 allows. If it didnt, no other work could
be done. It has enough time, in fact, that the note
generation code can be duplicated to allow for a second
note. The second note would be output at the same time
as the first, creating harmony. In addition, a second
note requires a second note table. This isnt a
problem, but it created unusual output when I entered
one wrong timing bit. The first time through the tables,
the notes were in time with each other. However, after
the incorrectly notated note played, the two parts were
out of sync. And, each time through, they grew further
apart. This is where separating the table data into
groups (measures) makes it easy to locate errors.