# Sound: three tones on the speaker ## The circuit (DOC: SCH sheet 1, A3 and Q2/Q3) - Port 5 bits 6 and 7 leave the SL31253 PSU as TONE AN and TONE BN and drive the select inputs S1 and S0 of a 74153 dual four-input multiplexer (A3; the two halves share their selects). - One half picks a tone source: input 1 = **2V**, input 2 = **4V**, input 0 = **32V AND 8V** (through a 7400 and a 7404), from the vertical counters on sheet 2 (labels as drawn on SCH); the other half's output gates a transistor (Q3) whose collector network (C20 4.7 uF, CR5, R36 910 ohm) feeds the speaker driver Q2 (PE8050) into an 8-ohm speaker. - The capacitor network makes each tone **decay**: VW "Outputting Sound": "Sound will decay rather quickly (about 50 ms before quiet) due to the intentional hardware layout. Port needs to reinit to keep the sound on." That makes the tone an envelope triggered by the port write, not a steady square wave: the board must model the RC network (values on SCH: DOC) and its trigger (U3: what retriggers it, any write to port 5 or a change of bits 6-7). ## The frequencies (C2) | Port 5 bits 7-6 | veswiki (tier 3) | | --- | --- | | 00 | silence | | 01 (40h) | "1 kHz": 4V = line rate / 16 = 983.39 Hz NTSC, 976.56 Hz PAL | | 10 (80h) | "500 Hz": 8V = line / 32 = 491.70 Hz | | 11 (C0h) | "120 Hz": 32V = line / 128 = 122.92 Hz | SCH's tone half has 2V, 4V and 32V AND 8V on inputs 1, 2 and 0, and input 3 is not legible on the redraw. Which input each port value selects depends on the pin inversion (a 1 written pulls TONE AN/BN low; the signals are named active-low) and on which half gates the transistor: not settled tonight (U4). veswiki's labels (4V, 8V, 32V) and SCH's (2V, 4V, 32V AND 8V) differ, and the frequencies depend on the line rate, which MAME and veswiki also give differently (video.md C1). The board should derive the tones from the counter chain on SCH sheet 2 and its select wiring, and keep veswiki's values as the cross-check. Software writes 40h, 80h and C0h for the three beeps (VW). ## Programs that play tunes Music on the Channel F is the program rewriting port 5 fast (VW "Playsong", Sean Riddle's "bad sound" loop quoted in "Outputting Sound"); the result depends on the decay network and on exact write timing. VW notes it "sounds much like a broken speaker" on early consoles and better on the second generation, where sound goes to the TV. A good smoke test for the sound model is a homebrew that uses that routine (veswiki Pac-Man). ## Channel F II and later units Sound comes out through the TV (RF) instead of (or as well as) a console speaker, with a volume the TV controls (VW "Outputting Sound", "Modding"). The second-generation design routes audio through the 9102 "audio/buffer" chip (DOC: Luxor 1909583). Its envelope is not documented (U5).