Skip to content

Commit

Permalink
Merge pull request #1122 from EX3exp/update-ko-cvvc-phonemizer
Browse files Browse the repository at this point in the history
Improved KO CVVC Phonemizer
  • Loading branch information
stakira authored May 10, 2024
2 parents 9f91b54 + 75e2921 commit 1d5478a
Show file tree
Hide file tree
Showing 2 changed files with 440 additions and 506 deletions.
9 changes: 8 additions & 1 deletion OpenUtau.Plugin.Builtin/BaseKoreanPhonemizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public abstract class BaseKoreanPhonemizer : Phonemizer {
protected static readonly string[] PLAIN_VOWELS = new string[]{"", "", "", "", "", "", "", ""};
protected static readonly string[] SOFT_BATCHIMS = new string[]{"", "", ""};
protected static readonly string[] HARD_BATCHIMS = new string[]{"", "", "", ""};

// this phonemizer will call ConvertPhonemes() when lyric is hanguel or additionalTest is true . (override to use)
protected virtual bool additionalTest(string lyric) {
return false;
}
public override void SetSinger(USinger singer) => this.singer = singer;
public static string? FindInOto(USinger singer, string phoneme, Note note, bool nullIfNotFound = false) {
// 음소와 노트를 입력받고, 다음계 및 보이스컬러 에일리어스를 적용한다.
Expand Down Expand Up @@ -125,6 +130,7 @@ public Result GenerateResult(String firstPhoneme, String secondPhoneme, int tota
position = totalDuration - totalDuration / totalDurationDivider},
}
};

}

/// <summary>
Expand Down Expand Up @@ -292,14 +298,15 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
phonemes = phonemes
};
}
else if (KoreanPhonemizerUtil.IsHangeul(lyric)) {
else if (KoreanPhonemizerUtil.IsHangeul(lyric) || !KoreanPhonemizerUtil.IsHangeul(lyric) && additionalTest(lyric)) {
return ConvertPhonemes(notes, prev, next, prevNeighbour, nextNeighbour, prevNeighbours);
}
else {
return GenerateEndSound(notes, prev, next, prevNeighbour, nextNeighbour, prevNeighbours);
}
}


/// <summary>
/// abstract class for Ini Management
/// To use, child phonemizer should implement this class(BaseIniManager) with its own setting values!
Expand Down
Loading

0 comments on commit 1d5478a

Please sign in to comment.