fbpx


The MIDI Forum

  Wednesday, 16 June 2021
  20 Replies
  1.5K Visits
0
Votes
Undo
  Subscribe
Is there a piece of software that will verify the validity of the data in a MIDI file (in Windows)?

I'm am working towards finishing up my midi file instrument editor, and one of the complications is adding in program changes, bank selects, and SYSEX resets that did not exist in the original un-edited file. This involves updating track lengths and positioning data for lots of stuff in the editor. I am looking for any easy way to validate that my new track lengths are correct, as well as the general integrity of the file. It's not too difficult to manually look it over with a few small test files, but once I start messing with actual full length/complicated files, the ability to tell just by looking becomes too difficult.

Basically, I need a way to see if there is anything wrong with my modified files. (Currently, I modify, save, and reload to see if the reloaded file has the same banks/instruments/ instrument count as prior to saving, and play it to see if there are any obvious goof-ups).
more than a month ago
·
#9368
Accepted Answer
0
Votes
Undo
Try this: https://github.com/jazz-soft/test-midi-files
It reports some problems that it finds in the MIDI files (but probably not all)
And I'm here if you need any help with that tool :)
more than a month ago
·
#9710
0
Votes
Undo
Thanks! I'll check it out in the next few days. I assume it will work just as well as before ;)
more than a month ago
·
#9708
0
Votes
Undo
Please check out the latest version, it has two options now:
'print' -- print without the offset
'inspect' -- print with the offset
more than a month ago
·
#9628
0
Votes
Undo
I was able to recover the previous "no byte offset" version from a restore point, so I have them both now. But an option would be great :D

That was a smart solution :)
There is another script at https://github.com/jazz-soft/JZZ-midi-SMF that can print MIDI file without the offsets: `node test.js yourfile.mid`
more than a month ago
·
#9627
0
Votes
Undo
I was able to recover the previous "no byte offset" version from a restore point, so I have them both now. But an option would be great :D
more than a month ago
·
#9626
0
Votes
Undo
So in that screenshot, you can see the test-midi-files output for the original file on the left, and my modified file on the right. If there are new lines in the text file, it colors them green. It also marks differences in similar lines around it.

So in that screenshot, I should have had a Bank Select MSB and Bank Select LSB in both of the green areas. But my positioning was off with some of my code, so the results came out unexpected for the first one (Bank MSB, Undefined, General Purpose Controller)

Unfortunately, with the byte offset added in to the text files now, it's much harder for the plugin to track these differences, and I copied over the previous install of test-midi-files, so I no longer have it :p So having it as an option instead of always on (maybe an option to disable it but leave it on by default, like --nobyteoffset) would help if I need to do future comparisons.
more than a month ago
·
#9625
0
Votes
Undo
It is Notepad++. It has a "compare" plugin that will find the differences between two text files.

I use the print option of test-midi-files and save the output in to a text file.

I do it for the original midi file, and my modified midi file.

Then I run them through the compare plugin, and it shows me where there are differences between the two files. That's how I was able to sort out that my inserts were going wrong sometimes, or that it works correctly. (Plus the warnings at the top of the files when test-midi-files detects a problem)
more than a month ago
·
#9623
0
Votes
Undo
Is it a plugin you use in Notepad++ to show midi files?
more than a month ago
·
#9621
0
Votes
Undo
Haha, oh no, any chance you can make it optional, with a command line flag?

Now the compare plugin in Notepad++ chokes because every line is different after I do an update. :P

It can tell if new lines have been added (or removed) if the ones around it are the same, but with the byte offset, now every line after the first insert is different.

Other than that the update works great though. Thanks.
more than a month ago
·
#9618
0
Votes
Undo
Fantastic! Thank you so much! I can't tell you how helpful your program has been the past few weeks in helping me with mine. I have 101 text files from at least 101 different tests, plus some I already got rid of, that have helped me sort out my track length changing code, and my bank change msb, lsb, and program change insertion code. Now my program is at least 90% guaranteed not to corrupt a saved MIDI file ;)
more than a month ago
·
#9612
0
Votes
Undo
Please check the latest version from https://github.com/jazz-soft/test-midi-files
Made it especially for you :)


C:\JZZ\test-midi-files>node . test.mid print
[ 0] SMF:
[ 8] type: 0
[ 10] tracks: 1
[ 12] ppqn: 96
[ 14] MTrk:
[ 23] 0: ff03 -- Sequence Name: C Major Scale Test
[ 45] 96: ff01 -- Text: Now you must hear C5!
[ 71] 96: 90 3c 7f -- Note On
[ 75] 192: 80 3c 40 -- Note Off
[ 79] 192: ff01 -- Text: Now you must hear D5!
[105] 192: 90 3e 7f -- Note On
[109] 288: 80 3e 40 -- Note Off
[113] 288: ff01 -- Text: Now you must hear E5!
[139] 288: 90 40 7f -- Note On
[143] 384: 80 40 40 -- Note Off
[147] 384: ff01 -- Text: Now you must hear F5!
[173] 384: 90 41 7f -- Note On
[177] 480: 80 41 40 -- Note Off
[181] 480: ff01 -- Text: Now you must hear G5!
[207] 480: 90 43 7f -- Note On
[211] 576: 80 43 40 -- Note Off
[215] 576: ff01 -- Text: Now you must hear A5!
[241] 576: 90 45 7f -- Note On
[245] 672: 80 45 40 -- Note Off
[249] 672: ff01 -- Text: Now you must hear B5!
[275] 672: 90 47 7f -- Note On
[279] 768: 80 47 40 -- Note Off
[283] 768: ff01 -- Text: Now you must hear C6!
[309] 768: 90 48 7f -- Note On
[313] 864: 80 48 40 -- Note Off
[317] 864: ff01 -- Text: Thank you!
[331] 864: ff2f -- End of Track
more than a month ago
·
#9594
0
Votes
Undo
I was able to figure out how to search for those spots (had to mentally add in the delta times to my search) and I have been able to track down and correct my issue. No rush on that update ;)

I plan on eventually making a test file collection with different banks that you can add to YOUR test files collection, modifying the "all instrument sounds" and "all percussion sounds" files to have a different bank select in each. I already tried it out with bank select msb 1 in the all instrument sounds and it works perfect.
more than a month ago
·
#9589
0
Votes
Undo
Cannot promise it fast, but will see what I can do...
more than a month ago
·
#9585
0
Votes
Undo
Any chance you can add byte offset display to all lines of the output for test-midi-files? Maybe an option to do it? I am trying to track down where exactly in my file my byte-writing has gone wrong, and have to use a hex editor to do so. I see I have this problem (see attached screenshot)

I've inserted a bank select msb and lsb (and possibly program changes) throughout the file, but something has gone wrong at this spot, and I am unable to find those particular bytes doing a search in the modified file. A byte offset display in the test-mifi-files output would be SUPER helpful. ;)

IBrokeIt.jpg
Jason selected the reply #9368 as the answer for this post — 3 months ago
more than a month ago
·
#9422
0
Votes
Undo
It is working well for what I am currently testing, when combined with the "compare" add-on in Notepad++ and my hex editor. It helped me correct my MSB/LSB insertion code (originally had too few in relation to the amount of program changes), and helped me correct my updating of track lengths when inserting bank selects (and soon to be program changes). Thanks!
more than a month ago
·
#9389
0
Votes
Undo
Left side shows the time, i.e. the sum of all previous time offsets.
Byte offset is shown only in the warning/error messages.
more than a month ago
·
#9388
0
Votes
Undo
I have Windows 7, Node.js does not like Windows 7. I was able to force install it, but it does not run unless I manually set a version skip environment variable, and then manually specify the path to both node and test-midi-files.

I created a batch file so I can drag files on to it:

set NODE_SKIP_PLATFORM_CHECK=1
"C:\Program Files\node-v14.17.1-win-x64\node" "C:\Program Files\node-v14.17.1-win-x64\test-midi-files-main\index.js" %1 print > %1.txt
pause


This seems to be working.

I already see that in my first few files I was testing, it shows invalid track lengths, and I tried a few others that showed other warnings. I like the full list of events.

Is the number listed on the left side of the output the time offset, or the byte offset? If it is time offset, is it possible to also display byte offset?
more than a month ago
·
#9380
0
Votes
Undo
It's a Node.js application, it runs pretty much on everything.
1) Install Node.js (unless you already have it)
2) Clone the GIT repo ( git clone https://github.com/jazz-soft/test-midi-files.git )
I believe every developer uses git nowadays, but if you don't, just go to the GitHub page, click the green '‚≠≥Code' button and download the zip file.
3) Read a README.md
4) go to the downloaded directory and run 'npm install'
5) run 'node . your-midi-file.mid print'
more than a month ago
·
#9369
0
Votes
Undo
I was aware of it from some of the other posts. Does it run in Windows? And if so, is there a pre-compiled version? GitHub is the bane of my existence :p
more than a month ago
·
#9368
Accepted Answer
0
Votes
Undo
Try this: https://github.com/jazz-soft/test-midi-files
It reports some problems that it finds in the MIDI files (but probably not all)
And I'm here if you need any help with that tool :)
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!