False Echo Example

This file is part of Byte Power November 1986 . Download the collection to get this file.
Developer(s): Kristian Boisvert
Date: 1986
Type: Program
Platform(s): TS 2068

False Echo is a music playback program that reads note data from DATA statements and plays it using the SOUND command, available on the Timex Sinclair 2068. Each note is encoded as a triplet: a register-1 value (pitch high byte), a register-0 value (pitch low byte), and a duration multiplier. The program uses the AY-3-8912 sound chip’s registers directly — register 7 controls the mixer, register 8 sets the volume, and registers 0/1 set the tone period — to produce a melody with smooth note transitions. Silence/pause events are encoded with the special value 254, which lowers the volume and skips the SOUND note command, while value 255 terminates playback entirely. The piece was written by Kristian Boisvert and published by Byte Power in 1986.


Program Structure

The program is a simple sequential loop with no subroutines. Its logical flow is:

  1. Lines 20–25: DATA statements holding the note stream as triplets.
  2. Line 30: READ a,b,c — fetch the next triplet from DATA.
  3. Line 40: Termination check — if a=255, STOP.
  4. Line 50: Silence/pause check — if a=254, lower volume and skip to duration.
  5. Line 60: Play the note via SOUND.
  6. Line 70: Post-note volume shaping.
  7. Line 80: PAUSE c*10 for note duration.
  8. Line 90: GO TO 30 — unconditional loop back.

Data Encoding

Every note is stored as a three-value triplet (a, b, c):

FieldVariableMeaning
1staAY register 1 (tone period high byte), or 254 = pause, 255 = end
2ndbAY register 0 (tone period low byte)
3rdcDuration multiplier (PAUSE = c×10 frames)

The terminator triplet is 255,0,0 and silence events use 254,0,n. This is a compact encoding: two bytes define the 12-bit tone period for the AY-3-8912, and the third controls timing.

AY-3-8912 Register Usage

The SOUND keyword on the TS2068 maps directly to AY-3-8912 registers. The program uses four registers:

  • SOUND 7,62 — Register 7 (mixer): value 62 (%00111110) enables tone on channel A only, disabling noise and other channels.
  • SOUND 8,15 — Register 8 (channel A volume): set to maximum (15) before the note pitch registers are written.
  • SOUND 1,a — Register 1: tone period high byte (from triplet field a).
  • SOUND 0,b — Register 0: tone period low byte (from triplet field b).

After the note is set, line 70 issues SOUND 8,13 to reduce volume slightly from 15 to 13, creating a minor envelope effect that softens the tail of each note — the “false echo” of the title.

Notable Techniques

  • Chained SOUND parameters: Line 60 uses semicolons to set registers 7, 8, 1, and 0 in a single statement (SOUND 7,62;8,15;1,A;0,B), which is more efficient than four separate calls.
  • Volume-based articulation: The step-down from volume 15 to 13 after each note, and a further drop to 10 during pause events (line 50), simulates a crude amplitude envelope without needing the AY’s hardware envelope generator.
  • Pause event design: Using the sentinel value 254 in the same a field as pitch — and using GO TO 80 to skip the SOUND note command — keeps the data format uniform (always three values) while cleanly handling rests.
  • Duration scaling: PAUSE c*10 maps small integers in the data to 50Hz frame counts (e.g., c=1 → ~0.2 s, c=4 → ~0.8 s), giving convenient granularity without large DATA values.

Content

Appears On

Tape-based magazine.

Related Products

Related Articles

This month I will show you how to make an echo while playing a music. I call this echo ‘THE...

Related Content

Image Gallery

False Echo Example

Source Code

10 REM   FALSE ECHO                                             WRITTEN BY KRISTIAN BOISVERT                                          ©1986 BYTE POWER         
   15 REM DATA FOR MUSIC
   20 DATA 4,92,1,254,0,1,3,117,1,2,232,1,254,0,1,3,117,1,3,68,1,254,0,1,3,117,1,3,226,1,254,0,2,3,226,1,254,0,1,3,68,1,3,68,1,254,0,1,3,226,1,3,117,1,254,0,1,3,226,1,4,92,1,254,0,2
   25 DATA 4,92,1,254,0,1,3,117,1,2,232,1,254,0,1,3,117,1,3,68,1,254,0,1,3,117,1,3,226,1,254,0,2,2,232,1,254,0,1,2,232,1,2,232,1,254,0,1,3,68,1,3,117,1,254,0,1,3,226,1,4,92,4,255,0,0
   26 REM READ NOTES
   30 READ a,b,c
   35 REM A=255 THEN MUSIC STOPS!
   40 IF a=255 THEN STOP 
   45 REM PAUSE?,LOWER VOLUME AND         GOTO LINE 80 (DURATION)
   50 IF A=254 THEN SOUND 8,10: GO TO 80
   55 REM PLAY NOTE!
   60 SOUND 7,62;8,15;1,A;0,B
   65 REM LOWER VOLUME FOR                SMOOTHER DELIVERY
   70 IF A<>254 THEN SOUND 8,13
   75 REM DURATION OF NOTE
   80 PAUSE C*10
   85 REM COMPLETE LOOP
   90 GO TO 30

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

Scroll to Top