--- title: "Tone Generator" id: 76653 type: "computer_media" slug: "tone-generator" url: "http://localhost/computer_media/tone-generator/" markdown_url: "http://localhost/computer_media/tone-generator.md" published_at: "2026-11-11T08:02:18+00:00" modified_at: "2026-11-11T08:02:18+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/tone-generator-1.png" excerpt: "Play tunes through a home-built tone generator: a 141-byte machine code routine reads hex tone and duration pairs from a REM line and plays them." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Nels Anderson" slug: "anderson-nels" taxonomy: "indiv" url: "http://localhost/indiv/anderson-nels/" genre: - name: "Music" slug: "music" taxonomy: "genre" url: "http://localhost/type/music/" media_type: "Program" programmers: - name: "Nels Anderson" slug: "anderson-nels" taxonomy: "indiv" url: "http://localhost/indiv/anderson-nels/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Tone%20Generator%20%281983%29%28Anderson%2C%20Nels%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1983" images: - url: "http://localhost/wp-content/uploads/2026/11/tone-generator-1.png" - url: "http://localhost/wp-content/uploads/2026/11/tone-generator-2.png" article_media: - id: 19405 title: "Tone Generator" type: "article" url: "http://localhost/article/tone-generator/" media_type_tags: "Music" license: false --- # Tone Generator The program half of a hardware project. The program only makes sound through the home-built circuit shown in the article: a 7410, a 4013 flip-flop and an LM386 amplifier on the ZX81 edge connector, mapped from 32K to 64K so that any address with A15 set toggles the flip-flop. Without the circuit the routine still runs, silently, and returns to BASIC (0/20). The routine sits in the line 1 REM (the article types it in with a short POKE loader, then deletes the loader). Line 2 sets FAST, line 10 calls RAND USR 16514, and the REM in line 20 right after the call holds the tune: pairs of four-digit hex numbers, tone then duration, separated by spaces and ending with a period. The article gives a table of tone numbers for each note across four octaves. To try it without the circuit, POKE 16575,0 and POKE 16576,211 send the output to the record jack for an amplifier or tape recorder, with noise between the tones; the download includes this record jack version as well. Published in Syntax January 1983 ([Tone Generator](https://timexsinclair.com/article/tone-generator/)). ## Source Code ``` 1 REM ............................................................................................................................................. 2 FAST 10 RAND USR 16514 20 REM 0079 0300 0045 0300 005D 0100 0061 0100 006D 0100 003D 0300 0051 0300 005D 0100 0061 0100 006D 0100 003D 0300 0051 0300 005D 0100 0061 0100 005D 0100 006D 0300. ```