Skip to content

Exact time format for lyrics event in MIDI file [min : sec . milisec] or for example [01:03.125] #317

Discussion options

You must be logged in to vote

Sorry for bother I solved problem with moving

` Console.WriteLine($"{z} timed events found.");
TimeSpan midiFileDuration = midiFile.GetDuration();
// I move this upper command and ad in var metricTime , TimeSpan
foreach (var e in lyricTimedEvents)
{
var metricTime =(TimeSpan)e.TimeAs(tempoMap);
var lyricText = ((LyricEvent)e.Event).Text;
Console.Write($@"
[{metricTime:mm:ss.fff}]{lyricText}");
}

      tempoMap = midiFile.GetTempoMap();
      // TimeSpan midiFileDuration = midiFile.GetDuration<MetricTimeSpan>();

      Console.WriteLine($"            Midi File duration [ {SONG} ] = {midiFileDuration}");
      Console.ReadKey();
           foreach (var chord in midiFile.GetChords())`

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@melanchall
Comment options

Answer selected by melanchall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Just question about the library
2 participants