Fix chord alignment: snap to word boundaries

Improve merge_chord_lyric() to snap chord positions to the start
of the word they fall within, instead of splitting words mid-way.
Fixes artifacts like "Liebespaar \chord{C}e" → "\chord{C}Liebespaare".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
shahondin1624
2026-04-02 16:36:06 +02:00
parent d875fd225b
commit 7b99778f67
295 changed files with 1804 additions and 1782 deletions

View File

@@ -8,19 +8,19 @@
}
\begin{verse}
So tr \chord{C}oll´n wir \chord{a}uns ganz fr \chord{G}omm und s \chord{C}acht / \\
vom W \chord{a}eingelag und Fr \chord{d}eudenschm \chord{G}aus, \\
wenn \chord{C}uns der T \chord{a}od ruft: G \chord{G}ute N \chord{C}acht, \\
dein St \chord{a}undengl \chord{G}as rinnt \chord{C}aus. \\
Wer h \chord{C}eut noch fr \chord{a}ech den Sch \chord{G}nabel w \chord{C}etzt \\
und gl \chord{a}aubt ein großer H \chord{d}err zu s \chord{G}ein, \\
pass a \chord{C}uf, der Schr \chord{a}einer h \chord{G}obelt \chord{C}jetzt \\
schon gr \chord{a}ad an d \chord{G}einem Schr \chord{C}ein! \\
Scheint das G \chord{G7}rab dir tief und d \chord{C}umpf sein Druck: \\
Ala \chord{G7}vott, so nimm noch e \chord{C}inen Schluck \\
und noch e \chord{F}inen hinterh \chord{C}er \\
und noch z \chord{G}weie, dreie m \chord{a}ehr; \\
dann st \chord{d}irbt sich´s n \chord{G}ic \chord{G7}ht so schw \chord{C}er.
So \chord{C}troll´n wir \chord{a}uns ganz \chord{G}fromm und \chord{C}sacht / \\
vom \chord{a}Weingelag und \chord{G}Freudenschmaus, \\
wenn \chord{C}uns der \chord{a}Tod ruft: \chord{G}Gute \chord{C}Nacht, \\
dein \chord{G}Stundenglas rinnt \chord{C}aus. \\
Wer \chord{C}heut noch \chord{a}frech den \chord{G}Schnabel \chord{C}wetzt \\
und \chord{a}glaubt ein großer \chord{d}Herr zu \chord{G}sein, \\
pass \chord{C}auf, der \chord{a}Schreiner \chord{G}hobelt \chord{C}jetzt \\
schon \chord{a}grad an \chord{G}deinem \chord{C}Schrein! \\
Scheint das \chord{G7}Grab dir tief und \chord{C}dumpf sein Druck: \\
\chord{G7}Alavott, so nimm noch \chord{C}einen Schluck \\
und noch \chord{F}einen \chord{C}hinterher \\
und noch \chord{G}zweie, dreie \chord{a}mehr; \\
dann \chord{d}stirbt sich´s \chord{G7}nicht so \chord{C}schwer.
\end{verse}
\begin{verse}