Exact time format for lyrics event in MIDI file [min : sec . milisec] or for example [01:03.125] #317
-
When I read midi file with note event I get on Visual Studio Code terminal exact time format which I need [min : sec . milisec] or for example [00:01.134] but when I read time of lyrics event I get different format [hours : min : sec : milisec] how change this output format of Console.Write `var midiFile = MidiFile.Read(SONG);
// THIS metricTime on terminal sent time WRONG format I need [hours : min : sec : milisec] or for example [00:1:02:124] tempoMap = midiFile.GetTempoMap();
// THIS timeSpan on terminal sent time format I need for example [01:01.124]` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry for bother I solved problem with moving ` Console.WriteLine($"{z} timed events found.");
|
Beta Was this translation helpful? Give feedback.
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}");
}