This program produces a sound effect using the TS2068’s built-in SOUND command, intended to simulate a helicopter. The SOUND statement at line 10 configures multiple registers of the AY-3-8910 sound chip in a single statement, setting tone periods, noise periods, mixer, amplitude, and envelope parameters across registers 0–13. A short PAUSE 3 (approximately 0.18 seconds at 50 Hz) follows before the program loops indefinitely via GO TO 1, which uses VAL-less direct line referencing to a non-existent line, effectively halting or restarting. The REM at line 0 contains the program title, author attribution (K. Boisvert), and copyright notice for Byte Power (1986).
Program Structure
The program consists of just three executable lines plus a header REM:
0 REM— Title, author, and copyright banner stored in the REM payload.10 SOUND— Configures the AY-3-8910 chip with a multi-registerSOUNDstatement.20 PAUSE 3— Introduces a brief delay (~0.18 s at 50 Hz) between sound restarts.30 GO TO 1— Loops back; line 1 does not exist, so the interpreter finds line 10 as the next available line, restarting the sound effect continuously.
AY-3-8910 Register Usage
The SOUND keyword writes directly to named AY chip registers in register,value pairs separated by semicolons. The registers programmed are:
| Register | Value | Function |
|---|---|---|
| 0 | 254 | Channel A tone period (low byte) — very low frequency |
| 1 | 7 | Channel A tone period (high byte) |
| 2 | 255 | Channel B tone period (low byte) |
| 3 | 7 | Channel B tone period (high byte) |
| 4 | 255 | Channel C tone period (low byte) |
| 5 | 7 | Channel C tone period (high byte) |
| 9 | 16 | Channel B amplitude — envelope mode enabled (bit 4 set) |
| 10 | 16 | Channel C amplitude — envelope mode enabled |
| 8 | 16 | Channel A amplitude — envelope mode enabled |
| 7 | 56 | Mixer: %00111000 — all tone channels enabled, noise disabled |
| 12 | 2 | Envelope period (low byte) — fast envelope cycle |
| 13 | 0 | Envelope shape — single decay (sawtooth down) |
All three tone channels are set to nearly identical, very low frequencies (period ≈ 0x07FE–0x07FF), producing a deep drone. Envelope mode on all amplitude registers (value 16, bit 4 set) ties each channel’s volume to the shared envelope generator. The short envelope period (register 12 = 2) and shape 0 create a rapid amplitude decay that repeats as the loop restarts, mimicking the periodic thwop of rotor blades.
Notable Techniques
- Multi-register SOUND in one statement: All 12 register writes are chained in a single
SOUNDkeyword call, which is more efficient than separate calls and ensures near-simultaneous register updates. - GO TO non-existent line:
GO TO 1targets line 1, which does not exist. The TS2068 BASIC interpreter responds by jumping to the next line numerically above 1, which is line 10. This is a common size-saving trick. - Envelope shape 0 behaviour: Writing to register 13 resets the envelope generator, meaning each pass through the loop re-triggers the envelope attack/decay from the beginning, reinforcing the rhythmic chopping sound.
- PAUSE 3: At 50 Hz,
PAUSE 3waits approximately 60 ms, controlling the repetition rate of the envelope re-trigger and shaping the perceived rotor tempo.
Content
Image Gallery
Source Code
0 REM HELICO WRITTEN BY K. BOISVERT ©1986 BYTE POWER
10 SOUND 0,254;1,7;2,255;3,7;4,255;5,7;9,16;10,16;8,16;7,56;12,2;13,0
20 PAUSE 3
30 GO TO 1
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.