The MIDI Forum

  1. Mark
  2. MIDI Specifications
  3. Saturday, 02 May 2020
  4.  Subscribe via email
I am writing a midi palyer in C ++ and the part that is obscure is the management of the tracks in order to be able to play them: is someone able to share his knowledge?

Thanks
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
Well, I don't know. The numbers you are now presenting do not make any sense, or they are not what we are assuming they are.

MidiSoft Studio may be presenting other info? But what?

The data you show. Are you copying this data from a screen. Is ALL the data copied, or is there something there that you have calculated/added? Some systems do show the length of the note as well as the delta time. If the system plays the data correctly, then it must have the correct timings, in the correct order, byt the data you show is either NOT correct data, or is in the wrong order (but the actual data regardless of the timings does seem to be in the right order).

I fully understand, if the system you are using is offering suct wierd data, and you are trying to make sense of it to get your own process working, it must be VERY confusing!!

All systems that I've used display the EVENT LIST (which is what that sort of data shown like that would be called) in a standard way. This is usually with the delta time in decimal followed by the note data which can be in either hex or decimal, and some system may show a note length with the Note On event, usually in decimal. Track and Channel date would notmally be there as well, these are not so important for your data. Some of this data is as per the midi file, other data is converted or calculated (added). But nothing should be changed from what's in the midi file.

Could you send me the midi file that the data above comes from? Supposedly??

Geoff
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
the example midi file. Warning, it's a file without a musical sense, I only use it for tests.

hex dump file


4D 54 68 64 00 00 00 06 00 01 00 02 01 80 4D 54 72 6B 00 00 00 23 00 FF 58 04 04 02 60 08 00 FF 7F 03 00 00 41 00 FF 7F 05 00 00 77 0E 00 00 FF 51 03 07 A1 20 00 FF 2F 00 4D 54 72 6B 00 00 00 2B 00 90 3C 64 81 00 80 3C 64 82 00 90 3C 64 82 00 80 3C 64 81 00 90 3C 64 84 00 80 3C 64 82 00 90 3C 64 88 04 80 3C 64 00 FF 2F 00


meaning


4D 54 68 64 00 00 00 06 00 01 00 02 01 80
4D 54 72 6B 00 00 00 23
00 delta time
FF 58 04 04 02 60 08
00 delta time
FF 7F 03 00 00 41
00 delta time
FF 7F 05 00 00 77 0E 00
00 delta time
FF 51 03 07 A1 20 00
FF 2F 00 end of track
4D 54 72 6B 00 00 00 2B
00 delta time
90 3C 64 note ON
81 00 delta time
80 3C 64 note OFF
82 00 delta time
90 3C 64 note ON
82 00 delta time
80 3C 64 note OFF
81 00 delta time
90 3C 64 note ON
84 00 delta time
80 3C 64 note OFF
82 00 delta time
90 3C 64 note ON
88 04 delta time
80 3C 64 note OFF
00 delta time
FF 2F 00 end of track
Attachments (1)
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
Mark,

As far as I can tell, the midi file is fine. Your transfer of the data therein seems OK. When I do a DECODE listing from the midi file, everything is fine (attached).

I'm not aware of any problem with this. Are you still seeing a problem. If it's showing in your process, or in a system you have, maybe there's some problem there?

Geoff
Attachments (1)
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
finally the problem has been solved.
To convert a midi file from type 1 to type 0 you must:
a) calculate the absolute time of each track
b) sort the tracks for absolute time and I, for punctuation, also for note
c) the delta times must be recalculated which must correspond to the original ones before reordering.

I have found a method that is not very effective, but I am working on it.

Thank you so much Geoff for your valuable help
Comment
There are no comments made yet.
  • Page :
  • 1
  • 2
  • 3


There are no replies made for this post yet.
Be one of the first to reply to this post!