Translate lyrics while preserving musical constraints (syllable counts, rhyme scheme, syllable patterns). Use when the user wants to translate song lyrics from one language to another while maintaining singability.
Translate lyrics between languages while preserving syllable counts, rhyme scheme, and word-level syllable patterns so the translation remains singable.
Follow this 3-phase pipeline. Use the sub-skill scripts to verify at each step.
Before translating, analyze the source lyrics to extract targets:
Count syllables per line:
python skills/syllable-counter/scripts/count_syllables.py "<line>" "<source_lang>"
Get syllable patterns (word-level distribution):
python skills/syllable-pattern-analyzer/scripts/pattern_analysis.py "<source_lang>" "<line1>" "<line2>" ...
Detect rhyme scheme:
from rhyme_analysis import detect_rhyme_scheme
scheme = detect_rhyme_scheme(lines, source_lang)
Record the target syllable counts, patterns, and rhyme scheme.
Translate all lines at once, considering all 3 constraints:
Key rules for Chinese targets:
For each line, verify and refine:
Check syllable count:
python skills/syllable-counter/scripts/count_syllables.py "<translation>" "<target_lang>"
If count is wrong, adjust the translation:
Check syllable patterns:
python skills/syllable-pattern-analyzer/scripts/pattern_analysis.py "<target_lang>" "<translated_line>"
Verify rhyme preservation after pattern adjustments using the rhyme-analyzer.
Run the full validator on all translated lines:
python skills/lyrics-validator/scripts/validate.py "<target_lang>" '<target_syllables_json>' "<line1>" "<line2>" ...
Present the final translation as:
1. <translated line 1>
2. <translated line 2>
...
Syllable accuracy: X/Y lines match
Pattern similarity: X%
Rhyme scheme: <scheme>
See references/config.md for language codes and defaults. See references/graph-pipeline.md for pipeline architecture details.