From bc4c83d58e5f752806abda060fecf02923f40c54 Mon Sep 17 00:00:00 2001 From: Lotte V Date: Tue, 9 Apr 2024 20:06:06 +0200 Subject: [PATCH 1/3] Re-implement Teto fallback --- OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs b/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs index 87b670b3c..b04c13b66 100644 --- a/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs +++ b/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs @@ -214,7 +214,7 @@ protected override List ProcessSyllable(Syllable syllable) { isVocaSampa = true; } - if (!HasOto($"- V", syllable.vowelTone) && !HasOto($"V", syllable.vowelTone)) { + if (!HasOto($"- V", syllable.vowelTone) && !HasOto($"V", syllable.vowelTone) || (!HasOto($"- bV", syllable.vowelTone) && !HasOto($"bV", syllable.vowelTone))) { isSimpleDelta = true; } From 5eef05c60a03aa1eb0b1c279b4f9cdb2d477baac Mon Sep 17 00:00:00 2001 From: Lotte V Date: Tue, 9 Apr 2024 23:10:43 +0200 Subject: [PATCH 2/3] More vowel-related bug fixes --- OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs b/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs index b04c13b66..33220e3c0 100644 --- a/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs +++ b/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs @@ -230,7 +230,7 @@ protected override List ProcessSyllable(Syllable syllable) { isTrueXSampa = true; } - if ((!HasOto($"- 3", syllable.tone) && !HasOto($"3", syllable.tone)) || (!HasOto($"- @`", syllable.tone) && !HasOto($"@`", syllable.tone))) { + if (!HasOto($"- 3", syllable.tone) && !HasOto($"3", syllable.tone) && !HasOto($"- @`", syllable.tone) && !HasOto($"@`", syllable.tone)) { isSalemList = true; } @@ -245,9 +245,10 @@ protected override List ProcessSyllable(Syllable syllable) { basePhoneme = v; } } else if (syllable.IsVV) { - if (!CanMakeAliasExtension(syllable) || !AreTonesFromTheSameSubbank(syllable.tone, syllable.vowelTone)) { - basePhoneme = $"{prevV} {v}"; - if (!HasOto(basePhoneme, syllable.vowelTone) && vvExceptions.ContainsKey(prevV) && prevV != v || Delta5vvExceptions.ContainsKey(prevV) && prevV != v) { + if (!CanMakeAliasExtension(syllable)) { + var vv = $"{prevV} {v}"; + basePhoneme = vv; + if (!HasOto(vv, syllable.vowelTone) && !HasOto(ValidateAlias(vv), syllable.vowelTone) && (vvExceptions.ContainsKey(prevV) && prevV != v || Delta5vvExceptions.ContainsKey(prevV) && prevV != v)) { // VV splits to [V C][CV] or [V][V] var delta5vc = $"{Delta5vvExceptions[prevV]}"; bool CV = false; @@ -263,13 +264,11 @@ protected override List ProcessSyllable(Syllable syllable) { basePhoneme = cv; } } else { - { - // VV to V - if (HasOto($"{prevV} {v}", syllable.vowelTone) || HasOto(ValidateAlias($"{prevV} {v}"), syllable.vowelTone)) { - basePhoneme = $"{prevV} {v}"; - } else if (HasOto(v, syllable.vowelTone) || HasOto(ValidateAlias(v), syllable.vowelTone)) { - basePhoneme = v; - } + // VV to V + if (HasOto(vv, syllable.vowelTone) || HasOto(ValidateAlias(vv), syllable.vowelTone)) { + basePhoneme = vv; + } else if (HasOto(v, syllable.vowelTone) || HasOto(ValidateAlias(v), syllable.vowelTone)) { + basePhoneme = v; } } } else { @@ -357,8 +356,9 @@ protected override List ProcessSyllable(Syllable syllable) { basePhoneme = vccv; lastC = 0; } else { - basePhoneme = cc.Last() + v; - if (!HasOto(cc.Last() + v, syllable.vowelTone) && (HasOto(crv, syllable.vowelTone) || HasOto(ValidateAlias(crv), syllable.vowelTone))) { + var cv = cc.Last() + v; + basePhoneme = cv; + if ((!HasOto(cv, syllable.vowelTone) && !HasOto(ValidateAlias(cv), syllable.vowelTone)) && (HasOto(crv, syllable.vowelTone) || HasOto(ValidateAlias(crv), syllable.vowelTone))) { basePhoneme = crv; } // try CCV From 8ece5dfc36dfcfc2bd2754b81ca64588e4a5e524 Mon Sep 17 00:00:00 2001 From: Lotte V Date: Tue, 9 Apr 2024 23:20:28 +0200 Subject: [PATCH 3/3] ValidateAlias stuff --- OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs b/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs index 33220e3c0..2d1aa7e3d 100644 --- a/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs +++ b/OpenUtau.Plugin.Builtin/EnXSampaPhonemizer.cs @@ -252,7 +252,7 @@ protected override List ProcessSyllable(Syllable syllable) { // VV splits to [V C][CV] or [V][V] var delta5vc = $"{Delta5vvExceptions[prevV]}"; bool CV = false; - if (!HasOto(delta5vc, syllable.vowelTone)) { + if ((!HasOto(delta5vc, syllable.vowelTone) && !HasOto(ValidateAlias(delta5vc), syllable.vowelTone))) { delta5vc = $"{prevV} {vvExceptions[prevV]}"; CV = true; } @@ -260,7 +260,7 @@ protected override List ProcessSyllable(Syllable syllable) { // if delta5 vc is not available, turn v to cv var cv = $"{vvExceptions[prevV]}{v}"; basePhoneme = v; - if (CV && HasOto(cv, syllable.vowelTone)) { + if (CV && (HasOto(cv, syllable.vowelTone) || HasOto(ValidateAlias(cv), syllable.vowelTone))) { basePhoneme = cv; } } else {