Skip to content
shiva.wm

ghostwriter

phonetic rhyme and flow analysis, built from the IPA up

  • 3-tier G2P, English + German
  • articulatory-feature scoring
  • 10 Vitest suites
  • ~14K lines TypeScript
activecomputational linguistics2026 — present

A local-first songwriting workbench whose core is a hand-built phonetics engine. It scores rhyme and flow on articulatory features rather than string matching or an off-the-shelf rhyme library. Every line runs through a three-tier grapheme-to-phoneme pipeline: a user custom dictionary, the CMU ARPABET dictionary for English, and an espeak-ng subprocess for German and out-of-vocabulary words. The output (IPA, per-syllable stress, and a stress-anchored rhyme tail) persists to a normalized 12-table SQLite schema.

Independent scorers compare lines by vowel height/backness/rounding and consonant manner/place/voicing. They add diphthong decomposition, a cross-language vowel-bending table grounded in rap phonology, and multisyllabic-rhyme detection with positional decay. A flow matcher builds on a weighted stress edit distance plus meter classification (iambic, trochaic, anapestic, dactylic, spondaic).

A single strictness slider continuously reweights the scoring components and slides the match threshold from strict perfect rhymes to loose slant matches. The engine is bilingual throughout: G2P, syllabification, and external suggestion routing (Datamuse for English, RhymeBrain for German).

Roughly 14,000 lines of TypeScript on Next.js 16 and React 19. The ~2,200-line, 19-module phonetics core is backed by ten Vitest suites and feeds 33 API routes and 18 pages spanning rhyme schemes, couplet finding, beat-to-syllable mapping, and palette generation.

stack
TypeScriptNext.js 16React 19better-sqlite3espeak-ngCMU Pronouncing DictionaryIPA / ARPABETDatamuse APIRhymeBrain APITailwind CSS v4shadcn/uiVitest