Skip to content

Commit 1b2a1ae

Browse files
authored
Merge branch 'master' into 0501_FixLyricReplace
2 parents 81accd2 + b969d52 commit 1b2a1ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+602
-744
lines changed

.github/workflows/pr-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ jobs:
1111
os:
1212
- runs-on: windows-latest
1313
arch: win-x64
14-
- runs-on: macos-latest
14+
- runs-on: macos-13
1515
arch: osx-x64
1616
- runs-on: ubuntu-latest
1717
arch: linux-x64
1818

1919
steps:
2020
- uses: actions/checkout@v1
2121

22+
- uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: '6.0.x'
25+
2226
- name: restore
2327
run: dotnet restore OpenUtau -r ${{ matrix.os.arch }}
2428

.github/workflows/release-cleanup.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- uses: dev-drprasad/[email protected]
2424
with:
2525
keep_latest: 32
26+
delete_prerelease_only: true
2627
delete_tag_pattern: build
2728
env:
2829
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

OpenUtau.Core/Api/G2pPack.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Linq;
45
using System.Text.RegularExpressions;
56
using Microsoft.ML.OnnxRuntime;
@@ -82,7 +83,7 @@ public string[] UnpackHint(string hint, char separator = ' ') {
8283
return Dict.UnpackHint(hint, separator);
8384
}
8485

85-
protected string[] Predict(string grapheme) {
86+
protected virtual string[] Predict(string grapheme) {
8687
Tensor<int> src = EncodeWord(grapheme);
8788
if (src.Length == 0 || Session == null) {
8889
return new string[0];

OpenUtau.Core/Classic/ClassicRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public Task<RenderResult> RenderExternal(RenderPhrase phrase, Progress progress,
107107
result.samples = Wave.GetSamples(waveStream.ToSampleProvider().ToMono(1, 0));
108108
}
109109
} catch (Exception e) {
110-
Log.Error(e, "Failed to render.");
110+
Log.Error(e, $"Failed to render: failed to open {wavPath}");
111111
}
112112
}
113113
if (result.samples == null) {

OpenUtau.Core/Commands/Notifications.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,24 @@ public SelectExpressionNotification(string expKey, int index, bool updateShadow)
103103
public class SetPlayPosTickNotification : UNotification {
104104
public readonly int playPosTick;
105105
public readonly bool waitingRendering;
106+
public readonly bool pause;
106107
public override bool Silent => true;
107-
public SetPlayPosTickNotification(int tick, bool waitingRendering = false) {
108+
public SetPlayPosTickNotification(int tick, bool waitingRendering = false, bool pause = false) {
108109
playPosTick = tick;
109110
this.waitingRendering = waitingRendering;
111+
this.pause = pause;
110112
}
111113
public override string ToString() => $"Set play position to tick {playPosTick}";
112114
}
113115

114116
// Notification for playback manager to change play position
115117
public class SeekPlayPosTickNotification : UNotification {
116118
public int playPosTick;
119+
public readonly bool pause;
117120
public override bool Silent => true;
118-
public SeekPlayPosTickNotification(int tick) {
121+
public SeekPlayPosTickNotification(int tick, bool pause = false) {
119122
playPosTick = tick;
123+
this.pause = pause;
120124
}
121125
public override string ToString() => $"Seek play position to tick {playPosTick}";
122126
}

OpenUtau.Core/Commands/ProjectCommands.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public ConfigureExpressionsCommand(
167167
public override string ToString() => "Configure expressions";
168168
public override void Execute() {
169169
project.expressions = newDescriptors.ToDictionary(descriptor => descriptor.abbr);
170+
Format.Ustx.AddDefaultExpressions(project);
170171
project.parts
171172
.Where(part => part is UVoicePart)
172173
.ToList()
@@ -175,6 +176,7 @@ public override void Execute() {
175176
}
176177
public override void Unexecute() {
177178
project.expressions = oldDescriptors.ToDictionary(descriptor => descriptor.abbr);
179+
Format.Ustx.AddDefaultExpressions(project);
178180
project.parts
179181
.Where(part => part is UVoicePart)
180182
.ToList()

OpenUtau.Core/DiffSinger/DiffSingerRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ float[] InvokeDiffsinger(RenderPhrase phrase, double depth, int steps, Cancellat
151151
}
152152
if (singer.dsConfig.mel_scale != "slaney" && singer.dsConfig.mel_scale != "htk") {
153153
throw new Exception(
154-
$"Mel scale must be \"slaney\" or \"htk\", but got \"{vocoder.mel_scale}\" from acoustic model");
154+
$"Mel scale must be \"slaney\" or \"htk\", but got \"{singer.dsConfig.mel_scale}\" from acoustic model");
155155
}
156156
//mel specification matching checks
157157
if(vocoder.sample_rate != singer.dsConfig.sample_rate) {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using OpenUtau.Api;
2+
using OpenUtau.Core.G2p;
3+
4+
namespace OpenUtau.Core.DiffSinger
5+
{
6+
[Phonemizer("DiffSinger Korean G2P Phonemizer", "DIFFS KO", language: "KO", author: "Cardroid6")]
7+
public class DiffSingerKoreanG2PPhonemizer : DiffSingerG2pPhonemizer
8+
{
9+
protected override string GetDictionaryName() => "dsdict-ko.yaml";
10+
protected override IG2p LoadBaseG2p() => new KoreanG2p();
11+
protected override string[] GetBaseG2pVowels() => new string[] {
12+
"a", "e", "eo", "eu", "i", "o", "u", "w", "y"
13+
};
14+
15+
protected override string[] GetBaseG2pConsonants() => new string[] {
16+
"K", "L", "M", "N", "NG", "P", "T", "b", "ch", "d",
17+
"g", "h", "j", "jj", "k", "kk", "m", "n", "p", "pp",
18+
"r", "s", "ss", "t", "tt"
19+
};
20+
}
21+
}

0 commit comments

Comments
 (0)