Complete 72 allophone binary for testing

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

Here's a 4K binary that plays, one by one, the 72 allophones.  This is a test ROM purely for validating SpeakJet output by the emulator. Unfortunately at this point I don't have any hardware to test with.  If anyone is able to run this on actual hardware and make an audio recording of the output -- that would *significantly* help the project produce an accurate emulation.

ROM starts making sound when you press the joystick button!


SpiceWare

I captured this using QuickTime and a USB audio capture device plugged directly into the AtariVox. 

Andrew Davie

Quote from: SpiceWare on 26 Oct 2026, 03:38 AMI captured this using QuickTime and a USB audio capture device plugged directly into the AtariVox.

Many thanks; much appreciated. As the first recording in-hand from hardware this has led to a number of improvements. I've used Claude to do a full analysis/comparison, and here's what it has to say...

-----------------------------

The recording gives solid timing, Speed and effects data, but the take is too overdriven for levels or vowel formants.

**Problems with the take**
- **Clipping:** about 15% of samples in every vowel are clipped, and even Volume 16 clips. The recorder input was overdriven by about 20 dB or more.
- **Noise:** hum and ground-loop noise sit at −23 dBFS, and serial-line clicks get into the audio.
- **Recorder clock:** it ran 0.48% slow. The 15.8 kHz whine is the 2600's 15734 Hz line rate, and every DTMF tone reads high by the same 0.5%, so the chip's own frequencies are exact.

Timing, pitch and the fricative spectra (which don't clip) are reliable. Levels, the Volume curve and vowel formants are not; an LPC check on IY gave nonsense.

**Strong findings**
1. **Speed is linear, not exponential.** Group duration is d(s) = 2.115 − 0.0145·s seconds, which predicts Speed 20, 40 and 60 to within 2%. Relative to the default 114 that's a factor of (146 − s)/32, so 4.6× at Speed 0; the library's `exp(−0.02(s−114))` gives 9.8×. At Speed 127 it's about 0.6×, against the library's 0.77×.
2. **Pauses scale with Speed on the chip.** The gap after each Speed group grows by the same factor (400 ms nominal becomes 1.845 s at Speed 0). The library never scales pauses.
3. **Some pause lengths are wrong.** The silent gap measures 655 ms for P3 (library 705), 27 ms for P5 (library 53) and 59 ms for P6 (library 81). This confirms the earlier P6 hint. P1, P2 and both Delays are already right.
4. **The flat "steady ×1.5" length is wrong by class.** In audible ms, hardware vs library:
   - nasals: 92–102 vs 132–136
   - LE, LO, WW: 94–110 vs 124–132
   - VV, ZH, DH: about 92 vs 136
   - HE, HO, WH, FF: about 75 vs 116
   - GE, GO, EG, OG: 40–56 vs 88
   - JH: 62 vs 96
   - SE and SO are longer on hardware (86–100 vs 72), and so is TU (86 vs 52).
   - DTMF tones last about 155 ms on hardware, not the manual's 95.
   - Diphthongs are mostly within 5%.
5. **Fricatives reach about 5 kHz and are sharply peaked.** SE and SO peak at 3.5–4.5 kHz, SH at 2.2–2.8 kHz, and HE, HO and WH have distinct lower peaks. The library renders at 8192 Hz (nothing above 4.1 kHz) and adds a 2200 Hz output filter, so its fricatives are flat noise below 2 kHz. This is probably the most audible gap, and fixing it means a higher sample rate.
6. **Most sound effects are completely different sounds.**
   - R0–R9 are tones stepping up about 300 Hz each, starting near 800 Hz.
   - The A, B and C sets are swept, stepped or triangle pitch contours.
   - M0 is about 1.2 s of a steady ~1.8 kHz tone.
   - A1 and A2 each last about 960 ms.

   Each one's pitch track and envelope can be measured from the recording.

**Weaker findings**
- Pitch reads 1.6–2.8% flat from 160 Hz up (250 measures 243).
- Bend shifts the vowel envelope by about 6–9% per step, a little more than the library's 5.9%. It leaves SE untouched and doesn't change F0.
- Soft (18) does nothing and Repeat works, both matching the library.

**Not resolved**
- **Which of 135/136 says "hot":** the clipped vowels can't settle it.
- **Volume curve:** not measurable from this take.
- **Extra sounds:** between the Speed 80 and Speed 100 groups (about 99.7–101.1 s) there's a blip and a three-part tonal sound that match nothing in the stream, possibly a corrupted serial byte.

If you can record a second take, a direct line-in at about 25 dB lower gain (Volume 127 peaking around −6 dBFS), with the ground loop removed, would make levels, formants and the Volume curve measurable.

-----------------------------

I am hoping to have a number of people contribute captures of the audio, and continually refine the analysis and remulation. The last paragraph from Claude is it's desire - I expect that these issues will "flatten out" with recordings from other setups. I am very happy to receive this one from you - it's already made a huge difference. TY!


Andrew Davie

**SpeakJet emulation: results from a real AtariVox capture**

From a recording of a real AtariVox playing a purpose-built test ROM (VoxRecord, built on Alex Herbert's vox_test and AtariVox driver). It plays every allophone and every sound effect on its own, plus sweeps of Pitch, Speed, Bend and Volume, all the pauses and delays, Fast/Slow/Stress/Relax, Repeat, and the undocumented code 18 ("Soft"). I then compared it sound by sound with the emulation playing the same bytes.

The capture was overdriven, so the vowels are clipped. Timing, pitch and the fricatives (which don't clip) are solid; vowel levels, vowel formants and the Volume curve will need a quieter take.

What changed in the C library (andrew-davie/SpeakJet) and the Go library (andrew-davie/SpeakJetGo, which Gopher2600 uses):

- **Speed is linear, not exponential.** Length scales as (146 − Speed)/32, which matches the hardware to within 2% from Speed 0 to 80. At Speed 0 that's 4.6× the default length; the old curve gave 9.8×.
- **Pauses follow Speed.** At Speed 0, a 400 ms pause becomes about 1.85 s. The old code never scaled pauses.
- **Pause lengths:** pause 3 is about 650 ms rather than the manual's 700, pause 5 is about 35 rather than 60, and pause 6 is about 70 rather than 90.
- **Each allophone has its own length,** fitted to the chip. All are within 2 ms of the hardware except EYRR, which is 6 ms out.
  - Front vowels run about 140 ms.
  - Nasals, liquids and HE/HO/WH/FF are much shorter than before: about 75–110 ms, where they had been 30–40 ms too long.
- **Fricatives are reshaped** to the chip's measured spectra. SE and SO peak at 3.2–4 kHz, SH at 2–3 kHz and HE/HO around 1–1.5 kHz. The old ones were broad noise below 2 kHz.
- **DTMF tones last about 153 ms,** not the manual's 95.
- **Sound effects are now traced from the hardware.** Every effect except DTMF and M1 follows the chip's measured pitch and level over time.
  - Most are nothing like guesses based on their names: the B-series "beeps" are triangle and stepped sweeps, and R0–R9 are clean tones climbing about 300 Hz per step.
  - Many lengths differ from the manual: A1 and A2 last nearly a second, and M0 is a 1.2 s tone at about 1.8 kHz.
  - A1, A2, A3 and M2 buzz at about 87 Hz, the default speech pitch.

Already right before this work:
- Pitch from 30 to 120 Hz
- pauses 1, 2 and 4, and both delays
- Fast and Slow (roughly 0.65–0.75× and 1.3–1.5×)
- Repeat
- Soft (18) does nothing audible

Text-to-speech length estimates (text2speakjet) use the new timing, and the reference samples were regenerated. The C and Go outputs still agree to the last bit or so. Gopher2600 picks all of this up on its next build.

**Still to understand**

- **Bend on sound effects.** Bend does change the effects, but not by scaling them the way it scales speech. For example, D1's two tones shift together and keep their exact 512 Hz spacing. At Bend 0 they're at 501/1012 Hz, at Bend 5 at 697/1209, and at Bend 15 at 629/1138, so the shift isn't even monotonic.
- **Bend on vowels:** roughly 6–9% per step. It doesn't affect SE at all. The clipping makes this a rough figure.
- **Vowel formants and levels:** not measurable from a clipped take.
- **The Volume curve:** even Volume 16 clipped.
- **Which of 135/136 says "hot":** the manual and PhraseALator disagree on which is OH and which is AW.
- **The output filter:** fricatives have energy up to 4 kHz, which an output filter at around 2.2 kHz would cut by 10 dB or more. Is that filter real, or should the vowels be brighter?
- **High Pitch values** come out 1.6–2.8% flat on the chip (250 Hz plays as 243). That looks like a fixed per-cycle overhead in the chip's pitch counter.
- **Effect timbres.** The traces keep only each effect's strongest frequency. A5, A8 and M2 have rich harmonic stacks that a clean recording could reveal.
- **Whether Delay (code 30) scales with Speed:** not tested away from the default speed.
- **A stray sound** between the Speed 80 and Speed 100 groups doesn't correspond to anything in the byte stream. Possibly a corrupted serial byte.

Andrew Davie

I've made four comparison graphs, each showing hardware, the original library and the new library side by side. The PNGs are in `~/Downloads/speakjet_vox_graphs/`, sized for a forum post. Every library curve was rendered fresh from both versions and measured the same way as the hardware.

1. **`1_fricative_spectra.png`:** SE, SH, HE, HO, WH and FF as third-octave spectra. Each panel shows its error against hardware:
   - SH, HE and FF improved most: SH from 8.3 to 1.9 dB, HE from 6.9 to 2.7, FF from 6.2 to 2.2.
   - WH went from 7.9 to 3.9 dB. HO improved least, from 4.9 to 4.0.
   - SE went from 12.1 to 7.0 dB. It peaks at the right place now, but the hardware has a dip around 1.5–2 kHz that the new version doesn't reproduce.
2. **`2_speed.png`:** two panels.
   - **Group length vs Speed:** the original curve runs to nearly twice the hardware at Speed 0. The new line follows the hardware's shape but sits 5–10% short at the slowest speeds, partly because the stops in the group keep their fixed lengths.
   - **Silence after each group:** the original is flat at 0.4 s at every Speed; the new library lands on the hardware points.
3. **`3_allophone_lengths.png`:** the library's length against the hardware's, one point per allophone. Mean error drops from 20 ms to 0.4 ms. The two annotated clusters are the old main faults: nasals, VV and ZH too long, front vowels too short.
4. **`4_effects.png`:** spectrograms of B1, R5, B9, A1 and M0. The original guesses look nothing like the hardware, and the new traces follow its shape and length. A1 is the weakest: it keeps the rising contour but not the dense harmonic texture, and it has a dip near 800 ms where the trace switched to a different component.

The extra lines in the hardware spectrograms come partly from the clipping, and the subtitle says so.

SpiceWare

#5
Only options for audio capture in QuickTime are Input Source and Quality of High or Max, nothing for gain.

Back in 2016 I picked up this inline volume control, I've temporarily put it between the AtariVox* and audio capture device. I set it at the halfway point for the 2nd capture.

I read up on the "ground loop" as I didn't know what that meant.  My office has 3 electrical circuits and the Atari/C=1084 is on a different circuit than my Mac so that might be the source of the hum. However, I also hear the hum when plugged into the passive speakers** which suggests the ground loop is a design flaw with the AtariVox itself. 

* in case it matters I'm capturing an AtariVox+ Vectrex Enhanced as couldn't locate my original AtariVox.

** Sony SRS-P7 speakers, which do not use batteries or power source.  Here's a set on ebay in original packaging in case you need more info about them.

SpiceWare

I found an Input Volume for the Audio Capture device in Apple -> System Settings -> Sound -> Input:

Andrew Davie

Quote from: SpiceWare on 26 Oct 2026, 06:29 AMI found an Input Volume for the Audio Capture device in Apple -> System Settings -> Sound -> Input:

TY. Unclear to me if there's supposed to be a new recording attached to this message?

Andrew Davie

Here's the results after processig the *second* recording. Some improvements found, so TY!

----------
**The second take:** it's slightly cleaner (4.7% of samples clipped against 6.1%, and the noise floor about 6 dB lower), but the vowels are still clipped. It agrees with take 1:

|----------------------------------|----------------------------------------------|
| Measurement                      | Take 2 vs take 1                             |
|----------------------------------|----------------------------------------------|
| Allophone lengths                | 2.5 ms apart on average, 12 ms at most (SE)  |
| Fricative spectra                | 2–4 dB apart                                 |
| Speed sweep and pause stretching | within 15 ms                                 |
| Effect contours                  | within a semitone, except C8, which is noise |
| Pitch                            | same 1.6–3% flatness above 160 Hz            |
|----------------------------------|----------------------------------------------|

**Library changes (C, Go, and the GPL C copy in the Go repo):**
- **Lengths and fricatives** are refitted to the average of the two takes. Lengths are now 1.1 ms from the hardware on average.
- **Pause 5** is 45 ms rather than 35. I used the two Delay codes, whose length is exact, as a reference for measuring pauses. The other pauses were within 10 ms of the hardware already.
- **Bend on sound effects** now adds a fixed amount to the frequency instead of multiplying it. I misread this in take 1. DTMF digit 1's two tones at Bend 0, 1, 5, 10 and 15 are 501/1012, 545/1054, 699/1208, 919/1428 and 1138/1648 Hz: both tones move by about 44 Hz per step and stay 512 Hz apart. A5 shifts by the same amounts at Bend 0 and 1. The library now produces 499/1011 at Bend 0 and 917/1429 at Bend 10. Speech still uses the old Bend rule, because the clipped vowels can't show which rule applies.

All C tests pass and the Go tests pass. Go and C still produce essentially the same output (13 near-silent samples differ by less than 4e-9). I regenerated the reference samples, synced text2speakjet's timing tables, updated design.md and the CHANGELOG, and rebuilt Gopher2600.

**The "extra sound" is real.** It appears identically in both takes, so it's not a corrupted byte. It's an 85 ms burst followed by three 180 ms tones at 746, 501 and 746 Hz, right after the Speed 80 group, where the bytes are `2 2 21 100 191 136 154 187`. Alex's driver sends bytes plainly and there's no page-wrap bug, and the sound doesn't match any of the 55 effects. Playing `21, 100` on its own in a small test ROM should show what triggers it. I've added it to the "still to understand" list in design.md.

- **Fricatives:** the new library's error is lower than the original's for all six (for example SE 12.3 → 7.2 dB, SH 8.8 → 3.0 dB).
- **Speed:** both takes are plotted and sit on top of each other.
- **Allophone lengths:** the average error falls from 20 ms to 1.1 ms.
- **Effect spectrograms:** these now use take 2.
- **`5_bend_effects.png` (new):** DTMF digit 1 against Bend. The original library's two lines spread further apart; the new library's parallel lines go through the hardware points. The small step between Bend 4 and 5 is the 22 Hz offset that the recorded Bend values can't place.


SpiceWare

No recording was included with the input volume screen, was just showing a setting that we could try if needed.

I noticed there's 20 ticks marked around the volume knob between the MIN and MAX labels, was hard to see them until I shined a light on it.  The 2nd recording was most likely set to tick 10, though I'm not 100% positive as I'd moved it while doing later tests with passive speakers.  For this recording I set it to the 5th tick from MIN.

I discovered VLC has an audio scope (Audio -> Visualizations -> Scope) where I could see the waveforms getting clipped in the first 2 recordings.  I didn't notice any clipping with this recording, though I didn't watch the entire thing.

I also noticed the sound only came out one speaker for the first 2 recordings, but for the 3rd it's coming out both speakers.

Andrew Davie

#10
Quote from: SpiceWare on 26 Oct 2026, 10:42 AMI discovered VLC has an audio scope (Audio -> Visualizations -> Scope) where I could see the waveforms getting clipped in the first 2 recordings.  I didn't notice any clipping with this recording, though I didn't watch the entire thing.


It seems to be quite an improvement, TY.
After analysis of this, one we get...

**SpeakJet emulation update: three hardware captures, and what they changed**

Since the last update there have been two more recordings of a real AtariVox playing the VoxRecord test ROM. The first two takes were overdriven, so the vowels clipped. That still gave reliable timing, but not levels or timbre. The third take was recorded at a lower level and is essentially clean: 0.25% of samples clip, and the noise floor is 18 dB lower. All three takes agree closely, so the measurements are solid.

Both libraries are updated: C (andrew-davie/SpeakJet) and Go (andrew-davie/SpeakJetGo, which Gopher2600 uses). Every change was fitted by measuring the recording and the library in exactly the same way.

What changed, and how close it now is:

- **Output filter.** Several effects sweep a single pure tone (B1 goes 1.4 → 3.8 kHz and back), and their level falls with frequency alone. Solving for one response common to ten of them gives the chip's output filter: flat to 1.5 kHz, −5.7 dB at 2.4 kHz, −15.8 dB at 3.6 kHz. The library now uses that response, matched to within 0.9 dB, instead of a guessed 2200 Hz filter.
- **Bend adds, it doesn't multiply.** Each step shifts every formant and tone by about 44 Hz. DTMF digit 1's two tones keep their exact 512 Hz spacing at every Bend setting. AW's third formant goes from 2480 to 2912 Hz at Bend 15, where the old semitone-per-step model would have put it near 4400.
- **Stress and Relax.** Stress doesn't raise the pitch. It lifts F2 and F3 by about 80 Hz. Relax has no measurable effect.
- **Pitch** is slightly flat on the chip: each period is one sample (at 8192 Hz) longer than asked for, so Pitch 250 plays at 242.6 Hz. The library now does the same.
- **Formants:**
  - Nine vowels measure within about 5% of the existing values: AX, UX, EH, EY, IH, OW, UH, LO and RR. Several of those had been set earlier from two independent measurements, so this capture confirms them.
  - Five are corrected: AW, UW, AY, OH and WW.
  - The OH/AW question is settled: 135 is "hot", as the manual says, and PhraseALator has the two swapped.
- **Levels.** Each allophone's loudness relative to AW now matches the chip's to within 0.1 dB.
  - Too loud before: the nasals by about 4 dB, the hiss sounds by 4–12 dB.
  - Too quiet before: B and P by 7–9 dB.
- **Lengths.** Each allophone's length is fitted to the clean take, 0.2 ms average error. Clipping had made the vowels measure 10–14 ms long.
- **Sound effects.** All of them except DTMF and M1 are re-traced from the clean take, with each one's level matched (within 0.2 dB on average). DTMF tones last about 153 ms on the chip, not the manual's 95.
  - Tones are pure sines; the dense harmonics in the first two takes were just clipping.
  - R0–R9 are three tones each.
  - A1, A2, A3 and M2 are voiced buzzes at the 87 Hz speech pitch with three moving formants. M2 ("WOW") is literally a vowel glide.

Measured against the hardware, from the original library to the new one:

|----------------------------------|-------------|------------------------|
|                                  | Original    | New                    |
|----------------------------------|-------------|------------------------|
| Allophone lengths, average error | 23 ms       | 0.2 ms                 |
| Allophone levels, average error  | 2.7 dB      | 0.0 dB                 |
| Fricative spectra                | 4–12 dB off | 2.4–3.9 dB off         |
| Vowel spectra                    | 5.0 dB RMS  | 4.0 dB RMS             |
| Speed curve and pauses           |             | on the hardware points |
|----------------------------------|-------------|------------------------|

Graphs comparing hardware, original and new for each of these are attached.

**Still to understand**

- **The extra sound.** All three takes play an extra sound between the Speed 80 and Speed 100 groups: an 85 ms burst, then tones of 746, 501 and 746 Hz, 180 ms each. No byte in the sequence accounts for it, the driver sends the bytes plainly, and it matches none of the 55 effects. The bytes there are `2 2 21 100 191 136 154 187`. A tiny test ROM that plays `21, 100` on its own is next.
- **Bend below the default** falls about 22 Hz short somewhere between Bend 1 and 5. The recorded Bend values (0, 1, 5, 10, 15) can't show where.
- **A1 and A2:** the chip has a steady low formant under two rising ones, and the trace only partly reproduces that.
- **M1** (pistol shot) comes out 1.8 dB quiet, because its noise oscillators are already at full volume.
- **The vowels' top end** (3.2–4 kHz) is still about 3 dB short. That probably comes from how the chip generates its voiced sound, which isn't modelled exactly.
- **IY and the nasals** can't be measured reliably this way, so their formants are unchanged.



Andrew Davie

#11
Here's a follow-up ROM designed to answer some of the still-unknowns and help refine the emulation.

Call for AtariVox owners: help pin down the last SpeakJet mysteries (one 4-minute recording)

Over the last few days the SpeakJet emulation (C library and the Go library Gopher2600 uses) has been rebuilt around recordings of a real AtariVox. Timing, levels, formants, the output filter, Bend, Stress and the sound effects now match the hardware closely. A handful of questions are left that only a real chip can answer, so I've made a small test ROM for them. If you have an AtariVox, a recording from your unit would be a big help, and a second unit also shows how much chips differ.

What you need

An Atari 2600 or 7800 and a way to run a ROM (Harmony, PlusCart or similar)
An AtariVox or AtariVox+ in the right controller port
A joystick in the left port (or use the console's RESET switch)
A way to record the AtariVox's audio output, ideally a cable into a line input
How to record

Connect the AtariVox's audio out straight to your recorder or computer's line input. A microphone in a quiet room will do if that's all you have.
Record WAV or AIFF at 44.1 or 48 kHz, 16-bit or better. Turn off any noise reduction, automatic gain, compression or normalising.
Set the level carefully. The loudest vowels should just reach full scale without clipping. If you can, do a quick test run first and check the peaks; an overdriven recording loses most of what we need.
Start recording, then run vox_probe.bin. The screen turns blue.
Wait a couple of seconds and press FIRE (or RESET). The screen turns red while the test plays.
When it turns green, keep recording for another 10 seconds, then stop.
The whole run takes about 3½ minutes. Please post or send the file as is, without trimming or editing, and say which unit it came from (AtariVox or AtariVox+, and roughly when it was bought).

What it's testing (you don't need to follow any of this, just record it)

An unexplained sound: every recording so far has a short burst and three tones right after a "Speed 100" command that no byte in the sequence accounts for. The ROM replays that moment in isolation, in several variations, to find what triggers it.
Bend at every setting: to place a small step between Bend 1 and Bend 5.
Effects vs controls: whether the sound effects follow Pitch, Speed and Volume.
Delay and Speed: whether Delay stretches with Speed, as the pauses do.
Pause lengths: measured three times each.
Long sustained IY, nasals and liquids: so their formants can finally be measured.
Modifiers: Stress and Relax on more sounds, plus Fast and Slow on a diphthong and a stop.
Finer Volume and Pitch sweeps.
Repeat 0, 1 and 2: whether "Repeat 0" plays a sound at all.
Each section starts with DTMF tones of its number, so the recording can be matched back to the exact bytes automatically. The ROM is built on Alex Herbert's 2004 AtariVox test ROM and driver. The driver is unchanged. The test ROM gets one fix: at boot it clears the controller port's output latch, which a Harmony or PlusCart menu can leave set, stopping the driver from talking to the AtariVox.


Thanks! Every recording so far has turned up something new.

SpiceWare

Quote from: Andrew Davie on 26 Oct 2026, 02:20 PM0.25% of samples clip, and the noise floor is 18 dB lower

I've set the volume knob to tick 4 for this recording, hopefully that gets rid of the last of the clipping.

For some reason we're back to just 1 speaker for this recording.

Andrew Davie

Quote from: SpiceWare on 27 Oct 2026, 01:21 AMI've set the volume knob to tick 4 for this recording, hopefully that gets rid of the last of the clipping.

TY!
Here's a first pass at the analysis...

This recording answers the mechanism question well. Several of its findings are simple rules that could replace the per-sound fitting you were worried about. I haven't changed anything in the libraries.

The recording is on the right channel only (the left is empty), and only 209 samples clip, so it's clean. All 11 sections were found from their DTMF markers.

## The biggest result: how the chip makes voiced sound
At low pitch you can see each pulse on its own (section 9 at Pitch 40 and 50, section 6 at Pitch 60).

- **Each pitch pulse restarts the three formant sines together, multiplied by a linear ramp down to zero.**
  - The ramp lasts a fixed time, about 7.4 ms for AW, whatever the Pitch.
  - After it, the rest of the period is silent. From about Pitch 135 up, the next pulse cuts it short.
  - This model fits the chip's actual waveform with R² 0.96. An exponential decay fits worse (0.91).
- **All formants of a sound end together,** so it's one envelope shared by all three sines. The length varies a little by sound: about 5–6 ms for IY, UW and MM, and about 7–8 ms for AW and WW.
- **The library already has this structure.** It restarts the sines each period and multiplies by a sawtooth, and the restart was listed as a guess in the design doc. The one difference is that the library stretches the sawtooth over the whole period, while the chip's has a fixed slope.

That one engine change affects every voiced sound at every pitch. It's plausibly what several per-sound fits were compensating for.

## Rules the library gets wrong, each a simplification
| | Chip | Library |
|---|---|---|
| Effects and Speed | Stretch by the same (146 − Speed)/32 law as speech (A1 2.70× at Speed 60, prediction 2.69×) | Effects deliberately exempt |
| Effects and Pitch | A1 and M2 follow the Pitch control exactly (60.3 / 87.9 / 149.5 Hz); R5 is a fixed 369 Hz; B1 is unvoiced | Fixed traced pitch |
| Repeat | Each extra copy adds exactly the manual's duration (AW +70 ms; Repeat 6 = single + 5 × 70, within 6 ms for IY, UW and MM) | Plays the whole stretched sound again |
| Pitch | The frequency departs from the setting irregularly (+0.5% to −1.7%) | p/(1+p/8192), up to 1.5% off |
| Fast / Slow | about 0.65× / 1.3–1.4× | 0.6× / 1.5× |
| Pause 0 | Still leaves about 20 ms between sounds | The sounds merge |

The Repeat result matters most for the length question. It suggests a sound lasts its manual duration plus a fixed transition overhead, rather than manual × a per-sound multiplier. If that holds, the whole allophone_length table, with its "connected speech" class multipliers, could collapse to one overhead. Take 3's single-sound lengths lean the same way, though noisily: "manual + 48 ms" beats a multiplier, 42 ms RMS error against 60.

## Confirmed as the library has it
- **Bend:** adds 44 Hz per step and is purely additive (the two DTMF tones stay exactly 512.2 Hz apart at every Bend). The 22 Hz short step is between Bend 4 and 5, now measured rather than assumed.
- **What Bend moves:** C8's noise moves with Bend; SE's hiss doesn't.
- **Stress:** +85 Hz on F2 and F3 (that's about two Bend steps). Relax changes nothing at all.
- **Volume:** linear amplitude, within 0.5 dB at every step from 8 to 127.
- **Delay and Pause:** Delay ignores Speed and Pause scales with it. Pauses 1–6 are within about 10 ms. Delays run 15–28 ms longer on the chip.

## The "extra sound" is the chip, not the ROM
- **The driver is sound.** It checks the chip's buffer-full line before every byte, and the exact VoxRecord context played alone is clean.
- **It recurs at the same point in the long speed sweep:** just after the Speed 80 group, as in VoxRecord.
- **What happens:**
  - TT plays, then the rest of that group's bytes are lost.
  - About 0.8 s of silence follows, then a chime: DTMF 0, 1, 0 at Bend 0 (that's the 746/501/746 Hz you saw before).
  - Later groups play at 136 Hz and about 5.5 dB louder.

It looks like an internal reset or power-on behaviour, so it isn't something to emulate.

## Not settled
- **Why the chip's tones run about 5 Hz above nominal.** The Bend steps alternate between about 43 and 45 Hz at the top, which suggests integer frequency arithmetic. Neither a divider nor an accumulator step fits the 32 tones.
- **Why the envelope length varies by sound.** It doesn't track loudness, so it may be a setting stored for each sound.

## A correction to earlier work
A 1 kHz interference line reads 999.996 Hz, so this recorder's clock is accurate. Yet the chip's DTMF comes out 0.45–0.8% off nominal. Take 3's "recorder 0.48% slow" correction may have assumed exact DTMF, so that assumption needs rechecking before anything is refitted.


Andrew Davie

**SpeakJet emulation update: what the VoxProbe recording taught us**

One clean recording answered most of the engine questions it was built for, and both libraries are updated.

The theme this time is a change of approach. The previous rounds fitted individual sounds to recordings, which raised the scores but piled up special cases. VoxProbe let us measure how the chip actually *works*, and several of those special cases turned into simple rules.

**What the chip turned out to do**

- **Voicing.** At low pitch (40–70) each voice pulse stands alone, and you can see it directly. Every pulse restarts the formant oscillators, which then fade in a straight line to silence in a fixed time, about 8 ms, whatever the pitch. At low pitch the rest of the period is silent; above about 125 Hz the next pulse cuts the fade short. The library previously stretched a sawtooth over the whole period.
- **Effects follow the controls.** Speed stretches the sound effects exactly as it stretches speech: A1 is 2.70× as long at Speed 60, and the speech curve predicts 2.69×. Voiced effects (A1, M2) follow the Pitch setting. The library used to treat effects as fixed.
- **Repeat** adds just the manual's duration for each extra copy. AW repeated twice is only 70 ms longer, and six IYs are one IY plus 5 × 70 ms, to within 6 ms.
- **Sound lengths.** That Repeat result says a sound lasts its manual duration plus a fixed overhead, not the manual × some factor. One constant (+28 ms) now replaces 37 per-sound multipliers for the vowels, nasals, liquids and diphthongs, with almost no loss of accuracy.
- **Smaller timing fixes.** Fast is 0.65× and Slow 1.35×. Pause 0 still leaves a short gap on the chip. Delay runs about 12 ms longer than its 10 ms steps, and doesn't change with Speed.
- **Confirmed as already modelled:** Bend adds 44 Hz per step (only 22 Hz between Bend 4 and 5). It moves the tones and C8's noise but not SE's hiss. Stress raises F2/F3 by about 85 Hz, and Relax does nothing. Volume is linear.

**The mystery "extra sound" from VoxRecord**

It's the chip itself. Partway through a long speed sweep, at the same point in every recording, it drops the rest of a group and goes silent for about 0.8 s. Then it plays DTMF 0-1-0 at Bend 0, and carries on at a higher pitch and about 5 dB louder. The same bytes in a short stream play cleanly, and the driver's flow control checks out. It looks like an internal reset, so we're not emulating it.

**Also in this release:** the previous round's per-sound work.
- The stops' burst and aspiration hiss is now narrow-band, as on the chip.
- SE, SO and SH start with the chip's short low "thump".
- Seven C-series effects are switched on and off at a voicing rate.
- R0–R9 are now steady tones.

**Results** (against the clean VoxRecord take, compared with the previous release; the % is spectrogram match):
- Allophones: 63% → 73%. Sounds under 30%: 10 → 1 (TS).
- Effects: 64% → 70%. Under 30%: 4 → 1 (C8).
- Average spectrum error: 4.9 → 4.3 dB.
- Sustained sounds on the probe recording, which wasn't used for fitting: 5.2 → 4.5 dB.

**Still open**

- **Pitch.** The chip's frequency for a given Pitch setting is irregular, up to 2.7% off our formula at high pitch, and 12 sample points can't pin down its table. It's now the biggest remaining error for high-pitched speech.
- **The robots (R4, R6–R9).** These have broadband energy beneath their tones that we don't reproduce yet, so they're correct moment to moment but sound too clean.
- **Tone offsets.** The chip's DTMF tones sit about 5 Hz above nominal at every Bend, which hints at integer frequency maths we haven't cracked.
- **Recorder clock.** The recorders turn out to run about 0.7% slow when measured against the 2600's own line rate (15699.8 Hz). That's within the margin of most results, but it matters for the pitch work.

**Next probe:** a dense Pitch sweep, every value, so we can recover the chip's pitch table directly. If you can run another VoxProbe build when it's ready, that would be fantastic.