โ The Sound Chip โ A Quick Recap
The Intellivision's AY-3-8914 PSG (Programmable Sound Generator) is the same chip that drives music โ see the ๐ Audio Primer on the Music Studio tab for the full architecture. The fast recap:
- 3 tone channels (A, B, C) โ each plays a square wave at a programmable period (12-bit, 1โ4095). Frequency โ
894886 / (16 ร period) Hz.
- 1 noise generator โ white noise at a 5-bit period (0โ31). Lower period = brighter / hissier; higher period = deeper rumble.
- 1 hardware envelope generator โ shapes the volume of any channel routed through it. 16 selectable shapes, settable cycle period.
- 1 mixer register โ chooses, per channel, whether tone, noise, or both reach the output.
Music uses the same chip, the same channels, the same registers. SFX has to coexist with music โ so dedicating one channel to SFX (conventionally channel C) lets the music engine keep A and B for melody.
โก Three Ways to Make Noise in IntyBASIC
MUSIC โ the song engine
High-level note streams (MUSIC C4X, E4X, G4X, M1). Best for melodies, drums, loops. Covered by the Music Studio tab.
SOUND โ direct PSG writes
SOUND register, value writes one byte to one PSG register. This is the SFX Lab's currency: short bursts of register writes that produce a single effect. Total control, total responsibility.
EXEC ROM routines
Mattel's system ROM ships pre-baked sound effects you can call via ASM CALL $XXXX โ Crowd, Razz, Whistle, etc. Sample-quality, free CPU, and identical on every Intellivision. See section โง.
DOSOUND โ the EXEC's SOUND interpreter
A bytecode interpreter for sound sequences. Convenient, but it clobbers RAM $011E (see section โจ). The SFX Lab emits direct SOUND writes instead.
โข The Four Ingredients of a PSG Sound Effect
Every preset in the SFX Lab is built from four ingredients. Tweaking them in combination is the whole game:
- Channel (A / B / C) โ which tone generator owns this effect. Channel C is the conventional SFX slot because it leaves A and B free for music.
- Frequency + how it changes (the sweep). A held tone is rare; most effects sweep from one pitch to another. Sweep shape (step / linear / exp / quadratic) is the defining "character" knob.
- Noise โ on or off, plus a period that controls timbre. Noise without tone = explosions, wind, percussion. Tone with noise mixed in = raspy lasers, missile thrusters.
- Envelope โ how the volume changes over time. Manual = linear fade per step. HW envelope = the AY's built-in shape generator (16 options).
Six of the SFX Lab's presets are multi-phase โ they chain several different "ingredient settings" end-to-end (see section โฆ). Most one-shot SFX work fine with a single phase.
โฃ Sweep Shapes โ The Character of an Effect
The Sweep dropdown in the Designer chooses how the tone moves from Freq start to Freq end across the segment's steps:
Step
Discrete pitch jumps with held values between them. The classic arcade coin pickup pattern (three rising notes). Also right for stepped fanfares and chirp sequences.
Linear
Straight-line interpolation. Workhorse for explosions, descending death cries, alien kills. Predictable, easy to dial in.
Exponential
Slow at first, then fast โ like a laser snapping down to silence. Great for sci-fi blasts and "wow" effects where the start matters more than the end.
Quadratic (Toledo stateยฒ)
Accelerating in the opposite curve โ 200 - state*state from the Pumpkin Master cookbook. Distinct character; perfect for slingshot-style rising shots.
Steps controls how many sample points the sweep lands on. More steps = smoother sweep, more SOUND writes, more bytes. 5โ12 covers most SFX; 20+ is reserved for long held effects.
โค The Noise Channel โ Texture & Period
The PSG noise generator outputs pseudo-random white noise. One 5-bit period register (SOUND 6, range 0โ31) controls timbre โ and only timbre. Volume is set per-channel via the volume register, and what reaches the output is governed by the mixer.
- Period 1โ4 โ bright crackle, almost TV-static. Glass shatter, electric fizzle, snare snap.
- Period 6โ12 โ general-purpose explosion / boom. Most arcade explosions land here.
- Period 14โ22 โ mid-deep, broadband texture. Whoosh, wind, distant thunder.
- Period 24โ31 โ sub-bass rumble. Earthquakes, big-bomb shockwaves.
The Noise Period slider in the Designer sets the starting period. Multi-phase presets sweep period across phases โ Astrosmash's classic boom sweeps 14 โ 24 over 22 frames, giving the texture-deepening signature.
Mixing tone + noise (turn on Noise and have non-zero freq) is how you get raspy lasers, throaty missile thrusters, gravelly hurts. Pure noise = percussion. Pure tone = clean pitch effects. Mix = textured.
โฅ Envelopes โ Manual vs Hardware
The volume curve over time is what separates a "tweet" from a "splat." The SFX Lab supports two modes via the Envelope Mode dropdown:
Manual
The Designer writes one SOUND 8/9/10, n per step, tapering volume linearly from peak to zero. Costs CPU โ every frame the SFX code writes a register. Total flexibility โ any curve you want, just by precomputing steps.
Best for one-shot effects under ~300ms. The default for all v1 presets.
Hardware Envelope
The AY chip has a built-in envelope generator with 16 selectable shapes and a 16-bit cycle period. Set it up once (SOUND 11, 12, 13), then write volume = 16 (bit 4 = "use envelope") to any channel. The chip drives the volume curve. Zero CPU after setup.
The musically interesting shapes are 8 & 12 (sawtooth loops) and 10 & 14 (triangle loops). Shape 0/1/2/3/9 are equivalent single-decays. Shape 11/13 hold high after the initial ramp.
The four Ambience presets (Helicopter, Siren, Seawaves, Saucer Drone) all use HW envelope to loop a shaped volume curve without burning CPU per frame. Open one and inspect the IntyBASIC output to see the SOUND 11/12/13 setup pattern.
โฆ Multi-Phase Effects โ Chaining Configurations
Complex SFX (Plasma Cannon, Boss Reactor Meltdown, Belt-Buckle Powerup) can't be expressed as a single freq sweep โ they chain multiple PSG configurations end-to-end. The SFX Lab represents this as a segments array where each segment has its own freq, noise, volume, and duration fraction.
Examples in the library:
- Belt-Buckle Powerup (2 phases): metallic noise snap โ descending tonal ring.
- Plasma Cannon (3 phases): bass thrum โ mid arc โ deep rumble tail.
- Boss Reactor Meltdown (4 phases): rising alarm โ noise chaos โ bass+noise sustain โ aftershock pulses.
- Stepped Fanfare (4 phases): four ascending tones (each a held pitch for a quarter of the total duration) โ the level-up sting pattern.
- Saucer Drone (looping, 2 phases): alternating two-tone hum that loops until stopped.
Multi-phase presets show a JSON view in the Designer instead of flat sliders โ per-phase slider editing is on the v2 roadmap. The preview and the IntyBASIC output both fully reflect the design; only the in-place editing is deferred.
โง EXEC ROM Sound Routines โ Mattel's Pre-Baked SFX
Every Intellivision boots from Mattel's 4KB EXEC ROM โ the same binary on every console, every cartridge. It contains a set of canonical sound routines you can call from IntyBASIC via ASM CALL $XXXX:
| Address | EXEC label | What it sounds like |
$1ED5 | X_PLAY_CHEER1 | Crowd cheer / applause |
$1EBA | X_PLAY_RAZZ1 | Raspberry / Bronx-cheer "groan" |
$1EBD | X_PLAY_RAZZ2 | Longer raspberry / "boo" |
$1F1B | X_PLAY_WHST1 | Referee whistle |
$1ABD | X_PLAY_NOTE | Single-note utility (one pitched bleep) |
$1EB4 | X_STOP_SFX | Silence any active SFX |
$1AA8 | X_HUSH | Silence everything (utility) |
Source of truth: jzIntv's disassembler symbol table (dasm/exec_interp.c).
Why they matter: Crowd cheer / groan are sample-quality compared to anything you can write with SOUND directly โ they're the difference between a generic arcade bleep and "the crowd reacted." The SFX Lab's EXEC tail dropdown appends one of these calls after the PSG effect, giving you instant access to compose patterns like a descending PSG tone fading into a crowd groan (see the Letdown preset). The PSG โ EXEC composition pattern itself is a contribution from Steve Ettinger โ see ยงโช.
The Web Audio preview only approximates the EXEC routines (since the actual byte sequences live in Mattel's copyrighted ROM and aren't reproduced here). The exported IntyBASIC calls the real ROM at runtime, so what you ship sounds correct.
โจ Hardware Hazard โ DOSOUND Clobbers $011E
Tip from Steve Ettinger, legendary Intellivision developer:
If you (or anyone) is using the Exec DOSOUND routine, there is a RAM address ($011E) in user RAM that gets overwritten indiscriminately by the DOSOUND โ BEWARE when coding your own game to be SURE that you burn that location with a dummy RAM variable so that your game won't be tanked by DOSOUND!
What this means for the SFX Lab:
- The Lab's generated
SOUND writes are direct PSG register writes, not DOSOUND bytecode โ so the SFX statements the Lab produces don't touch $011E themselves.
- However, the EXEC sound routines (CROWD, RAZZ, etc.) do route through DOSOUND internally. If you use the EXEC tail feature, reserve
$011E with a dummy variable so EXEC's sound interpreter doesn't silently corrupt whatever your game stored there.
- This is the same warning the Music Studio's Audio Primer carries โ it's the most common silent gameplay bug in homebrew titles that mix MUSIC + SOUND + EXEC routines.
โฉ Quick Start โ From Preset to .bas
- Click any preset in the left panel. The Designer loads the patch, the IntyBASIC output updates live, and Web Audio plays the effect immediately.
- Tweak in the Designer: channel, duration, freq sweep, noise, envelope. Every change re-renders the SOUND output and plays the next preview when you press โถ Play.
- (Optional) Add an EXEC tail โ e.g. Crowd Groan after the Letdown preset, or Referee Whistle after a foul SFX. The tail plays once at the end and is excluded from any loop.
- (Optional) Toggle Loop โ for ambient SFX like Saucer Drone or Helicopter. The output wraps in a
sfx_loop: label + GOTO sfx_loop; remove the GOTO to make it one-shot.
- ๐ Copy SOUND drops the IntyBASIC statements onto your clipboard. Paste into your
.bas file as a labelled subroutine, then GOSUB it whenever the effect should fire.
Showcase presets to demo each capability:
- Astrosmash Boom โ the canonical Intellivision death sound (noise period sweep).
- Defender Crack โ 80ms ultra-fast laser (linear sweep, max punch).
- Plasma Cannon โ 3-phase multi-segment effect (envelope buckets).
- Helicopter โ HW envelope shape 12 (sawtooth-up loop) driving the noise channel.
- Letdown โ
โ descending PSG tone + EXEC Crowd Groan composition. Showcases the PSG โ EXEC tail pattern (see ยงโช).
- Cascade โ multi-phase noise SFX (4 segments: hit โ fade โ swell โ fade). Good demonstration of the segmented patch model.
โช Sources & Credits
The SFX Lab's preset library was distilled from a treasure trove of existing Intellivision sound code. Please credit these authors when you share derived work:
-
Oscar Toledo G. (nanochess) โ author of the IntyBASIC compiler, the Advanced Programming for the Intellivision book, and the bundled
samples/ programs (envelope.bas, lander.bas, pak.bas). The Bird Chirp, Pumpkin Fire (quadratic), and all four Ambience presets descend from his cookbook and envelope demos.
nanochess.org/intybasic โ
-
Joe Zbiciak (intvnut) โ author of jzIntv (the emulator powering this editor's bit-perfect playback path) and the Space Patrol homebrew. Space Patrol's
snd/sfx.asm contributed the clean 2-word "init-record" SFX engine pattern and several looping-ambient ideas. The canonical EXEC ROM addresses in section โง come from jzIntv's disassembler symbol table.
spatula-city.org/~im14u2c/intv โ
-
Steve Ettinger โ legendary Intellivision developer. Two pieces of advice that shaped the SFX Lab:
- The $011E DOSOUND hazard warning (ยงโจ) โ his exact quote, used verbatim with permission.
- The EXEC CROWD composition pattern (ยงโง) โ pairing a PSG-synthesized SFX with an EXEC ROM routine for sample-quality endings. The Letdown preset is the editor's reference implementation.
-
The intv-game-builder collection โ Mike's own homebrew & SFX-research workbench, where most of the catalog mining for these presets happened. Source: gitlab.com/mholzinger/intybasic-workbench โ. Specific contributors to the preset library:
- Space Intruders (
games/space-intruders/) โ the unified 15-type UpdateSfx engine in waves.bas contributed Spongey Bwop, Saucer Schwing, Belt-Buckle Powerup, and Saucer Drone.
- Intruders Beats (
games/intrudersbeats/src/sfxlab.bas) โ a 27-effect cataloged sound-design ROM. Astrosmash Boom, Defender Crack, SI Missile, Sad Descent, Plasma Cannon, and Boss Reactor Meltdown. The companion intruderexplosions.bas contributed additional explosion patterns.
- downbeat / boss-test โ rhythm-game SFX patterns and boss-assembly stings. The Stepped Fanfare preset distills patterns observed across these projects.
Every preset stores its source attribution in a // Source: comment inside the preset definition in sfxEditor.js โ search there to find the originating .bas / .asm file and line for any specific effect.