89 lines
3.4 KiB
Markdown
89 lines
3.4 KiB
Markdown
# babbler
|
|
|
|
**Babbler** is an experimental articulatory speech synthesizer written in C. Unlike traditional Text-to-Speech systems that use pre-recorded samples, Babbler simulates the physics of a vocal tract. It models the mechanics of the human mouth to produce phonemes procedurally.
|
|
|
|
The engine calculates muscle movements, air pressure, and inertia to "speak" dynamically. It includes an ASCII visualizer to show the mouth state in real time.
|
|
|
|
## Core Concepts
|
|
|
|
The simulation relies on a 6-dimensional vector (`f6_t`) that represents the state of the vocal tract.
|
|
|
|
### The 6 Dimensions of the Voice
|
|
1. **tx (Tongue Place):** Position of the tongue from lips (0.0) to glottis (1.0).
|
|
2. **ty (Tongue Height):** How close the tongue is to the roof of the mouth.
|
|
3. **la (Lip Aperture):** How open or closed the lips are.
|
|
4. **lr (Lip Rounding):** Whether the lips are spread or protruding.
|
|
5. **gt (Glottal Tension):** Controls voicing, breathing, or stopping airflow.
|
|
6. **nz (Velum/Nasality):** Controls airflow through the nose.
|
|
|
|
### Physics Engine
|
|
The system does not just jump between states. It simulates physical constraints:
|
|
* **Inertia:** Muscles take time to move. The tongue follows targets with weighted inertia.
|
|
* **Aerodynamics:** If the lips close while air is pushed, intra-oral pressure builds up (`pressure`). When released, it creates a "burst" (plosive sounds like P, B, T, K) .
|
|
* **Jitter:** Biological noise is added to targets to simulate natural imperfection.
|
|
|
|
## Features
|
|
|
|
* **Real-time ASCII Visualizer:** A terminal-based view of the vocal tract showing lips, tongue position, and velum state.
|
|
* **Fantasy Language Generation:** Includes generators for distinct linguistic styles:
|
|
* **Common:** Standard phonemes.
|
|
* **Orcish:** Guttural sounds using uvular and pharyngeal articulators.
|
|
* **Elvish:** Soft sounds with liquids and front vowels.
|
|
* **Slavic:** Palatalized consonants and specific vowel systems.
|
|
* **IPA Transcription:** The system attempts to "hear" itself and transcribe the raw motor output back into IPA or specific orthographies (Polish, German, etc.).
|
|
|
|
## Build and Run
|
|
|
|
The project has no external dependencies beyond the standard C library.
|
|
|
|
### Compilation
|
|
Use the provided Makefile to build the synthesizer and tools:
|
|
|
|
```bash
|
|
make
|
|
```
|
|
|
|
### Running the Examples
|
|
|
|
The project includes several demo modes:
|
|
|
|
* **`./synth`**: Runs the main simulation. It generates random names in different fantasy languages and visualizes pronunciation.
|
|
|
|
|
|
* **`./example_3`**: Demonstrates "Motor Babbling". This simulates an infant learning to control mouth muscles by exploring attractor states (vowels vs consonants).
|
|
|
|
|
|
|
|
## Project Structure
|
|
|
|
* `src/articulator.c`: The core physics engine handling inertia and aerodynamics.
|
|
|
|
* `src/articulator_db.c`: Database of phoneme targets (definitions of where the tongue goes for 'a', 'k', 's', etc.).
|
|
|
|
* `src/visualizer.c`: Code for drawing the ASCII face.
|
|
|
|
* `src/transcriber.c`: Logic for converting raw motor output into text.
|
|
|
|
* `tools/mapgen.c`: A utility that automatically generates orthography headers based on anchor points.
|
|
|
|
|
|
## Example Output
|
|
|
|
When running, the visualizer displays the current state of the mouth:
|
|
|
|
```text
|
|
[MMM] Roof:[ ^ ] G:[~] P:[#####]
|
|
```
|
|
|
|
* **Lips:** `[MMM]` (Closed) vs `[---]` (Open).
|
|
|
|
* **Roof:** Shows the tongue's position relative to the palate.
|
|
|
|
* **G:** Glottis state (`~` for vibrating/voiced).
|
|
|
|
* **P:** Internal air pressure gauge.
|
|
|
|
## License
|
|
|
|
MIT
|