Skip to content

Commit

Permalink
Fix text event detection in lyrics parsing (YARC-Official#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNathannator authored Jun 10, 2023
1 parent c6a2ddb commit 436a1b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Assets/Script/Serialization/Parser/MidiParser.Vocals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ private List<GenericLyricInfo> ParseGenericLyrics(TrackChunk trackChunk, TempoMa
break;
}

// Get lyric text
string l = lyricEvent.Text.Trim();

// Remove state changes
if (l.StartsWith("[") && l.EndsWith("]")) {
if (textEventRegex.IsMatch(l)) {
// This is a normal text event, not a lyric
continue;
}

Expand Down Expand Up @@ -142,10 +142,10 @@ private List<LyricInfo> ParseRealLyrics(List<EventIR> eventIR, TrackChunk trackC
break;
}

// Get lyric text
string l = lyricEvent.Text.Trim();

// Remove state changes
if (l.StartsWith("[") && l.EndsWith("]")) {
if (textEventRegex.IsMatch(l)) {
// This is a normal text event, not a lyric
continue;
}

Expand Down

0 comments on commit 436a1b2

Please sign in to comment.