Fix opening filler via lean tags and intro QC gate.
selftest / selftest (push) Canceled after 0s

Stop naming filler syllables in tags (they conditioned the model); default prefer_lean_tags; hard-fail intro_filler in QC; add plugins/ hook bus as thin microkernel extension point.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
swl
2026-10-10 12:49:25 +08:00
co-authored by Cursor
parent 0ab8d8ad4d
commit b1afe68f3c
20 changed files with 426 additions and 84 deletions
+24 -19
View File
@@ -18,6 +18,9 @@ from songforge.core.errors import LexiconError, RuleViolation
TRIGGER = "swlvoice"
# ⚠ 禁止在 tags 里点名衬词音节(mm / ooh / en / wu / 嗯 / 呀…)。
# 实测:否定句里写出这些音节会把它们喂进条件通道,开曲反而「必出」衬词;
# 标签越长开头人声越响(r≈+0.513)。用抽象禁令 + 正向器乐描述。
RULE_INTRO = (
"8 bar instrumental intro hook before any vocals, "
"instrumental opening, no singing in the first 8 bars, "
@@ -25,9 +28,9 @@ RULE_INTRO = (
"the intro has a catchy instrumental melody hook, "
"the intro bass line and synth melody are the most memorable catchy element, "
"rhythmic drums from the very first beat, "
"intro is instrumental only, no voice, no lyrics, no humming, "
"no vocal ad-lib in the opening, no wu wu wu, no woo woo, "
"no mm mm, no en en, no ng ng, no mouth sounds, no grunting, "
"intro is instrumental only, no voice, no lyrics, "
"no vocal ad-lib in the opening, no wordless vocals in the opening, "
"no mouth sounds in the opening, "
"the opening features a strong instrumental melody line, "
"synth lead melody plays from the very beginning, "
"instrumental melody carries the intro hook"
@@ -35,21 +38,19 @@ RULE_INTRO = (
# 注意:绝对不要加 "no long empty instrumental"。它与"必须有 8 小节器乐前奏"
# 直接矛盾,模型为消除"空"而把前奏填满人声。这个坑踩过,别加回来。
# 默认路径已改 prefer_lean_tags:尽量不注入本段;若注入也禁止点名音节。
RULE_NEG = (
"no opening vocals, no pure vocal intro, no a cappella opening, "
"no vocal intro, no singing until after the instrumental hook, "
"no spoken intro, no rap intro talk, no intro talking, "
"no humming, no mm mm syllables, no oh oh syllables, "
"no wu wu wu, no woo woo, no ooh ooh, no sustained wu vowel, "
"no en en en, no ng ng ng, no mouth sounds, no grunting, no breathing sounds, "
"no eh ah ah filler, no vocal ad-libs, no droning sustained vowels, "
"no yodeling, no melisma, no crooning, no R&B ballad vocal style, "
"no wordless vocals in the opening, no vocal ad-libs in the opening, "
"no mouth sounds in the opening, no breathing sounds as melody, "
"no yodeling, no melisma filler, no crooning intro, "
"no overly long intro, no excessive drum solo, "
"no slow start, no fade in, "
"no beatless intro, no unaccompanied vocal, no a cappella, "
"no singing chinese instruction words, no vocalizing text labels, "
"no wordless vocalization, no non-verbal vocal sounds, "
"no vocal pad, no vocal texture, no ambient vocal, "
"no vocal pad in the opening, no ambient vocal in the opening, "
"no background vocal in the opening, no choir in the intro, "
"no vocal harmonies in the intro, no vocal layer in the opening"
)
@@ -76,7 +77,8 @@ RULE_NO_FILLER = (
"solo lead vocal only, "
"no backing vocals, no backup singers, no choir, "
"no vocal doubles, no harmony stack, no call and response vocals, "
"no wordless vocals between sections"
"no wordless vocals between sections, "
"no wordless vocals in the opening"
)
RULE_HARMONY = (
@@ -346,7 +348,7 @@ STEM_INST_LYRICS = ("[intro]\n[inst]\n[inst]\n[verse]\n[inst]\n[inst]\n"
"[chorus]\n[inst]\n[inst]\n[bridge]\n[inst]\n[outro]")
STEM_INST_TAGS = (
"pure instrumental track, no vocals anywhere, "
"no singing, no voice, no humming, no vocal ad-lib, "
"no singing, no voice, no wordless vocals, no vocal ad-lib, "
"instrumental only, this is a backing track with no lead vocal, "
"drums bass and chords only, drums enter on the very first beat"
)
@@ -531,7 +533,7 @@ RULE_INST_MEMO = (
RULE_INST_NEG = (
"no vocals anywhere, no singing, no voice, no lead vocal, no backing vocal, "
"no humming, no mm mm syllables, no oh oh syllables, no vocal ad-lib, "
"no wordless vocals, no vocal ad-lib, "
"no whisper, no spoken word, no rap, no choir, no vocal sample, "
"no a cappella, instrumental only, this is a backing track, "
"drums bass synths chords and lead melodies only, "
@@ -1073,15 +1075,18 @@ def check_rules(lyrics, tags, lean=False):
if kw == "swlvoice" or need_neg:
if kw not in low:
errs.append("tags 缺少 '%s'" % kw)
# RULE_NO_FILLER 在 lean 下也必须存在:它是唯一一条约束整首歌
# 人声只唱歌词、不唱衬音的规则。lean 跳过 RULE_NEG 是因为前奏否定句
# 膨胀,但衬音禁令跟前奏无关,不能一起跳过。
# 2026-10-08:从负面禁词(no ooh / no 嗯嗯)改为正面强制
# "sing only the exact words",校验关键词也跟着改。
# RULE_NO_FILLER:禁止点名音节;用抽象词校验。
for kw in ("sing only the exact words", "instrumental only",
"solo lead vocal only", "no backing vocals"):
"solo lead vocal only", "no backing vocals",
"no wordless vocals"):
if kw not in low:
errs.append("tags 缺少 '%s'(衬音禁令,lean 下也必须存在)" % kw)
# 禁止把衬词音节写进 tags(会诱发开曲必出衬词)
for bad in ("mm mm", "ooh ooh", "oh oh syllables", "wu wu wu",
"en en", "ng ng", "woo woo"):
if bad in low:
errs.append("tags 点名衬词音节 '%s'(会诱发开曲衬词,请用 "
"no wordless vocals)" % bad)
# 器乐前奏小节数:普通歌曲 8 小节,chill 吟唱 8 小节,纯器乐 8 小节。
# 三种模式现在统一 8 小节(chill 曾试过 16,实测对人声起点毫无作用)。
# 这里仍然只校验"写了且在 4~32 范围内",不写死具体数字: