--- title: "Helicopter 1 Sound Example" id: 63148 type: "computer_media" slug: "helicopter-1-sound-example" url: "http://localhost/computer_media/helicopter-1-sound-example/" markdown_url: "http://localhost/computer_media/helicopter-1-sound-example.md" published_at: "2026-01-30T17:36:44+00:00" modified_at: "2026-03-30T21:42:57+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/01/helico-1.png" excerpt: "A compact three-line loop drives the TS2068's AY sound chip through multiple registers simultaneously to recreate the thrum of a helicopter rotor." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" genre: - name: "Sound" slug: "sound" taxonomy: "genre" url: "http://localhost/type/sound/" media_contents: - id: 63045 title: "Byte Power September 1986" type: "computer_media" url: "http://localhost/computer_media/byte-power-september-1986/" media_type: "Program" programmers: - name: "Kristian Boisvert" slug: "boisvert-kristian" taxonomy: "indiv" url: "http://localhost/indiv/boisvert-kristian/" mediadate: "1986" producer_company: - id: 25181 title: "Byte Power" type: "company" url: "http://localhost/company/byte-power/" article_media: - id: 63031 title: "Better Programming" type: "article" url: "http://localhost/article/better-programming-4/" media_type_tags: "Sound" --- 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: 1. `0 REM` — Title, author, and copyright banner stored in the REM payload. 2. `10 SOUND` — Configures the AY-3-8910 chip with a multi-register `SOUND` statement. 3. `20 PAUSE 3` — Introduces a brief delay (~0.18 s at 50 Hz) between sound restarts. 4. `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 `SOUND` keyword call, which is more efficient than separate calls and ensures near-simultaneous register updates. - **GO TO non-existent line:**`GO TO 1` targets 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 3` waits approximately 60 ms, controlling the repetition rate of the envelope re-trigger and shaping the perceived rotor tempo. ## 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 ```