dv.6502.src.txt Assembler source for my APPLE II. Part of a program to play two part harmonies on a toggle speaker driven by a 1 MHz processor. The code takes the same number of clock ticks regardless of the conditional branches selected. Lowercase wasn't available in that environment. The method of generating two tones from a toggle speaker is the approximation of each tone by a periodic asymmetric rectangle pulse. The period of each tone is a multiple of a fundamental period P, about 100 microseconds. The pulse is low for all but 8 to 15 microseconds of its period. The crests for voice 1 occur at one phase of period P. The crests for voice 2 occur at a different phase. Thus, the crests never interfere. The other parts are: a BASIC program which writes the 25 variants of the main loop. Only the first is shown. The variants differ in the delay between speaker toggles, which adjust the width of the pulse crests. The width of the crest is perceived as a difference in loudness. an assembly language program to calculate the delay lengths and counter initializations for each note. a BASIC program to translate nearly human-readable music notation (pitch numbers in half-steps, tied notes, dynamics, durations) into instructions for the delay and counter calculator. The result of this project was a 5.25 inch floppy disk with the content to reproduce the 15 Two Part Inventions by J. S. Bach.