Re: parsing midi file - How to separate running data from next time

Discussion in 'comp.music.midi' started by Günter Nagler, Aug 20, 2003.

  1. Max M wrote:
    >
    > I am writing a parser for midi files.
    >
    > Due to running status you have to take care that there might be more
    > than one set of data after a status byte.
    >
    > But how do you tell the difference between a running data byte and the
    > next varlen time event?


    in a running status you are missing only the status byte (0x80 - 0xEF),
    but the time varlen must be there e.g. can be 0 if no pause till next
    event.
    So you don't need to distinguish between data and time they are occuring
    alternating, starting with time.

    Günter
  2. Max M

    Max M Guest

    G=FCnter Nagler wrote:

    > Max M wrote:


    >>But how do you tell the difference between a running data byte and the
    >>next varlen time event?

    >=20
    >=20
    > in a running status you are missing only the status byte (0x80 - 0xEF),=

    =20
    > but the time varlen must be there e.g. can be 0 if no pause till next
    > event.
    > So you don't need to distinguish between data and time they are occurin=

    g
    > alternating, starting with time.



    Yes you are right. It was a brain meltdown on my part. Forcusing to long =

    on the problem made me unfocused. A short break was needed. It is now=20
    working on all my sample files.

    thanks!

    Max M
  3. Max M

    Max M Guest

    midiprog2000 wrote:

    > Even in case of running status there will be a delta time (varlen time
    > as you called it) in between the two messages. If there is no status
    > byte after the delta time value (the first byte after the delta time
    > value is smaller then &h7F), then running status has to be applied.
    > Therefore, the last status byte you received has to be remembered
    > (stored in a variable).


    Thanks. Yes I found that out. Actually I knew that. I had just been
    coding to long, so my brain was fried.

    I am writing a midi file parser in Python, and it is quite finished now.
    I just need to write the output class, wich is a lot easier than the
    input parser.

    1 more day and it should be finished. So exciting ;-)


    regards Max M

Share This Page