Skip to content

Commit

Permalink
midi: handle multiple lyric events at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
oxygen-dioxide committed Sep 24, 2024
1 parent d541154 commit ddb91d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OpenUtau.Core/Format/MidiWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ static List<UVoicePart> ParseParts(MidiFile midi, short PPQ, UProject project) {
var events = objectsManager.Objects;
//{position of lyric: lyric text}
Dictionary<long, string> lyrics = events.Where(e => e.Event is LyricEvent)
.ToDictionary(e=> e.Time, e => ((LyricEvent)e.Event).Text);
.GroupBy(e => e.Time)
.ToDictionary(g=> g.Key, g => ((LyricEvent)g.First().Event).Text);
var trackName = events.Where(e => e.Event is SequenceTrackNameEvent)
.Select(e => ((SequenceTrackNameEvent)e.Event).Text).FirstOrDefault();
if (trackName != null) {
Expand Down

0 comments on commit ddb91d2

Please sign in to comment.