Skip to content

Commit 6c44ef5

Browse files
authored
Revert "fix legacy plugin output (#1577)"
This reverts commit f5a87bb.
1 parent 7aa8090 commit 6c44ef5

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

OpenUtau.Core/Classic/Ust.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,8 @@ public static List<UNote> WritePlugin(UProject project, UVoicePart part, UNote f
333333
using (var writer = new StreamWriter(filePath, false, Encoding.GetEncoding(encoding))) {
334334
WriteHeader(project, part, writer);
335335
var position = 0;
336-
var note_count = 0;
337336
if (prev != null) {
338-
writer.WriteLine("[#PREV]");
339-
note_count += 1;
337+
writer.WriteLine($"[#PREV]");
340338
WriteNoteBody(project, track, part, prev, writer);
341339
position = prev.End;
342340
}
@@ -349,8 +347,7 @@ public static List<UNote> WritePlugin(UProject project, UVoicePart part, UNote f
349347
}
350348
if (note.position > position) {
351349
//Insert R note if there is space between two notes
352-
writer.WriteLine($"[#{note_count:D4}]");
353-
note_count += 1;
350+
writer.WriteLine($"[#{sequence.Count:D4}]");
354351
var spacer = UNote.Create();
355352
spacer.position = position;
356353
spacer.duration = note.position - position;
@@ -359,8 +356,7 @@ public static List<UNote> WritePlugin(UProject project, UVoicePart part, UNote f
359356
sequence.Add(spacer);
360357
WriteNoteBody(project, track, part, spacer, writer);
361358
}
362-
writer.WriteLine($"[#{note_count:D4}]");
363-
note_count += 1;
359+
writer.WriteLine($"[#{sequence.Count:D4}]");
364360
WriteNoteBody(project, track, part, note, writer, forPlugin: true);
365361
position = note.End;
366362
sequence.Add(note);

OpenUtau.Core/Classic/UstNote.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public void Write(StreamWriter writer, bool forPlugin = false) {
9494
writer.WriteLine($"@alias={alias}");
9595
}
9696
}
97-
writer.WriteLine("Envelope=5,0,0,100,100,100,100,%,35");
9897
WritePitch(writer);
9998
WriteVibrato(writer);
10099
}

OpenUtau.Test/Classic/PluginRunnerTest.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,12 @@ private static Action<StreamWriter, string> DoNothingResponse() {
118118
Lyric=R
119119
NoteNum=60
120120
PreUtterance=
121-
Envelope=5,0,0,100,100,100,100,%,35
122-
[#0001]
121+
[#0000]
123122
Length=20
124123
Lyric=ka
125124
NoteNum=0
126125
PreUtterance=
127-
Envelope=5,0,0,100,100,100,100,%,35
128-
[#0002]
126+
[#0001]
129127
Length=30
130128
Lyric=r
131129
NoteNum=0
@@ -134,25 +132,21 @@ private static Action<StreamWriter, string> DoNothingResponse() {
134132
Intensity=50
135133
Modulation=60
136134
Flags=g30B0H0P86
137-
Envelope=5,0,0,100,100,100,100,%,35
138-
[#0003]
135+
[#0002]
139136
Length=40
140137
Lyric=ta
141138
NoteNum=0
142139
PreUtterance=
143-
Envelope=5,0,0,100,100,100,100,%,35
144-
[#0004]
140+
[#0003]
145141
Length=50
146142
Lyric=na
147143
NoteNum=0
148144
PreUtterance=
149-
Envelope=5,0,0,100,100,100,100,%,35
150145
[#NEXT]
151146
Length=60
152147
Lyric=ha
153148
NoteNum=0
154149
PreUtterance=
155-
Envelope=5,0,0,100,100,100,100,%,35
156150
";
157151
// Different line feed code for each OS
158152
var eol = Environment.NewLine;

0 commit comments

Comments
 (0)