This program will play 5 tunes. Just press A–E to select the music: O Canada, Solfeggietto, Aura Lee, Hopscotch and Zig-Zag. The music is played by MUSIprint, and the program is meant to be broken into and studied: the tunes are plain LPRINT strings in lines 1000–5999. A scrolling credit line runs along the bottom of the screen while it waits for a key.
MUSIC Demo version 1.1 is credited on screen to Eric Boisvert and Kris Boisvert, ©1987 Byte Power. It was published, not copy-protected, on the February 1988 tape (Issue 9) of Byte Power as the demo for MUSIprint.
Program Analysis
Program Structure
- Lines 10–100: title, switching on the music code with
LET L=USR 64828, the menu fromDATA, and the key loop - Lines 1000–5030: one tune per thousand, each a run of
LPRINTorPRINT #3lines followed byGO TO 40 - Line 9998: loader,
CLEAR 40000andLOAD "MUSIC code" CODE, thenRUN - Line 9999: save routine for the program and the code
Menu and Display
The menu sets caps lock with POKE 23658,8 so that INKEY$ returns capitals. Line 50 prints a 32-character window of the credit string in the lower screen and rotates it with B$=B$(2 TO )+B$(1); line 70 marks the chosen line with OVER 1 and jumps with GO TO 1000*(CODE K$-64). The title on line 30 is built from user-defined graphics to
.
The Code Block
MUSIC code is 684 bytes at 64828, against 540 bytes for the MUSIprint code. Its first 540 bytes match MUSIprint’s code except for six bytes; the other 144 bytes land at 65368, the UDG area, and hold the 18 graphics used for the title, so one LOAD brings in both.
Notable Techniques
- The tunes mix
LPRINTandPRINT #3, showing that both reach MUSIprint - Hopscotch stores its tune in
M$and plays it twice withLPRINT M$'M$ - Solfeggietto begins
"TEMPO:10 OCTAVE:2 …"where the other tunes useTandO, which suggests the code reads only the first letter of a command - Code and UDGs saved as one block running up to the UDG area
Potential Issues
- Line 60 accepts keys A to F, but there are only five tunes. Pressing F jumps to line 6000, which does not exist, so the program runs on to
STOPat line 9997 and ends.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
