Convert MIDI Type 0 file to .txt file


    Jul 30 2019 | 7:37 pm
    I've been trying to wrap my head around a solution for converting a midi file type 0 file to a text file in the following format.
    "song.mid"---->"song.txt" See example .txt file:
    For each note on, I'll need the pitch number followed by a semicolon.
    For multiple note ons, (polyphony) the pitch numbers should be grouped on the same line.
    I don't need velocity, ticks, channel numbers or timing data, just note-ons.
    The purpose is to create a text file that can be read and played back via drum triggers-so timing will be dictated by "human" rhythmic hits on a drum. (It should be a .txt file due to certain limitations)
    I've tried the seq object with midparse but the major issue i'm experiencing is how to parse the data into a this specific simple stripped down readable text format.
    I'd prefer not to go to 3rd party solutions. (On a Mac)
    Would be great to hear your thoughts, feedback, solutions.
    Sincerely,
    Simon

    • Jul 30 2019 | 8:09 pm
      [detonate] is perfect for this. use its text export, then check how to convert the textfile it produces.
      if you think you dont get it to work using [text] and [sprintf], bbedit.app should also be enough.
    • Jul 31 2019 | 12:45 am
      If You want to keep seq - midiparse way:
      It also depends on the midi file. If it does not contain anything other than notes, converting to text and then trying to parse it, could work, but otherwise one would have to remove all other midi data and so at the end still spend time manually editing the whole thing, removing note offs, trying to group notes for polyphony and so it might be just faster to capture it as in example above.
    • Aug 03 2019 | 8:13 am
      Thanks. The midiparse way seemed to do the trick!