Page 1 of 1

A doubt about midi files

PostPosted: Thu Jul 09, 2020 12:20 am
by mark_c
Hello,
but, isn't it strange that to play a "type 1" midi file you have to do all this work?
1) calculate abs-time of each track
2) reorder the events by abs-time
3) recalculate the delta times in respect of the original time

invented example not working:

ch, note, velocity, delta-time, abs-time
track1
90,3c, 100,50,50
90,4c, 100,50,100
80,3c, 100,50,150
track2
90,3c, 100,30,30
90,4c, 100,30,60
80,3c, 100,30,90

sort
90,3c, 100,30,30
90,3c, 100,50,50
90,4c, 100,30,60
80,3c, 100,30,90
90,4c, 100,50,100
80,3c, 100,50,150

now the delta times must be recalculated according to the total original time

Re: A doubt about midi files

PostPosted: Sat Jul 11, 2020 6:12 pm
by HsiaLin
I know nothing about midi but you might find this interesting.