Skip to content

Commit

Permalink
fix ust tempo parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
stakira committed Jun 16, 2023
1 parent a227d56 commit b020209
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions OpenUtau.Core/Classic/Ust.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,19 @@ public static UProject Load(StreamReader reader, string file) {
private static void ParsePart(UProject project, UVoicePart part, List<IniBlock> blocks) {
var lastNotePos = 0;
var lastNoteEnd = 0;
bool shouldFixTempo = project.tempos[0].bpm >= 0 && project.tempos[0].bpm < 1000; // Need to fix tempo=500k error or not.
var settingsBlock = blocks.FirstOrDefault(b => b.header == "[#SETTING]");
if (settingsBlock != null) {
ParseSetting(project, settingsBlock.lines);
}
bool shouldFixTempo = project.tempos[0].bpm <= 0 || project.tempos[0].bpm > 1000; // Need to fix tempo=500k error or not.
foreach (var block in blocks) {
var header = block.header;
try {
switch (header) {
case "[#VERSION]":
break;
case "[#SETTING]":
ParseSetting(project, block.lines);
// Already processed
break;
case "[#TRACKEND]":
break;
Expand Down

0 comments on commit b020209

Please sign in to comment.