OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
speech_synth — the SNES says "OPEN SNES… DAVEO"

Port of krom (Peter Lemon)'s SpeechSynth (PeterLemon/SNES, SPC700/SpeechSynth). Speech on the SNES = sequencing a phoneme bank on one DSP voice: per phoneme, the APU-side program selects the sample (SRCN), shapes it (ADSR: plosives one-shot, vowels/nasals looped and sustained), inflects pitch for prosody, and waits (4 ms timer grain). krom's 32-phoneme bank spells "PETER LEMON"; our original 10-phoneme bank (formant synthesis, gen_phonemes.py) says "OPEN SNES", then, after a pause, the name of the examples' city, "DAVEO" (said the French way, da-ve-o: three even syllables, the pitch falling on the last), on loop.

Phonemes What they are
AU, EA, AA, EE, OO vowels: a glottal pulse train through three formant filters, looped (the open o of "open", its e, the a, the closed e and the closed o of "Daveo")
NN the nasal: the same, with one low formant
PP, DD plosives, one-shot: a burst; the voiced D starts with a short voice bar
SS the fricative, one-shot: high-frequency noise
VV the voiced fricative, looped: a low voice with that noise over it

A phrase entry is SRCN, ADSR1, ADSR2, pitch and a duration in 4 ms ticks; SRCN $FE is a pause (a wait without a new KON, so the last phoneme decays through the gap) and $FF ends the phrase.

ROM mode: LoROM (project default).

Register fidelity vs the original

Element krom this port
Master MVOL 127/127, echo fully off (FLG $20) same
Voice 0 VOL 127/127, GAIN 127 same
Vowel ADSR %11110111/%11111100 same values
Plosive ADSR %11111111/%11100000 same values
Pacing 32 ms consonants / 256 ms vowels same (4 ms tick × 8/64)
Retrigger bare KON per phoneme, no KOFF same
Phrase end plain wait, no KOFF (ADSR decays) same

The debugging archaeology (all owner-listening-test driven)

  1. Flat-binary layout collision: the sequencer outgrew $0200-$02FF; directory moved to $0800.
  2. Timer 2× too fast: T0DIV=255 gave ~16 ms effective ticks in practice; krom's 1 ms grain replicated at 4 ms — vowels finally last their 256 ms (vowel-segment count now matches the reference 9 vs 8).
  3. The "toc": an inter-phrase KOFF pulse we added truncated the last phoneme mid-waveform; krom lets the ADSR decay naturally. Removed.
  4. The perceptual verdict: with all fixes, the owner A/B'd our machinery against krom's demo in BOTH luna and Mesen2 — the "noises/defects" heard are present in the original too: that IS what robotic phoneme spelling sounds like. Port machinery verified by luna spc-dump end-to-end: uploads byte-intact, directories entry-equivalent, DSP registers equal, phoneme schedule correct.

Debug tooling that cracked it

luna spc-dump exports the full APU state (64 KB ARAM + all 128 DSP registers) as a playable .spc — diffing two dumps localized every one of the bugs above. See docs/tutorials/audio_samples.md.

Modules Used

console, apu