Take 2, then Take 3 -- new emulation - request for recordings

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Andrew Davie

Quote from: SpiceWare on 31 Oct 2026, 02:11 AMProbe 7 results from original AtariVox

Same as above, 3.5 ticks, 3x "ready", and 4:45

Many thanks. Processing now - results announced ASAP.

Andrew Davie

While we wait for the results of probe 7...


**SpeakJet emulation: the rebuild is about a third the size of the fitted version**

There are two implementations of the SpeakJet emulator. The fitted one, on the main branch, is the version Gopher2600 uses now. The rebuild, on the `rebuild` branch, was written from scratch from the SpeakJet manual and recordings of two real AtariVoxes. Built the same way in C, here's what each takes:

                              fitted (main)    rebuild
code                             34,728 bytes   12,724 bytes
constant tables                  39,532 bytes    5,084 bytes
floating-point constants          3,808 bytes       64 bytes
total                           ~78,000 bytes  ~18,000 bytes

The sound data itself, every allophone and effect, is 4,562 bytes in the rebuild. That's 72 allophones of 16 bytes and 150 effect parts of 22 bytes, plus a small index.

**Why it's smaller.** The fitted version describes each sound with a large set of fitted values. The rebuild describes how the chip works, with general rules, and keeps only a few measured bytes per sound. The rules come from the recordings and the manual:

- **The chip.** The SpeakJet is a Microchip PIC18F1320 running its own firmware, clocked by its 8 MHz internal oscillator. That's 250 instruction cycles per output sample at a nominal 8000 Hz. Each unit's sample rate is off by its own oscillator error, and every pitch, length and tone moves with it.
- **The synthesiser.** As the manual describes, five oscillators are shaped by a sixth that acts only as an envelope, in one of four waveforms: saw, sine, triangle or square. The voice is the saw. The sound effects are mostly the same machinery at their own pulse rates. Each effect's rate is the Pitch setting plus a fixed offset in hertz, the same at every Pitch on both units.
- **Each sound** is then a handful of measured numbers: its formants and their levels, its length, a noise band, its level against the vowels, and any pulse-rate offsets.

That fits the hardware. The real chip holds all its firmware and sound data in 8 KB of program memory, so a small table of numbers driving shared rules is much closer to how the SpeakJet itself works than a big fitted table.

**How close it is.** Both versions are scored against recordings of two real AtariVoxes, on a scale where 0 means as close as a second chip. Lower is better:

                      fitted  rebuild
connected speech        1.16    1.11
all 741 recordings      1.06    1.11

The rebuild already matches real chips better on connected speech, which is what games actually use. It's slightly behind overall, mostly on sound effects played on their own. A new probe ROM, VoxProbe 7, has just been recorded, and it drives the synthesiser's registers directly. That should close most of the remaining gap.

---

On VoxProbe 7: the register-control commands worked through the AtariVox on both units, so we have direct measurements of the synthesiser's oscillators, envelope waveforms and noise.
[/code]

Andrew Davie

**VoxProbe 7 results: what the SpeakJet does with envelopes, repeats and Pitch**

Many thanks for the two VoxProbe 7 recordings, one from an AtariVox+ and one from an original AtariVox. Both units agree on everything below, which means we're measuring the chip and not one particular unit.

**What the probe did**

The first half played sound effects at Pitches and Bends the earlier probes had never used, plus Pitch-change glides and stops repeated 2 to 5 times. The second half used the SpeakJet's Serial Control Protocol (yes, it works through the AtariVox) to drive the synthesizer's oscillators directly, one at a time: single tones, each of the four envelope waveforms, noise and the mixer.

**The envelope oscillator**

The manual says register 8 picks saw, sine, triangle or square. The recordings show how each really behaves:

- **Saw:** this is the voice pulse that every voiced sound uses. A sharp step, then a straight fall over about 7 ms to silence. Its period is a whole number of chip ticks, so asking for 400 Hz gives about 382 Hz. It also restarts the oscillators' phase on every cycle.
- **Sine:** full depth, and it runs at exactly the frequency asked for.
- **Square:** on for about half of each cycle.
- **Triangle:** not a triangle at all. It's a rising ramp, then an instant drop back to nothing.
- **Phase:** sine, triangle and square do *not* restart the oscillators' phase. The tones run straight through.

The firmware's own sound effects that use these shapes (R4–R7) *do* restart their tones every cycle. Their spectra are clean harmonics of the envelope rate, not sidebands of the tone. So the effects run differently from the same waveforms set by hand through the control protocol.

**Effects at other Pitches**

Where it can be measured cleanly, an effect's pulse rate is the Pitch plus a fixed offset. R5, for example, tracks Pitch + ~290 Hz from Pitch 40 to 200 on both units. That confirms the model the emulator already used.

**Repeat on stops: the big one**

Repeating a stop (BE, GE, ED, EG, OG, EB, ...) doesn't run the copies together. Every copy is the whole stop again: a closure, then the burst. Each sound has its own copy length:

```
ms per copy   BE 75  BO 70  DE 60  DO 55  GE 65  GO 65
              EB 45  OB 60  ED 45  OD 45  EG 55  OG 55
```

G and the final stops (EB, ED, EG, OB, OD, OG) go silent between copies. BE, BO, DE and DO keep humming their voice bar through the gap. The emulator now does all of this. On every stop-repeat recording we have, it's much closer to the real chip than before, and single sounds are untouched.

**Side effects of a cleaner recording method**

- **Mains hum:** both recordings carry 60 Hz mains hum, with harmonics up to about 3 kHz. It's now tracked out before analysis. A faint steady 3 kHz tone from the recording setup is also present. Neither comes from the AtariVox.
- **Finding items by silence:** each item is now found by the silences between items, rather than by predicted timing. The item counts come out exact on both units.
- **VoxProbe 4 re-checked:** applying the same method to VoxProbe 4 showed that about a third of its item windows had been misplaced, some by a quarter of a second. That's now fixed, and the whole scoring has been recalibrated on the corrected data.

**Where the emulator stands**

Probe 7's recordings were never used to fit anything, so they're a fair test of how well the emulator holds up at Pitches and Bends it was never tuned on. On them, the measurement-based rebuild is now level with the older fitted version. On allophones overall it's ahead.

**Still to come**

- the single-tone, volume and noise/mixer sections of probe 7;
- why the two units' saw envelopes differ slightly at 400 Hz;
- refitting the effects across all four Pitches, now that probe 7 is part of the reference data.

Thanks again to everyone (@SpiceWare) recording these. Every probe has turned up something the manual doesn't say.


Andrew Davie

**AtariVox / SpeakJet emulation: where it stands**

Here's an update on the rewritten SpeakJet emulation: the C library, and the Go version used by Gopher2600. The aim hasn't changed: sound as close to a real AtariVox as one real AtariVox is to another. Everything is measured from recordings of two real units, an original AtariVox and an AtariVox+.

**How close it is**

Every recorded item, over 1200 of them, is scored against both real chips. On this scale, 0 means "as close as a second real chip", and lower is better.

                       previous    now
all                      1.15       1.08
single sounds            1.04       0.84
connected speech         1.14       1.09
newest recordings        1.36       1.15
sound effects            1.22       1.22
long phrases             1.47       1.87

The newest recordings (VoxProbe 7) were never used for tuning, so they're the fairest test. That's also where the gain is largest. Single sounds and short connected groups are clearly better than before.

**The weak spot: long phrases**

"Long phrases" means the Man Goes Down speech, which is real game speech full of Slow, Speed and Pitch commands. It's the one place that has gone backwards, and nearly all of that is timing: phrases come out 40–160 ms too short or too long. Pitch, harmonics and formant positions in those phrases are all better than before. What we know so far:

- A single sound under Slow matches the chip to within about 5%.
- Inside a phrase, a slowed sound that runs straight into the next one plays 40–60 ms longer on the chip than in the emulation.
- Sound effects played at a non-default Speed stretch along a curve on the chip, not the straight line the emulation uses, and pulsed effects stretch less than tonal ones.

The current recordings don't have enough data points to pin down either rule, so VoxProbe 8 measures both directly (below).

**What changed recently**

- The voice is exactly periodic, as on the real chip.
- Repeated stops (BE BE BE...) replay the whole stop, closure and all, at the chip's measured spacing.
- DTMF tones and many effects match the chip's level, timing and pulse rates.
- The output filter was re-measured from tones the chip plays directly.
- The sound tables are packed so each effect stores only what it uses. They're half the size, and not one sample of output changed.
- Fixes to the fitting process turned up several sounds that had been tuned on the wrong recordings. AW and IY were re-fitted as a result.

**Still open**

- **The nasal NGE** (code 143): the real chip has 4–7 dB more energy between 0.9 and 2 kHz than the emulation. It's a broad shelf that the current nasal model can't produce, so it needs a change to how nasal pulses are built.
- **The noise bed around effects' tones:** the "fuzz" between and around the lines is still too low on a few effects (B0, B1, B8, the DTMF digits D9/D10).
- **Phrase timing,** as above.

**Size**

                           first Go    previous    now
Go package (compiled)       78 KB       128 KB     18.5 KB
C library (compiled)          -          91 KB     18 KB
sound tables                 7 KB*       18 KB*    2.6 KB

\*plus data their startup code builds

C and Go produce the same samples (to within 3 parts in 100,000).


Andrew Davie

**VoxProbe 8 is ready**

The next test ROM (4 KB, about 3½ minutes) targets exactly the open questions:
- Slow inside phrases ("AY AW" against "Slow AY AW", and so on).
- Two effects at seven Speeds, from 20 to 127.
- Single nasal pulses, NGE included, at a low Pitch.
- Fast and Slow by sound class.
- The pauses after each kind of sound.
- A short sweep of the output stage, and the noise bed against tone level.

If you have an AtariVox or AtariVox+ and can record its output, the same recording level as VoxProbe 7 is fine. That one had about 3 dB of headroom and nothing in the speech clipped. Less mains hum would help the quiet parts, if you can manage it.


SpiceWare

Probe 8 results from AtariVox+ Vectrex Enhanced

Volume left at tick 3.5

I read that one way to reduce the mains hum was to record while on battery, so these were done on my unplugged linux laptop instead of my Mac studio.  Still uses the same USB audio capture device.

SpiceWare

Probe 8 results from original AtariVox

One tradeoff is I cannot hear the AtariVox while the laptop is recording it as the record software doesn't have a "monitor" feature.

SpiceWare

Just noticed the laptop recorded at 44.1 kHz instead of 48. I don't see any options to set the rate, will do some research.

Andrew Davie

Quote from: SpiceWare on 01 Nov 2026, 01:43 AMJust noticed the laptop recorded at 44.1 kHz instead of 48. I don't see any options to set the rate, will do some research.

TY. From Claude:
"These recordings are about 10 dB hotter than VoxProbe 7 and clip heavily, with about 130,000 and 149,000 clipped samples on units A and B, while the background and hum look as before."

The code can resample to 48KHz, but it's not ideal. I'll have it work on the files to see how we go, but given the hum and noise is the same it would be better I think to use the original recording system/method.  I do appreciate anything, though, so TY for these.


Andrew Davie

Claude: "The recordings are fine for timing but clipped about 10 dB hot, so level and spectrum readings can't be trusted, except the nasal pulse in section 6. The cutting also failed in places (section 11's marker missing, section 10 split into 23 pieces), so I'm fixing that first."



Quote from: Andrew Davie on 01 Nov 2026, 01:52 AM
Quote from: SpiceWare on 01 Nov 2026, 01:43 AMJust noticed the laptop recorded at 44.1 kHz instead of 48. I don't see any options to set the rate, will do some research.

TY. From Claude:
"These recordings are about 10 dB hotter than VoxProbe 7 and clip heavily, with about 130,000 and 149,000 clipped samples on units A and B, while the background and hum look as before."

The code can resample to 48KHz, but it's not ideal. I'll have it work on the files to see how we go, but given the hum and noise is the same it would be better I think to use the original recording system/method.  I do appreciate anything, though, so TY for these.

SpiceWare

Just installed Audacity on the laptop and figured out how to get it to record at 48 kHz. Audacity also has a recording level display, which the other software doesn't, and I see it pegging at 100% a lot so it'll have the same clipping problem.

Getting ready to re-record the probe8 on my Mac studio.

SpiceWare

Probe 8 results from AtariVox+ Vectrex Enhanced

Volume left at tick 3.5

I also tried putting a noise suppressor core on the audio cable between the AtariVox and the capture device.

SpiceWare

Probe 8 results from original AtariVox

Andrew Davie

Quote from: SpiceWare on 01 Nov 2026, 02:15 AMProbe 8 results from original AtariVox

Many thanks. I'll report back when results are in.

Andrew Davie

Quote from: SpiceWare on 01 Nov 2026, 02:15 AMProbe 8 results from original AtariVox

Looks very usable TY
The hum is slightly lower (120 Hz down 0.4–1.7 dB; 180 Hz much lower on unit A).
The broadband noise is unchanged to slightly higher (+1.3 to +1.5 dB below 8 kHz).
The signal is about 1 dB hotter without clipping.