A static web app that translates English text into Eridian, the chord-based alien language spoken by Rocky in Andy Weir's Project Hail Mary. Type something in English, see the chord notation on a staff, and hear it played back as polyphonic chords through your speakers.
Live: https://mbarc.github.io/eridian-translator-talk-to-rocky/
The novel only specifies a handful of canonical chord mappings (love → F major, I love you → Csus4 → F major → C major, etc.). To handle arbitrary
English the translator uses three layers in priority order:
- Canonical — chords taken straight from the book.
- Curated — ~100 hand-authored chord assignments for Rocky's in-book
vocabulary (
yes,no,amaze,question,friend,engine, …), following the in-universe rules (basic concepts → fewer notes, emotional words → triads, questions → rising contour, etc.). - Procedural — anything else is hashed into a chord deterministically, so the same word always produces the same Eridian sound.
Each word card is colour-coded by source.
- Web Audio API. No audio assets, no bundler, no build step.
- One
OscillatorNodeper note in the chord, all played simultaneously, so you hear true polyphony (Rocky has five vocal bladders). - Triangle waveform with a soft attack/release envelope evokes an ocarina/flute timbre.
- Quarter-note vs eighth-note durations match the long/short distinction Andy Weir transcribes in the novel.
- Vanilla HTML/CSS/JavaScript (ES modules).
- VexFlow loaded from a CDN for the musical staff rendering.
- Deployed to GitHub Pages via
.github/workflows/pages.yml.
ES modules can't be loaded over file://, so serve the directory with any
static server:
python3 -m http.server 8000
# then open http://localhost:8000Or:
npx serve .index.html
styles.css
src/
main.js UI wiring
translator.js English → chord-sequence pipeline
dictionary.js canonical + curated mappings
procedural.js deterministic hash-based fallback
audio.js Web Audio chord playback
music.js note ↔ frequency helpers
notation.js VexFlow staff rendering
.github/workflows/pages.yml
Eridian, Rocky, and Project Hail Mary are © Andy Weir. This is a fan project, not affiliated with the author or the film. Source on GitHub: https://github.com/mbarc/eridian-translator-talk-to-rocky.