Problem With VB Code For Parsing MIDI Files

Discussion in 'Sequencing Software' started by LordAshes, Feb 27, 2011.

  1. LordAshes

    LordAshes New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I am trying to write a VB program that will parse MIDI files and eventually modify them.

    The problem that I am running into is that in some cases I don't seem to be parsing the event correctly because the following event is either all 0 (i.e. EventType=0, MidiChannel=0, Param1=0, Param2=0) or I get entries that don't correspond to valid Events.

    When the problem occurs, it always seems to be following a Track Name Meta event (i.e. Meta Event 3) but in some cases it seems that the Meta Event is processed correctly. However, this may just be a coincidence (i.e. maybe the problem can occur after other events too).

    The following is a link to the VB6 form file. The form does not contain any objects...just the code for parsing the MIDI file.

    http://www.mediafire.com/?a9opj9zzdv2ag9k

    I have also attached the code as a Txt file.

    If anyone can spot the error in my code (or processing logic) please let me know so that I can correct it.

    Attached Files:

Share This Page