Skip to content

Commit

Permalink
Oops, CC not FC vel change
Browse files Browse the repository at this point in the history
  • Loading branch information
lottev1991 committed Oct 14, 2023
1 parent 4fbec6a commit 298b303
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions KoreanCVVCPlusPhonemizer/KoreanCVVCPlusPhonemizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN
var nextAttr = nextNeighbour.Value.phonemeAttributes?.FirstOrDefault(attr => attr.index == 0) ?? default;
// Minimam is 30 tick, maximum is half of note

fcLength = Convert.ToInt32(Math.Min(totalDuration / 2, Math.Max(30, fcLength * (nextAttr.consonantStretchRatio ?? 1))));
ccLength = Convert.ToInt32(Math.Min(totalDuration / 2, Math.Max(30, ccLength * (nextAttr.consonantStretchRatio ?? 1))));

if (singer.TryGetMappedOto(CV, note.tone + attr0.toneShift, attr0.voiceColor, out var oto1) && singer.TryGetMappedOto(FC, note.tone + attr0.toneShift, attr0.voiceColor, out var oto2) && singer.TryGetMappedOto(CC, note.tone + attr0.toneShift, attr0.voiceColor, out var oto3)) {
CV = oto1.Alias;
FC = oto2.Alias;
Expand Down Expand Up @@ -782,7 +783,7 @@ public override Result Process(Note[] notes, Note? prev, Note? next, Note? prevN

var nextAttr = nextNeighbour.Value.phonemeAttributes?.FirstOrDefault(attr => attr.index == 0) ?? default;
// Minimam is 30 tick, maximum is half of note
fcLength = Convert.ToInt32(Math.Min(totalDuration / 2, Math.Max(30, fcLength * (nextAttr.consonantStretchRatio ?? 1))));
ccLength = Convert.ToInt32(Math.Min(totalDuration / 2, Math.Max(30, ccLength * (nextAttr.consonantStretchRatio ?? 1))));

if (singer.TryGetMappedOto(CV, note.tone + attr0.toneShift, attr0.voiceColor, out var oto1) && singer.TryGetMappedOto(FC, note.tone + attr0.toneShift, attr0.voiceColor, out var oto2) && singer.TryGetMappedOto(CC, note.tone + attr0.toneShift, attr0.voiceColor, out var oto3)) {
CV = oto1.Alias;
Expand Down

0 comments on commit 298b303

Please sign in to comment.