Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8704391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:05:41+00:00 2026-06-13T03:05:41+00:00

I’m trying to read a midi file in C++ and I’m stuck with an

  • 0

I’m trying to read a midi file in C++ and I’m stuck with an error which seems to be an event not defined in the standard midi spec (retrieved from many sites including this: http://www.sonicspot.com/guide/midifiles.html)

I opened the midi in a HEX editor and pinpointed the error. It happens before the very first “note on” event. The file was generated using Sibelius 6 software and I was wondering that if I post the file section here someone would help me come around this.

This is the beginning of the 3rd track:

4D 54 72 6B (MTrk magic number)
00 00 1F F5 (track size in bytes - 8181)
00 FF 03 04 (4 bytes follows) (track sequence name)
00 FF 04 0B (11 bytes follows) (instrument name)
00 C0 34 (program change event)
00 B0 79 00 (controller event)
00 5B <- (what the heck is that?!)

It can’t be delta ticks since the first value is 00 (no MSB set to 1), it’s not a recognizable event either. 10 bytes later I recognize a “note on” event
It goes:

00 5B 30 00 40 00 00 07 64 00 0A 10 00 90 3E 47 <- note on

I have no idea what those 12 bytes before “note on” represent and therefore cannot read the file. I know that the very first note is quite long maybe that’s the reason. I also noticed I couldn’t find a event to represent “bar” pauses. Maybe that’s the code for a bar + length? Should I read those as ticks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:05:43+00:00Added an answer on June 13, 2026 at 3:05 am

    One complexity of MIDI files is Running Status. If there’s sequence of messages of the same type and channel (eg all controllers or all notes) then MIDI can save a number of bytes by omitting the status byte. If this didn’t use running status then the bytes you would see are:

    00 B0 79 00 - controller 121: controller reset
    00 B0 5B 00 - controller 91: reverb
    00 B0 40 00 - controller 64: sustain
    00 B0 07 64 - controller 7: volume
    00 B0 0A 10 - controller 10: pan
    00 90 3E 47 - note message
    

    Because all the controller messages are contiguous and are for the same channel, the status byte can be omitted. As soon as there’s a change of message type, the status byte has to be added again.

    If you’re trying to make sense of MIDI files then I would recommend using a separate tool such as Python-MIDI or GNMidi as a sanity checker whenever there’s a MIDI event you can’t make sense of. These can show it as text so you can mimic what it’s doing.

    EDIT: Another gotcha to be aware of is that any MIDI messages that take a length or duration parameter (eg the time in PPQN between events in a MIDI file, or the length of sysex messages or meta events) uses a variable length, so don’t assume all the length fields are always a fixed length.

    Disclaimer: I wrote the MIDI export code in Sibelius 6…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I am trying to render a haml file in a javascript response like so:
I'm trying to select an H1 element which is the second-child in its group
I'm parsing an XML file, the creators of it stuck in a bunch social
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.