--- title: "Amazi-Music" id: 63236 type: "computer_media" slug: "amazi-music" url: "http://localhost/computer_media/amazi-music/" markdown_url: "http://localhost/computer_media/amazi-music.md" published_at: "2026-01-31T13:57:53+00:00" modified_at: "2026-03-30T21:40:57+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/01/amazi-music.png" excerpt: "A music player with POKE-accessible controls for tempo, volume, and voice settings." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Eric Boisvert" slug: "boisvert-eric" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-eric/" genre: - name: "Music" slug: "music" taxonomy: "genre" url: "http://localhost/type/music/" media_contents: - id: 63047 title: "Byte Power December 1986 – January 1987" type: "computer_media" url: "http://localhost/computer_media/byte-power-december-1986-january-1987/" media_type: "Program" programmers: - name: "Eric Boisvert" slug: "boisvert-eric" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-eric/" mediadate: "1987" producer_company: - id: 25181 title: "Byte Power" type: "company" url: "http://localhost/company/byte-power/" images: - url: "http://localhost/wp-content/uploads/2026/01/amazi-music.png" article_media: - id: 63101 title: "Amazi-Music" type: "article" url: "http://localhost/article/amazi-music/" media_type_tags: "Music" --- # Amazi-Music AMAZI-MUSIC is a music playback program that loads and executes a machine code music player along with accompanying music data. The program uses two separate CODE blocks: a 450-byte machine code routine starting at address 64902, and 3,443 bytes of music data starting at address 61459. Key parameters of the player are controlled via POKEs to specific addresses, including tempo (64915), main volume (64988), end-note volume (64998), and the address of the music data itself (64897). A sanity check at line 9015 uses PEEK 23681 to verify the machine code loaded correctly before attempting playback via RANDOMIZE USR 65296. *** ## Program Analysis ### Program Structure The BASIC portion of AMAZI-MUSIC is compact, serving primarily as a loader and launcher for external machine code. The REM blocks at lines 1–160 serve as inline documentation for the programmer, listing USR entry points and POKE addresses. The executable logic begins at line 9000 and is intentionally placed at a high line number, likely to keep it out of the way of any future BASIC additions or to co-locate it with the SAVE routine at line 9999. 1. **Lines 1–160:** REM documentation block listing all relevant addresses and their purposes. 2. **Line 9000:** Clears the screen and prints a loading message. 3. **Line 9010:** Loads the machine code player (`AMAZIN MC`) and music data (`MUSIC DATA`) from tape. 4. **Line 9015:** Sanity check — if PEEK 23681 returns 0, the load is considered failed and the program halts. 5. **Line 9020:** Executes the music player via `RANDOMIZE USR 65296`, then lists and stops. 6. **Line 9999:** SAVE block for re-saving the full program suite to tape. ### Machine Code Layout The machine code occupies the upper RAM area, with the player engine at address 64902 (450 bytes) and music data starting at 61459 (3,443 bytes). This places both blocks in high memory, above the normal BASIC/variable area, a common technique to keep machine code safe from BASIC memory management. | Address | Purpose | Size / Notes | | --- | --- | --- | | 61459 | Music data (demo) | 3,443 bytes | | 64892 | Last free byte marker | — | | 64897 | Pointer to music data | POKE to change song | | 64902 | Machine code player start | 450 bytes | | 64915 | Tempo control | Range 0–254 | | 64947 | End music code | — | | 64957 | Voice open parameter | Format: 7,X | | 64967 | Pause code | — | | 64988 | Main volume | — | | 64998 | End note volume | — | | 65296 | USR entry: start music | — | | 65309 | USR entry: end music | — | ### Notable Techniques - **PEEK-based load verification:** Line 9015 checks `PEEK 23681` against 0 to detect whether the machine code loaded successfully. Address 23681 is in the system variables area, and the machine code presumably writes a non-zero sentinel value there during initialization. - **RANDOMIZE USR for execution:**`RANDOMIZE USR 65296` at line 9020 is the standard idiom for calling machine code without needing to handle the return value, as `RANDOMIZE` discards any integer result gracefully. - **Parameter exposure via POKE:** The REM block documents a clean POKE-based API, allowing users to adjust tempo, volume, voice settings, and even swap in different music data by changing the pointer at 64897 — making the player effectively data-driven. - **Dual USR entry points:** Separate entry points at 65296 (start) and 65309 (end) give BASIC programs fine-grained control over playback lifecycle without reloading the engine. - **LIST after USR call:** The `LIST : STOP` sequence following `RANDOMIZE USR` in line 9020 suggests the music player returns to BASIC when finished, at which point the program tidily displays its own listing and halts. ### Save Block Line 9999 packages the entire suite for re-distribution: the BASIC loader saves with `LINE 9000` as the auto-run entry point, followed by the machine code block and music data block. The trailing `VERIFY ""CODE : VERIFY ""CODE` calls confirm both CODE blocks saved correctly, which is good practice given the large size of the music data. ## Source Code ``` 1 REM AMAZI-MUSIC by Eric Boisvert ©1987 BYTE POWER 10 20 REM USR CALLS 30 REM 65296 START MUSIC 40 REM 65309 END MUSIC 50 REM USEFUL POKE 60 REM 64915 TEMPO (0-254) 70 REM 64988 MAIN VOLUME 80 REM 64998 END NOTE VOLUME 90 REM 64947 END MUSIC CODE 100 REM 64967 PAUSE CODE 110 REM 64957 VOICE OPEN (7,X) 120 REM ADDRESS 130 REM 64897 ADDRESS OF MUSIC 140 150 REM 64892 LAST FREE BYTE 160 170 REM 61459 MUSICS [DEMO] 9000 CLS : PRINT AT 10,0;"STILL LOADING..."'' 9010 LOAD "AMAZIN MC"CODE : LOAD "MUSIC DATA"CODE 9015 IF PEEK 23681=0 THEN CLS : LIST 9999: STOP 9020 RANDOMIZE USR 65296: LIST : STOP 9999 SAVE "AMAZIMUSIC" LINE 9000: SAVE "AMAZIN MC"CODE 64902,450: SAVE "MUSIC DATA"CODE 61459,3443: VERIFY "": VERIFY ""CODE : VERIFY ""CODE ```