Skip to content

Commit

Permalink
acep: restore changes for spanish
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulMelody committed Oct 15, 2024
1 parent 33472f0 commit 8810458
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libresvip/plugins/acep/ace_studio_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def generate_note(self, note: Note, pinyin: Optional[str] = None) -> None:
elif self.options.default_consonant_length:
ace_note.head_consonants = [self.options.default_consonant_length]
elif (
self.options.lyric_language == AcepLyricsLanguage.ENGLISH
self.options.lyric_language in [AcepLyricsLanguage.ENGLISH, AcepLyricsLanguage.SPANISH]
and ace_note.lyric == "+"
and self.ace_note_list
):
Expand Down
13 changes: 5 additions & 8 deletions libresvip/plugins/acep/ace_studio_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from .options import InputOptions, NormalizationMethod
from .singers import id2singer

ACEP_ENGLISH_SPAN_RE = re.compile(r"#(\d+)$")
ACEP_LATIN_SPAN_RE = re.compile(r"#(\d+)$")


@dataclasses.dataclass
Expand Down Expand Up @@ -192,14 +192,11 @@ def parse_note(self, ace_note: AcepNote, pinyin: Optional[str] = None) -> Note:
lyric=ace_note.lyric,
)
if (
ace_note.language == AcepLyricsLanguage.ENGLISH
and (english_span := ACEP_ENGLISH_SPAN_RE.search(note.lyric)) is not None
ace_note.language == [AcepLyricsLanguage.ENGLISH, AcepLyricsLanguage.SPANISH]
and (latin_span := ACEP_LATIN_SPAN_RE.search(note.lyric)) is not None
):
span_index = int(english_span.group(1))
if span_index == 1:
note.lyric = ACEP_ENGLISH_SPAN_RE.sub("", note.lyric)
else:
note.lyric = "+"
span_index = int(latin_span.group(1))
note.lyric = ACEP_LATIN_SPAN_RE.sub("", note.lyric) if span_index == 1 else "+"
if pinyin is None or "-" not in ace_note.lyric and ace_note.pronunciation != pinyin:
note.pronunciation = ace_note.pronunciation
if ace_note.br_len > 0:
Expand Down
6 changes: 6 additions & 0 deletions libresvip/plugins/acep/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ class AcepLyricsLanguage(Enum):
title=_("English"),
),
] = "ENG"
SPANISH: Annotated[
str,
Field(
title=_("Spanish"),
),
] = "SPA"
49 changes: 49 additions & 0 deletions libresvip/plugins/acep/singers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,29 @@
39: "唐青乐",
40: "Sidney",
41: "Naples",
48: "Blaze A",
49: "Drex L",
50: "Trey L",
51: "Dom M",
52: "Ember Rose",
54: "Zalo",
55: "Franklin",
56: "Elirah",
57: "Jessica",
58: "Emma",
59: "Maximus",
61: "Livia",
62: "Celestia",
63: "Valentina",
64: "Dominic",
65: "Micky",
66: "Kiza",
67: "Macro",
68: "Draco",
69: "Julian",
70: "Karolyn",
78: "Clara Epic",
81: "Clara Dark",
1006: "言和",
1007: "乐正绫",
1011: "乐正龙牙",
Expand Down Expand Up @@ -116,5 +139,31 @@
100: "水音ラル Normal",
101: "水音ラル Power",
102: "水音ラル Gravity",
103: "Blaze A",
104: "Drex L",
105: "Trey L",
106: "Dom M",
107: "Ember Rose",
108: "Zalo",
109: "Franklin",
110: "Elirah",
111: "Jessica",
112: "Emma",
113: "Maximus",
114: "Felix",
115: "Livia",
116: "Celestia",
117: "Valentina",
118: "Dominic",
119: "Micky",
120: "Kiza",
121: "Marco",
122: "Draco",
123: "Julian",
124: "Karolyn",
127: "Clara Epic",
128: "Clara Dark",
129: "汐蕾",
130: "喜天",
},
).inverse

0 comments on commit 8810458

Please sign in to comment.