Instantiating bar lines?? #202
-
|
Hi, Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
melanchall
Jul 4, 2022
Replies: 1 comment 3 replies
-
|
Hi, Can you please clarify what you exactly need? You want to get times in milliseconds (or in another format) of all bar lines in a MIDI file? Use this code please: var barBeatTicksDuration = midiFile.GetDuration<BarBeatTicksTimeSpan>();
var bars = barBeatTicksDuration.Bars;
var tempoMap = midiFile.GetTempoMap();
var barLinesMilliseconds = Enumerable
.Range(0, (int)bars + 1)
.Select(bar => TimeConverter
.ConvertTo<MetricTimeSpan>(new BarBeatTicksTimeSpan(bar), tempoMap)
.TotalMilliseconds)
.ToArray(); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
cad12345
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Can you please clarify what you exactly need? You want to get times in milliseconds (or in another format) of all bar lines in a MIDI file?
Use this code please: