Tone Generator

Developer(s): Nels Anderson
Date: 1983
Type: Program
Platform(s): ZX81, TS 1000
Tags: Music

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).

Related Articles

Generate tones on your ZX/TS by building this circuit and using a machine code routine with it connected.

Image Gallery

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.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.