From 46227e2003de28202cc4e82bca4f7f4745476c4e Mon Sep 17 00:00:00 2001 From: Alexander Kassouni Date: Sat, 5 Sep 2026 17:51:13 -0700 Subject: init --- docs/editor.html | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 docs/editor.html (limited to 'docs/editor.html') diff --git a/docs/editor.html b/docs/editor.html new file mode 100644 index 0000000..8e46242 --- /dev/null +++ b/docs/editor.html @@ -0,0 +1,116 @@ + + + + + +7. The editor path — Animalese + + + + + + +

7. The editor path

+

There is a third calling convention into Na_VoiceSe that skips +the phonology engine entirely, and it explains what a third of the voice samples are +for.

+ +

Mode 1

+ +

The text editor overlay — used for letters, town and player names, patterns, and +anywhere else the player types — speaks each keystroke from +src/game/m_editor_ovl.c:712:

+ +
if (command == mED_COMMAND_OUTPUT_CODE) {
+    int voice = mMsg_sound_voice_get_for_editor(editor_ovl->now_code);
+
+    if (voice == 0x85 || voice == 0x80 || voice == 0x81 ||
+        voice == 0x82 || voice == 0x83 || voice == -1)
+        voice = 0x86;
+
+    sAdo_VoiceSe(voice, 0xFF, 0xFF, 0, 32, 1);      // ← mode 1
+}
+else if (command == mED_COMMAND_EXCHANGE_CODE) {    // cursor moved onto a character
+    if (exchange_code != -1 && mED_exchange_se_list[exchange_code])
+        sAdo_VoiceSe(mMsg_sound_voice_get_for_editor(exchange_code), 0xFF, 0xFF, 0, 32, 1);
+    else
+        sAdo_SysTrgStart(0x36);
+}
+ +

After both filters, only three things survive: letters (0x5D–0x76), +digits (0x53–0x5C), and the click (0x86).

+ +

What mode 1 does inside Na_VoiceSe

+ +

Na_VoiceSe's two switch (f) blocks handle only cases 0 and 2. +With f == 1 both fall through, so:

+ + + +

The editor always runs at spec 5 or 6 (see gating), which +routes 0x86 to NA_SE_BEBE and passes everything else through. The +final guard is if (a != 0 && a <= 0x77), and letters and digits both +satisfy it. So:

+ +
typing 'a'  →  Sou_VoiceStart(subtrack, 0x5D)  →  instrument 0x5C
+typing 'z'  →  Sou_VoiceStart(subtrack, 0x76)  →  instrument 0x75
+typing '0'  →  Sou_VoiceStart(subtrack, 0x53)  →  instrument 0x52
+ +

What this tells us about the sample set

+ +

Trace the reachable phoneme codes across the whole engine:

+ + + + + + + +
Code rangeInstrumentsReached by
0x01–0x520–81the phonology engine — short/long vowels, consonants, all 52 two-character digraphs plus you
0x01–0x40also the anti-repetition random substitution (rand() >> 2)
0x53–0x7682–117only mode 1 — one entry per digit and letter, in order
0x77118the you digraph, and nothing else
+ +

The 0x53–0x76 block is exactly 36 codes: ten digits then +twenty-six letters, in the same order as the voice-code alphabet, and it is +unreachable through any dialogue. The obvious reading is that these 36 samples are the +spoken names of the digits and letters — what you hear when typing a name +one character at a time.

+ +
+Confidence. The code path is unambiguous; the interpretation of the samples +as letter names is inference. It is testable: extract instruments 82–117 from bank 156 +and listen. It also predicts that bank 157, which stops at 83 instruments, is a +phonology-only bank — and that is exactly what it is. +
+ +

Why bank 157 is short

+ +

Spec 3 (Wendell, Pete, Booker, Jack) uses sequence 244 / bank 157, which has 83 +instruments — codes 0x01–0x53. That covers the entire phonology +output range (≤ 0x52) with one to spare, and omits the letter-name block +that spec 3 can never reach, since the editor is always spec 5 or 6.

+ +

The one real casualty is you (0x77): the sequence's dynamic +table clamps out-of-range entries to the last routine, so a spec-3 voice saying "you" +plays instrument 82 instead. That is one wrong syllable on a common word, in four +NPCs' voices.

+ +
+This corrects an earlier reading of extraction.md §2.4, which described bank 157 +as "collapsing every digraph sample above 0x53 onto one sound". Nothing above +0x53 is a digraph — the block is not phonology at all. +
+ +
+ ← 6. The soundfont lookup + 8. Quirks & corrections → +
+ + + -- cgit v1.3.1