GitHub - SpeakJet C-Library and Go-Library releases

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

**AtariVox / SpeakJet emulation 0.5.3**

0.5.3 is out. The C library is at **andrew-davie/SpeakJet** (tag v0.5.3), and the Go library is a pull request to JetSetIlly (#21) for Gopher2600. The two produce the same sound, sample for sample.

**What changed since 0.5.2**

Two things the chip does that the emulation didn't:
- **Nasals carry a little noise.** On both AtariVoxes, MM, NE and the other nasals change slightly from one voice pulse to the next above 700 Hz. A purely periodic tone can't do that, so the four nasals that lacked it now have a small noise band. 140 MM 1.21 → 1.01, 144 NGO 1.09 → 1.02, 145 LE 1.16 → 1.09.
- **A voiced stop's hum is part noise.** The "bar" you hear before BE, BO, DE and DO is regular below 700 Hz and noisy above it. BE and BO's upper part is now noise instead of faint formants; DE, DO, ED and OD get noise alongside theirs. GE and GO are unchanged, because their bar really is regular on the chip. BE 1.21 → 1.14, BO 1.24 → 1.20, DE 1.29 → 1.24, DO 1.14 → 1.09.

Also:
- **238 C8:** its sweeping hiss now moves in straight lines, as on the chip, and repeats every 20 ms instead of 21 (1.75 → 1.63).
- **161 AXUW:** its third formant holds steady until the end instead of sliding (1.21 → 1.18).
- **156 NGO and 194 KE** start quieter, as the chip does (KE 0.84 → 0.76).
- **198 PE and 199 PO** now share one timing, a short closure with the low thump 25 ms in (PE 1.11 → 1.05).

**How close it is now**

Every sound is scored against four recordings of the real chip, two from each of two AtariVoxes. A lower score is closer.

                        0.4.3   0.5.3
allophones (72)         1.07    0.92
sound effects (55)      1.22    0.97
joins and phrases (88)  1437     513   (mean cost)

**A correction.** I said earlier that a score of 1.0 means "as far from the chip as another recording of the chip". That isn't quite right. Scoring each real recording the same way as the emulation, the original AtariVox's recordings come out near 1.0, but my AtariVox+'s come out at 1.2-2.4. Its oldest recording has a noisier background and stands out from the rest. So 1.0 means "about as close as the original AtariVox's recordings are to each other". The docs now say so.

By that measure most sounds are now about as close to the chip as one real recording is to another. The clearest exception is 238 C8.

**VoxProbe 15** is in its own thread. It records every sound again, so that noisy recording can be replaced, and it tests three things the emulation still gets wrong:
- when a Pitch change really takes effect partway through a phrase;
- how a vowel starts after a short pause;
- how loud TT and TH are next to a vowel.

Recordings from either kind of AtariVox are very welcome.

JetSetIlly

https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

Andrew Davie

#17
**AtariVox / SpeakJet emulation 0.5.5 released**

Version 0.5.5 of the C library (andrew-davie/SpeakJet, tag v0.5.5) and the matching Go library (pull request #23 to JetSetIlly) are ready. This release is about connected speech: how sounds join. Solo sounds are unchanged apart from two effects. The C and Go libraries stay sample-identical, so Stella and Gopher2600 play the same thing.

**What's new**

- **Joins rebuilt from measurements.** Thirteen join rules fitted to Man Goes Down's phrases are gone. They were compensating for each other rather than modelling the chip. In their place are six mechanisms measured on both AtariVoxes with VoxProbe 16:
  - A nasal hands over to the next vowel early (MM ~22 ms, NE ~13 ms), and a vowel hands over to a nasal ~15 ms early.
  - LE and LO join like nasals; WW and RR follow the vowel rule.
  - Speech below Speed 114 follows its own length law (Speed 90: x1.65, previously x1.84).
  - A stop after a pause closes 15 ms longer, not 30.
  - NGE's and MM's second formants are their 2249 and 1430 Hz lines, the ones that glide into the next vowel.
- **The effects' tone switch.** When an oscillator jumps to a new frequency, the chip plays the midpoint of the old and new for ~1.5 ms first. This gives 226 B6 the hump the chip has at 2.2-3.1 kHz.
- **Three spurious tones removed** from 226 B6, 232 C2 and 214 A4. They were images of real tones at the chip's 8026 Hz rate.

**How it measures**

                                              0.5.4      0.5.5
joins, VoxProbe 16's 76 join items            4.57 dB    4.07 dB   (real unit vs real unit: 2.77)
joins, VoxProbe 13's 87 pairs, length error   18.1 ms    13.5 ms   (not fitted on: independent check)
Man Goes Down phrase 1 (units 1490 ms)        1480       1475
Man Goes Down phrase 2 (units 1690 / 1685)    1725       1725
Man Goes Down phrase 4 (units 930 / 935)      945        930
226 B6 (real take = 1.0)                      1.06       1.02
225 B5                                        0.88       0.86

Joins are 11 % closer to a real unit, and 25 % closer on the independent set. Man Goes Down's phrases 1 and 4 are within 15 ms of both chips, and the engine has no per-phrase patches left.

**Known issues**

- Man Goes Down phrase 2 runs 37 ms long. Slowed vowels at Speed 108-118 come out ~30 ms longer than on the chip, and BE after a pause isn't right yet.
- PO after a nasal; AY IY and AW IH AW about 30 ms long; IY SE ending 15 ms early.

Technical manual 1.24 is included. Thanks to everyone who recorded VoxProbe 16.

Andrew Davie

**SpeakJet 0.5.6: a fairer score, two engine fixes, and every sound refitted**

0.5.6 is out for the C library (andrew-davie/SpeakJet) and as a pull request for the Go one that Gopher2600 uses.

**The score was unfair to us**

X compares our render with four recordings of each sound, two from each AtariVox, and 1.0 means "as close as one real recording is to the others". Two of its views were comparing unlike things: the recordings carry room noise and our render doesn't, and in those two views the noise was taken off the recordings but never added to ours. Fixing that lowers every score, so all the figures below are rescored on the new measure, 0.4.3 included, and don't compare with earlier posts.

It also cleared two faults I'd been chasing: TU's "highs fading early" and the D-series' "missing low end" were the recordings' background, not the chip.

**What changed in the engine**

- A vowel or glide starting from silence now ramps in from -26 dB, not from nothing. On both units the first voice pulses sit on that line, at Pitch 88 and at Pitch 150; ours started too quiet and read ~11 ms late. (A version that rose pulse by pulse fitted Pitch 88 and doubled the error at Pitch 150, so it went.)
- TS's tail now fades the hiss band evenly in dB and leaves its quiet floor alone. The old fade dragged the floor down with it and held the level flat for 80 ms before dropping it.
- The AtariVox's 40 Hz low cut now applies to speech as well as the effects, and DE DO ED OD's voice bar is a little darker at the top, both measured on both units.

**Every sound refitted**

All 127 sounds were refitted on the new score, each pinned in time to the chip, so a fit can't slide a sound to buy a better number. A refit was kept only if nothing else got worse (its shape, its timing at the edges, dropouts, level over time), and I checked every one against both units' spectrograms.

                      n   mean X         change   median X       over 1.0
                          0.4.3  0.5.6            0.4.3  0.5.6
allophones           72    1.20   0.95    -21 %    1.13   0.87   46 -> 25
sound effects        55    1.75   1.22    -30 %    1.75   1.22   52 -> 42
all sounds          127    1.44   1.07    -26 %    1.29   1.02   98 -> 67

connected speech (44 phrase items on both units, lower is closer)
one AtariVox against the other     143.9
0.5.4                              264
0.5.6                              235.7

118 of 127 sounds are closer than 0.4.3, and the 7 that aren't are within 4 %. The biggest gains are 213 A3 -70 %, 156 OWIY -54 %, 215 A5 -51 %, 179 GO -50 %, 239 C9 -49 % and 220 B0 -48 %. The furthest sounds now are 238 C8, 175 DO, 198 PE, 207 R7, 206 R6 and 239 C9.

Every sound's score is in docs/scores.md; the technical manual is at 1.27, and the changelog has the measurements behind each change.