Skip to content

sbelectronics/tts-263

Repository files navigation

tts-263

A portable NRL (Naval Research Laboratory) text-to-phoneme system targeting the SSI-263 / Votrax SC-02 speech synthesizer chip, as used in the Sweet Micro Systems Mockingboard for the Apple II.

The project provides reference implementations of the same text-to-phoneme algorithm in multiple languages, sharing a single rule set (886 rules extracted from the 1982 Sweet Micro Systems Mockingboard Speech Development disk):

  • Go -- library + CLI, with optional simulated audio playback on Windows
  • C -- portable library, with DOS (8086 / Open Watcom) and Linux front-ends
  • 8080 assembly -- planned, for CP/M and Z80-family systems
  • 8086 assembly -- planned

The NRL algorithm is implemented in full: metacharacters # (vowel), . (voiced consonant), ^ (consonant), + (front vowel), : (zero or more consonants), and ! (word boundary) are all supported. Input is fed one byte at a time; phonemes are emitted via callback as raw SSI-263 bytes (bits 5-0 = phoneme code, bits 7-6 = duration modifier).

Quick start

Prebuilt binaries for DOS, Linux, and Windows are in release/1.0.0/; build from source with the Makefiles described below.

Go CLI (Linux / macOS / Windows)

ttsdemo "hello world"          # text -> phoneme names on stdout
ttsdemo -audio "hello world"   # also play through the speaker (Windows only)
ttsdemo                        # tty -> interactive REPL (type "quit" to exit)
echo hello | ttsdemo           # piped stdin -> one line per utterance
ttsdemo -version               # print version and exit

Running with no arguments from a terminal drops you into an interactive prompt. Phoneme output is space-separated SSI-263 names, e.g. HF AE1 EH LF O U W for hello.

DOS front-end (Artic Synphonix SSI-263 ISA card)

Note: This may work with the Votalker... I'm not sure.

See doc/dos/TTS.TXT for the full manual. Summary:

TTS hello world                      speak through the chip
TTS -text hello world                print phonemes, do not drive chip
TTS -interactive                     REPL mode
TTS -base=0x280 -irq=3 hello there   override I/O port and IRQ

A picture of my Synphonix is below.

Artic Synphonix

Linux C front-end (text only)

tts "hello world"       # phonemes to stdout
tts -interactive        # REPL

Using the Go library

go get github.com/smbaker/tts-263/go/tts
import "github.com/smbaker/tts-263/go/tts"

e := tts.New(func(b byte) {
    fmt.Printf("%s ", tts.PhonemeName(b))
})
for _, c := range []byte("hello world") {
    e.Feed(c)
}
e.Flush()
// Output: HF AE1 EH LF O U W PA U1 W ER ER L D HVC

Repository layout

Path Contents
go/ Go implementation. Library in go/tts/, CLI in go/cmd/ttsdemo/.
go/audio/ Optional Windows audio playback. Embeds AppleWin's SSI-263 sample data. Separate license -- see below.
c/ C implementation. Library in c/, DOS and Linux front-ends in c/cmd/, golden-file test harness in c/test/.
rule-extraction/ Python tools that parse the original Mockingboard disk image and emit the 886-rule table. Generated Go/C sources are checked in; regenerating requires running these scripts.
sample-extraction/ Python tool that parses AppleWin's SSI263Phonemes.h into the binary sample blob and Go lookup table consumed by go/audio/.
doc/ End-user documentation (e.g. DOS front-end manual).
install_watcom.sh Installer for Open Watcom v2 (needed to build the DOS target on Linux).

Requirements

  • Go build: Go 1.24 or newer.
  • C Linux build: any C99 compiler (gcc / clang).
  • C DOS build: Open Watcom v2 (Linux host, cross-compiles to DOS). Run install_watcom.sh to fetch and install it.
  • Regenerating rules or sample data: Python 3.8+.

The version string embedded in each binary is read from the top-level VERSION file at build time.

Building

Go

cd go
make linux    # native Linux build     -> bin/ttsdemo
make windows  # Windows cross-compile  -> bin/ttsdemo.exe
make          # both of the above
make test     # run unit tests

The -audio flag on ttsdemo plays phonemes through the speaker. It only works on Windows builds, since only those embed the AppleWin sample data (non-Windows builds use a no-op stub); on Windows, ttsdemo prints a hint about -audio when you enter interactive mode without it.

C

cd c
make         # Linux front-end         -> bin/tts
make dos     # DOS .COM (Open Watcom)  -> bin/tts.com
make test    # golden-file regression test

Licensing

This repository is dual-licensed to keep a permissive core separate from a GPL-derived optional component:

Scope License Why
Everything except go/audio/ Apache License 2.0 -- see LICENSE Project default. Applies to the NRL engine, rule tables, C library, DOS/Linux front-ends, and extraction scripts.
go/audio/ (sources + embedded phonemedata.bin) GNU GPL v2 or later -- see LICENSE-GPL-2.0 and go/audio/LICENSE The embedded phoneme samples are derived from AppleWin's SSI263Phonemes.h, which is GPL v2+. Any work incorporating those samples inherits that license.

Consumers who only want the phoneme engine can depend on github.com/smbaker/tts-263/go/tts and are unaffected by the GPL component. The go/audio/ package is only linked when a build explicitly imports it -- the default ttsdemo binary does, so prebuilt ttsdemo.exe artifacts are covered by the GPL.

Credits

  • NRL text-to-phoneme algorithm: Naval Research Laboratory (1976).
  • Phoneme rule set: extracted from the Sweet Micro Systems Mockingboard Speech Development System (1982).
  • SSI-263 sample data: AppleWin (https://github.com/AppleWin/AppleWin), source/SSI263Phonemes.h, GPL v2+.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, GPL-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
GPL-2.0
LICENSE-GPL-2.0

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors