This three-line program plays a musical or sound effect using the TS2068’s AY-3-8910 sound chip via the SOUND command, then loops continuously. The SOUND statement configures ten registers of the AY chip in a single call: registers 6 and 0–5 set noise period and tone/noise/envelope parameters, registers 9–10 and 8 set channel volumes, register 7 is the mixer control (value 48, enabling specific channel combinations), and registers 12–13 define the envelope period. The PAUSE 3 introduces a short delay of approximately 3/50ths of a second between repetitions before GO TO 1 restarts the loop.
Program Structure
The program consists of just three executable lines after the title REM, forming an infinite loop:
10— Fire a multi-registerSOUNDcommand to the AY-3-8910 chip20—PAUSE 3(~60 ms delay at 50 Hz)30—GO TO 1(jumps back to line 0’s REM, effectively restarting from line 10)
GO TO 1 targets line 0’s REM rather than line 10 directly. Since a REM executes as a no-op, the loop still works correctly, but it is a minor inefficiency — GO TO 10 would be marginally faster as no line-search step is wasted.
AY-3-8910 Register Programming
The single SOUND statement on line 10 sets ten registers in one call using the TS2068 paired register syntax register,value:
| Register | Value | Function |
|---|---|---|
| 6 | 18 | Noise period (18 = relatively low-frequency noise) |
| 0 | 250 | Channel A tone period (low byte) |
| 1 | 7 | Channel A tone period (high byte) — combined ~1786 giving a low pitch |
| 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-controlled (bit 4 set) |
| 10 | 16 | Channel C amplitude — envelope-controlled (bit 4 set) |
| 8 | 16 | Channel A amplitude — envelope-controlled (bit 4 set) |
| 7 | 48 | Mixer: binary 00110000 — noise enabled on channels A & B, tones on all disabled |
| 12 | 2 | Envelope period (low byte) — fast envelope cycle |
| 13 | 0 | Envelope shape: single decay, no repeat |
All three channels have their amplitude registers set to 16 (envelope mode). Envelope shape register 13 = 0 selects a one-shot decaying waveform. The mixer value 48 (0b00110000) enables noise on channels A and B while disabling all tone outputs, producing a purely noise-based percussive burst reminiscent of rotor noise — consistent with the “HELICO” (helicopter) title.
Notable Techniques
- Using a single
SOUNDcall with multiple register pairs is the most efficient way to set up a complex AY sound in one atomic operation, avoiding audible gaps between register writes. - Setting all amplitude registers to 16 ties all three channels to the single hardware envelope generator, giving a unified volume contour without per-channel software timing.
- The
PAUSE 3acts as a minimal delay so the envelope has time to complete its decay before the next trigger, preventing the registers from being re-written mid-cycle. - The REM at line 0 serves as a program header/splash, storing the title and copyright in a location that costs nothing at runtime since the loop re-enters at line 10 after the first pass — though as noted,
GO TO 1does needlessly scan past line 0 on each iteration.
Content
Source Code
0 REM HELICO 2 WRITTEN BY K. BOISVERT ©1986 BYTE POWER
10 SOUND 6,18;0,250;1,7;2,255;3,7;4,255;5,7;9,16;10,16;8,16;7,48;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.
