Skip to content

Get lyrics time #293

Answered by melanchall
Nelfstor asked this question in Q&A
Mar 14, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi,

( probably "300" - is an event came from another track?)

You didn't provide an algorithm or even code, so I can't answer the question. I'm not a mind reader unfortunately :-)

i'm getting absolute time by adding the deltaTimes

The main goal of the library is to provide easy solutions for common practical tasks. Of course you don't need to sum delta-times. Here a sample code which, I hope, answers your questions.

var tempoMap = midiFile.GetTempoMap();
var lyricTimedEvents = midiFile
    .GetTimedEvents()
    .Where(e => e.Event.EventType == MidiEventType.Lyric);

foreach (var e in lyricTimedEvents)
{
    var metricTime = e.TimeAs<MetricTimeSpan>(tempoMap);
    var lyricText = ((Lyri…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Nelfstor
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