Aaron “Alex” HuusLAB + SYSTEMS + SOFTWARE
← All applications

Application case study · Local build, 1.0

Refrain

A local editor for replacing lyrics in an existing song recording.

The problem

Changing lyrics in a recording while retaining its accompaniment, melody, and phrasing requires coordinating transcription, vocal generation, and audio mixing.

The solution

Refrain separates and transcribes an uploaded recording, guides replacement vocals with the source performance, and mixes edits back into the song.

Visual demonstration

A 30-second excerpt from a saved full-song mix, with audio.
Refrain phrase editor showing source tracks, timed Twinkle lyrics, and a replacement passage about bubbles in tea.
Editing a passage using the repository's licensed Twinkle example.
Listening room with generated vocal and full-song players, take selection, level controls, and WAV export.
Compare a saved performance and adjust passage levels.
Whole-song lyric setup showing the original Twinkle phrases and a field for replacement lyrics.
Whole-song setup pairs source phrases with a replacement lyric draft.
Refrain welcome screen with a control to choose a recording.
The local editor starts with a recording import.

Technical implementation

A loopback Flask editor and command-line interface share a staged Python pipeline for audio decoding, stem separation, transcription, musical analysis, lyric alignment, singing, and reconstruction. Local project manifests and cached artifacts support resuming work and comparing takes. The default singer uses a synthetic house reference; source-voice conditioning is an explicit permission choice.

Challenges & lessons learned

The documented evaluation highlights the difficulty of aligning sung words: recognition timing is approximate, mismatched syllables can sound rushed, and intelligibility varies by passage. The editor provides timing corrections and warnings, while boundary blends and gain matching address transitions in the mix.

Refrain is designed for local inference and keeps project audio on the user’s machine. Its best-tested case is English lyrics with a clear lead melody; transcription, timing, and vocal quality can vary with the recording. The Twinkle screenshots show a candidate using the synthetic house voice.