fbpx
Skip to main content

MIDI Forum

Corrupt MIDI file
 
Notifications
Clear all

Corrupt MIDI file

8 Posts
3 Users
0 Reactions
7,649 Views
Duncan
Posts: 4
Active Member
Topic starter
 

Hi folks, I’m wondering if anyone can help diagnose an issue I’m having when saving MIDI files (I’m using bio-sonification app PlantWave). Every so often the saved file appears to contain a single bar containing a cluster chord (I’ve attached a screen shot of a piano roll). Does anyone know what the issue might be? It appears that the rhythmic data (note on/off?) is somehow corrupt/missing?

 
Posted : 18/06/2022 5:10 am
Geoff
Posts: 1041
Noble Member
 

I don't see any attachment. No image.

Do I understand from your message that usually (?) you DO get the sort of midi file you want, but on occasions you do NOT?

It would be more help if you could attach midi files, maybe one that is OK as well as one that is not.

Geoff

 
Posted : 18/06/2022 6:37 am
Duncan
Posts: 4
Active Member
Topic starter
 

Apologies, here's the screen shot...

 
Posted : 18/06/2022 11:49 am
Duncan
Posts: 4
Active Member
Topic starter
 

and the MIDI file zipped....

 
Posted : 18/06/2022 11:52 am
Geoff
Posts: 1041
Noble Member
 

Duncan,

I've had a look at the midi file, as I know where I am with that.

I've got the first file OK (Corrupt.....A.mid), as you're using VERY long file names, I'll need to mess more to get the others.

The file is not corrupt. Perfectly valid midi file. Data is all valid midi, but clearly wierd.

First half of the file is a LOT of Note On events, all at delta time 000. There are no OFF events.

At the end of all the Note On events, these are followed immed in the file by a similar mass of controller events, not a normal controller, one of the specialised device independats ones. These are ALL at the same delta time 512 minutes later, i.e. you'd need to wait 8 hours for anything to happen.

The controller is 'General Purpose Controller #5'. The actual data value varies, as in a slow wave form, but everything is at the same delta tile (491520) that you would not know?

Then there's the end of track/file. Still no Note Offs.

Soundwise, this is total rubbish. But totally valid midi.

I'll try to get at the other files.

Geoff

 
Posted : 18/06/2022 12:42 pm
Bavi_H
Posts: 267
Reputable Member
 

[quotePost id=14874]What sort of data were you expecting?[/quotePost]The PlantWave product lets you connect electrical sensors to a plant, then it generates musical data based on the electrical activity it detects from the plant. I assume the notes and Control Change messages in Duncan's MIDI file were supposed to be spread out at various times, but otherwise they might not be musically sensible, they were just generated from a plant's electrical activity. (See plantwave.com/instructions and plantwave.com/blog/plantwave-works-with-daws-and-synths )

Duncan: If I understand you correctly, it sounds like you are using the PlantWave app (with Plus subscription) to record a MIDI file. Most of your MIDI files are fine, but some only have these "cluster chords" at the beginning. Since the notes in your example MIDI file have a "note start" but don't have a "note end", my guess is the app somehow got confused about the start times and durations of the notes it was intending to export. Perhaps the app can only properly create MIDI files under a certain duration?

Technical details:

As Geoff described, the MIDI file has no technical problems, but the contents of the MIDI file don't seem to be what was intended. The file begins with 185 "note start" events of various pitches. Then 256 measures (or 8 minutes 32 seconds) later, there are 1812 Control Change messages, all for controller number 80, with various values.

According to MIDI standards, each "note start" event is supposed to eventually be followed by a "note end" event for the same pitch and channel. The notes in this MIDI file have a "note start" event, but never have a "note end" event. The file isn't corrupt, but I would hesitate to call it "perfectly valid". I would probably describe them as non-standard note messages. For example, various MIDI player software has different reactions to these non-standard never-ending notes:[list]

  • Cakewalk's piano roll displays the note bars as 256 measures long, in other words, it shows the notes as lasting until the end of the file.
  • Sekaiju's piano roll doesn't display any note bars. The notes still sound, they're just not visible in the piano roll.
  • Synthesia displays note bars about 0.2 seconds long and sounds the notes for about 1 measure.
  • Duncan's screenshot appears to be of GarageBand. The screenshot appears to show the notes as quarter notes.
  • MuseScore's default import settings display the notes as staccato quarter notes. If you uncheck the "Simplify durations" import setting and reapply, then the notes show up as 128th notes.
  • Notation Player displays 256 empty measures and plays no sound.
     
  • Posted : 18/06/2022 5:58 pm
    Duncan
    Posts: 4
    Active Member
    Topic starter
     

    Many thanks for your help Geoff and Bavi_H - it's much appreciated!

    I should clarify that the zip folder should only have one MIDI file as I wasn't able to attach the MIDI file so I compressed this and uploaded it as a ZIP file. As such, I guess the MAC_OS stuff is an artefact from compressing the file?

    When the PlantWave app works, it should export a single stem melody. Annoyingly, one in every three attempts to capture MIDI results in a file similar to what I attached. With that in mind, is there any way of fixing the file? i.e. adding the note off at a set duration (quantizing note lengths I guess?). Can I also check whether rhythmic material is present, or does it simply present all notes as starting at the same time?

    Many thanks!

    Duncan.

     
    Posted : 20/06/2022 2:56 am
    Geoff
    Posts: 1041
    Noble Member
     

    It would be a help to see one of the OK files, i.e. a file that already is how you want it to be.

    From my point of view, there are three things 'wrong' with the file I've got.

    First, all the existing notes start at the same moment. I'd need to know how they might be spaced out.

    Second, there are no Note Off events, so I'd need to provide a suitable Note Off.

    Third, is the controller data relevant. Maybe it's not. If it IS required, need to know how to change that.

    The file could be added to, and resaved more to your liking. As Bavi suggests, different systems would handle the incomplete data differently, so one of the mentioned systems might allow you to do something. I would just write a small prog to manipulate the existing data and 'adjust' or add to it as required, and then regenerate a midi file.

    Geoff

     
    Posted : 20/06/2022 7:49 am
    Share: