Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

競合解決 #2

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

This license covers both OpenUtau source code and Worldline prebuilt binaries.
2 changes: 1 addition & 1 deletion OpenUtau.Core/Util/Base64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void Base64ToFile(string base64str,string filePath) {
File.WriteAllBytes(filePath, bytes);

} catch (Exception ex) {
Log.Error(@"{ex}");
Log.Error($"{ex}");
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions OpenUtau.Core/Util/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ public class SerializablePreferences {
public string PhoneticAssistant = string.Empty;
public string RecentOpenSingerDirectory = string.Empty;
public string RecentOpenProjectDirectory = string.Empty;
public bool LockUnselectedNotesPitch = true;
public bool LockUnselectedNotesVibrato = true;
public bool LockUnselectedNotesExpressions = true;

public bool VoicebankPublishUseIgnore = true;
public string VoicebankPublishIgnores = "#Adobe Audition\n*.pkf\n\n#UTAU Engines\n*.ctspec\n*.d4c\n*.dio\n*.frc\n*.frt\n*.frq\n*.harvest\n*.lessaudio\n*.llsm\n*.mrq\n*.pitchtier\n*.pkf\n*.platinum\n*.pmk\n*.star\n*.uspec\n*.vs4ufrq\n\n#UTAU related tools\n$read\n*.setParam-Scache\n*.lbp\n*.lbp.caches/*\n\n#OpenUtau\nerrors.txt";
Expand Down
3 changes: 2 additions & 1 deletion OpenUtau.Core/Voicevox/VoicevoxClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ internal Tuple<string, byte[]> SendRequest(VoicevoxURL voicevoxURL) {
if (!str.StartsWith("{") || !str.EndsWith("}")) {
str = "{ \"json\":" + str + "}";
}
Log.Information($"VoicevoxResponse StatusCode :{response.Result.StatusCode}");
return new Tuple<string, byte[]>(str, response.Result.Content.ReadAsByteArrayAsync().Result);
}
}
} catch (Exception ex) {
Log.Error(@"{ex}");
Log.Error($"{ex}");
}
return new Tuple<string, byte[]>("", new byte[0]);
}
Expand Down
10 changes: 6 additions & 4 deletions OpenUtau.Core/Voicevox/VoicevoxSinger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ void Load() {
}

public override bool TryGetOto(string phoneme, out UOto oto) {
var parts = phoneme.Split();
if (parts.All(p => phonemes.Contains(p))) {
oto = UOto.OfDummy(phoneme);
return true;
if(phoneme != null) {
var parts = phoneme.Split();
if (parts.All(p => phonemes.Contains(p))) {
oto = UOto.OfDummy(phoneme);
return true;
}
}
oto = null;
return false;
Expand Down
4 changes: 4 additions & 0 deletions OpenUtau.Core/Voicevox/VoicevoxUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public static VoicevoxQueryMain NoteGroupsToVoicevox(Note[][] notes, TimeAxis ti
while (index < notes.Length) {
string lyric = dic.Lyrictodic(notes, index);
int length = (int)Math.Round(((timeAxis.TickPosToMsPos(notes[index].Sum(n => n.duration)) / 1000f) * VoicevoxUtils.fps), MidpointRounding.AwayFromZero);
//Avoid synthesis without at least two frames.
if (length < 2 ) {
length = 2;
}
int? tone = null;
if (!string.IsNullOrEmpty(lyric) || VoicevoxUtils.IsPau(lyric)) {
if (notes[index][0].phonemeAttributes != null) {
Expand Down
19 changes: 14 additions & 5 deletions OpenUtau.Plugin.Builtin/ArpasingPlusPhonemizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class ArpasingPlusPhonemizer : SyllableBasedPhonemizer {
protected override string GetDictionaryName() => "cmudict-0_7b.txt";
protected override Dictionary<string, string> GetDictionaryPhonemesReplacement() => dictionaryReplacements;


// For banks with missing vowels
private readonly Dictionary<string, string> missingVphonemes = "ax=ah,aa=ah,ae=ah,iy=ih,uh=uw,ix=ih,ux=uh,oh=ao,eu=uh,oe=ax,uy=uw,yw=uw,yx=iy,wx=uw,ea=eh,ia=iy,oa=ao,ua=uw".Split(',')
private readonly Dictionary<string, string> missingVphonemes = "ax=ah,aa=ah,ae=ah,iy=ih,uh=uw,ix=ih,ux=uh,oh=ao,eu=uh,oe=ax,uy=uw,yw=uw,yx=iy,wx=uw,ea=eh,ia=iy,oa=ao,ua=uw,R=-".Split(',')
.Select(entry => entry.Split('='))
.Where(parts => parts.Length == 2)
.Where(parts => parts[0] != parts[1])
Expand Down Expand Up @@ -97,9 +98,13 @@ public class ArpasingPlusPhonemizer : SyllableBasedPhonemizer {
private readonly string[] ccvException = { "ch", "dh", "dx", "fh", "gh", "hh", "jh", "kh", "ph", "ng", "sh", "th", "vh", "wh", "zh" };
private readonly string[] vc_cAcception = { "r", "l" };
private readonly string[] RomajiException = { "a", "e", "i", "o", "u" };
private string[] tails = "-,R,RB".Split(',');

protected override string[] GetSymbols(Note note) {
string[] original = base.GetSymbols(note);
if (tails.Contains(note.lyric)) {
return new string[] { note.lyric };
}
if (original == null) {
return null;
}
Expand Down Expand Up @@ -198,9 +203,10 @@ protected override IG2p LoadBaseDictionary() {
g2ps.Add(new ArpabetPlusG2p());
return new G2pFallbacks(g2ps.ToArray());
}

protected override List<string> ProcessSyllable(Syllable syllable) {
string prevV = syllable.prevV;
syllable.prevV = tails.Contains(syllable.prevV) ? "" : syllable.prevV;
var prevV = syllable.prevV == "" ? "" : $"{syllable.prevV}";
//string prevV = syllable.prevV;
string[] cc = syllable.cc;
string v = syllable.v;
string basePhoneme;
Expand Down Expand Up @@ -354,7 +360,7 @@ protected override List<string> ProcessSyllable(Syllable syllable) {
for (var i = firstC; i < cc.Length - 1; i++) {
var ccv = $"{string.Join("", cc)} {v}";
var ccv1 = string.Join("", cc.Skip(i)) + " " + v;
if (syllable.CurrentWordCc.Length >= 2 && !ccvException.Contains(cc[0])) {
if (syllable.CurrentWordCc.Length >= 2 && !ccvException.Contains(cc[i] + cc[i + 1])) {
if (HasOto(ccv, syllable.vowelTone) || HasOto(ValidateAlias(ccv), syllable.vowelTone)) {
basePhoneme = ccv;
lastC = i;
Expand All @@ -375,7 +381,7 @@ protected override List<string> ProcessSyllable(Syllable syllable) {
var vc = $"{prevV} {cc[0]}";
// CCV will trigger VCC
bool CCV = false;
if (syllable.CurrentWordCc.Length >= 2 && !ccvException.Contains(cc[0])) {
if (syllable.CurrentWordCc.Length >= 2 && !ccvException.Contains(cc[1])) {
if (HasOto($"{string.Join("", cc)} {v}", syllable.vowelTone) || HasOto(ValidateAlias($"{string.Join("", cc)} {v}"), syllable.vowelTone)) {
CCV = true;
}
Expand Down Expand Up @@ -516,6 +522,9 @@ protected override List<string> ProcessEnding(Ending ending) {
var phonemes = new List<string>();
var lastC = cc.Length - 1;
var firstC = 0;
if (tails.Contains(ending.prevV)) {
return new List<string>();
}
if (ending.IsEndingV) {
var vR = $"{v} -";
var vR1 = $"{v} R";
Expand Down
Loading
Loading