diff --git a/OpenUtau.Plugin.Builtin/ArpasingPlusPhonemizer.cs b/OpenUtau.Plugin.Builtin/ArpasingPlusPhonemizer.cs index 26de5b57b..0a70297ee 100644 --- a/OpenUtau.Plugin.Builtin/ArpasingPlusPhonemizer.cs +++ b/OpenUtau.Plugin.Builtin/ArpasingPlusPhonemizer.cs @@ -90,10 +90,6 @@ public class ArpasingPlusPhonemizer : SyllableBasedPhonemizer { private readonly Dictionary vvExceptions = new Dictionary() { - {"e","y"}, - {"i","y"}, - {"o","w"}, - {"u","w"}, {"aw","w"}, {"ow","w"}, {"uw","w"}, @@ -285,7 +281,7 @@ protected override List ProcessSyllable(Syllable syllable) { // STARTING V if (syllable.IsStartingV) { - basePhoneme = AliasFormat(v, "startingV", syllable.vowelTone, ""); + basePhoneme = AliasFormat(v, "startingV", syllable.vowelTone, ""); } // [V V] or [V C][C V]/[V] else if (syllable.IsVV) { @@ -328,7 +324,7 @@ protected override List ProcessSyllable(Syllable syllable) { /// - CV if ((HasOto(rcv, syllable.vowelTone) || HasOto(ValidateAlias(rcv), syllable.vowelTone)) || (HasOto(rcv1, syllable.vowelTone) || HasOto(ValidateAlias(rcv1), syllable.vowelTone))) { basePhoneme = AliasFormat($"{cc[0]} {v}", "dynStart", syllable.vowelTone, ""); - /// CV + /// CV } else if ((HasOto(crv, syllable.vowelTone) || HasOto(ValidateAlias(crv), syllable.vowelTone))) { basePhoneme = AliasFormat($"{cc[0]} {v}", "dynMid", syllable.vowelTone, ""); TryAddPhoneme(phonemes, syllable.tone, AliasFormat($"{cc[0]}", "cc_start", syllable.vowelTone, "")); @@ -467,7 +463,7 @@ protected override List ProcessSyllable(Syllable syllable) { cc1 = ValidateAlias(cc1); } // CCV - if (syllable.CurrentWordCc.Length == 2) { + if (syllable.CurrentWordCc.Length >= 2) { if (HasOto(ccv, syllable.vowelTone) || HasOto(ValidateAlias(ccv), syllable.vowelTone) || HasOto(ccv1, syllable.vowelTone) || HasOto(ValidateAlias(ccv1), syllable.vowelTone) && !ccvException.Contains(cc[0])) { basePhoneme = AliasFormat($"{string.Join("", cc.Skip(i + 1))} {v}", "dynMid", syllable.vowelTone, ""); lastC = i; @@ -478,12 +474,12 @@ protected override List ProcessSyllable(Syllable syllable) { if (HasOto($"{cc[i]} {string.Join("", cc.Skip(i + 1))}", syllable.tone)) { cc1 = $"{cc[i]} {string.Join("", cc.Skip(i + 1))}"; } - // CV + // CV } else if (syllable.CurrentWordCc.Length == 1 && syllable.PreviousWordCc.Length == 1) { basePhoneme = AliasFormat($"{cc.Last()} {v}", "dynMid", syllable.vowelTone, ""); // [C1 C2] if (!HasOto(cc1, syllable.tone)) { - cc1 = $"{cc[i]} {cc[i + 1]}"; + cc1 = $"{cc[i]} {cc[i + 1]}"; } } // C+V @@ -492,7 +488,7 @@ protected override List ProcessSyllable(Syllable syllable) { basePhoneme = v; cc1 = ValidateAlias(cc1); } - + if (i + 1 < lastC) { if (!HasOto(cc1, syllable.tone)) { cc1 = ValidateAlias(cc1); @@ -514,7 +510,7 @@ protected override List ProcessSyllable(Syllable syllable) { cc1 = ValidateAlias(cc1); } // CCV - if (syllable.CurrentWordCc.Length == 2) { + if (syllable.CurrentWordCc.Length >= 2) { if (HasOto(ccv, syllable.vowelTone) || HasOto(ValidateAlias(ccv), syllable.vowelTone) || HasOto(ccv1, syllable.vowelTone) || HasOto(ValidateAlias(ccv1), syllable.vowelTone) && !ccvException.Contains(cc[0])) { basePhoneme = AliasFormat($"{string.Join("", cc.Skip(i + 1))} {v}", "dynMid", syllable.vowelTone, ""); lastC = i; @@ -545,7 +541,7 @@ protected override List ProcessSyllable(Syllable syllable) { basePhoneme = v; cc1 = ValidateAlias(cc1); } - + if (HasOto(cc1, syllable.tone) && HasOto(cc1, syllable.tone) && !cc1.Contains($"{string.Join("", cc.Skip(i))}")) { // like [V C1] [C1 C2] [C2 C3] [C3 ..] phonemes.Add(cc1); @@ -619,7 +615,6 @@ protected override List ProcessEnding(Ending ending) { firstC = 1; break; } else if ((HasOto(vcc2, ending.tone) || HasOto(ValidateAlias(vcc2), ending.tone)) && lastC == 1 && !ccvException.Contains(cc[0])) { - phonemes.Add(vcc2); firstC = 1; break; @@ -741,7 +736,6 @@ private string AliasFormat(string alias, string type, int tone, string prevV) { { "cc_end", new string[] { " -", "-", "" } }, { "cc_mix", new string[] { " -", " R", "-", "", "_", "- ", "-" } }, { "cc1_mix", new string[] { "", " -", "-", " R", "_", "- ", "-" } }, - { "cc_b", new string[] { "d", "g", "p" } }, }; // Check if the given type exists in the aliasFormats dictionary @@ -810,16 +804,16 @@ private string AliasFormat(string alias, string type, int tone, string prevV) { // If the alias contains a space, split it into consonant and vowel if (alias.Contains(" ")) { var parts = alias.Split(' '); - consonant = parts[0]; - vowel = parts[1]; + consonant = parts[1]; + vowel = parts[0]; } else { consonant = alias; } var dynamicVariations1 = new List { + $"{vowel}{consonant} -", // "VC -" $"{vowel} {consonant}-", // "V C-" $"{vowel}{consonant}-", // "VC-" $"{vowel} {consonant} -", // "V C -" - $"{vowel}{consonant} -", // "VC -" }; // Check each dynamically generated format foreach (var variation1 in dynamicVariations1) { @@ -1453,7 +1447,7 @@ protected override string ValidateAlias(string alias) { } } } - + // glottal foreach (var v1 in vowels) { if (!alias.Contains("cl " + v1) || !alias.Contains("q " + v1)) { @@ -1553,7 +1547,7 @@ protected override string ValidateAlias(string alias) { return base.ValidateAlias(alias); } - + protected override double GetTransitionBasicLengthMs(string alias = "") { //I wish these were automated instead :') double transitionMultiplier = 1.0; // Default multiplier