Re: MidiKit showing length in Meta-Event
Posted by
madGambol on
URL: https://forum.mixagesoftware.com/MidiKit-showing-length-in-Meta-Event-tp1657p1676.html
You fixed the display of the length bytes: they're not showing any more in the wrong place. So the display of data is "good" for normal small-ish meta-event but with one issue I still have...
The length of the meta-event should be shown --- otherwise it's just invisible. You stop displaying the TEXT when you encounter a 0x0a ('\n') in the data ... also hiding that subsequent text. To really be complete, that length data should be shown, and the clearest, cleanest way to show it is in the data column along with the rest of the data shown there. Or maybe have a "length" column? Without showing ALL the data, it's really not editable.
As for the handling of large files: I generated a series of not-too-large files and Midi-Kit Beta 2 fails -- or rather -- has trouble with the file containing the meta-event 65535 bytes long. The file with 32768 bytes in the meta-event is OK as far as I can see.
The text it shows in the 65535 case is garbled and complains that it's invalid data in the "data" column, and the file with meta-event 65536 bytes doesn't show any text and no data at all, it just show "FF 01" under the "data" column. The "ticks" column value contains the size of the meta-event in bytes, BTW. I filled in that field with the meta-event size.
It's possible that the library I'm using for the midi file write has a bug with files this large, but it handles files UP to 32768 bytes in the meta-event OK. Are you using the algorithm outlined in the MIDI File spec to read the variable length field and not an abbreviation of it? I have code for that which uses iterators and not putc/getc.
All the test files so far are at the following drop-box link:
https://www.dropbox.com/sh/a0tekqnarv1jvss/AAAeaBiQ2-l36xYP8FLrJSn5a?dl=0I really would like to see the size info in the data column.
Nobody else wants that? I can give you my code to write the test files if you're interested. You can generate your own test files!
Thanks,
madGambol