help decoding a midi file

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
dax trajero
Posts: 9
Joined: Sat Dec 31, 2011 3:50 pm
Operating System: Please select

help decoding a midi file

Post by dax trajero » Mon May 26, 2014 10:29 am

Hi Guys

For the first time, I'm trying to decode a simple .MIDI file, using a Hex Editor and am a little confused with the track data? Hoping someone with a bit of experience can help me?

Here's the start of the .MIDI file, The Blue Danube:

Image

So, I'm trying to decode the first track's data and see this:

4D 54 72 6B MTrk
00 00 00 1A Length
00 FF 58 04 Track Data
04 02 18 08
00 FF 59 02
00 00 00 FF
58 04 03 02
18 08
01 FF 2F 00 Track Out

So assuming I'm correct where the track data begins I see these four bytes 00 FF 58 04

00 delta-time/ticks
FF event
58 pitch
04 volume

The problem I have is, in the guide I'm reading there's no FF event as I mention above? Can someone explain?
Secondly, why is there 2 bytes, 18 08, instead of 4 bytes (located just before the 4 Track Out bytes)

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: help decoding a midi file

Post by steve » Mon May 26, 2014 1:23 pm

"FF" may be a "reset" event.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply