midicomp icon indicating copy to clipboard operation
midicomp copied to clipboard

Problems converting to format 0?

Open hadess opened this issue 6 years ago • 3 comments

I want to preface this by saying I know nothing of the SMF/MIDI format (formats?). The end goal is to be able to play d_e1m1.mid from http://www.theparticle.com/midi/doommidi.html on a device that only supports SMF format 0.

I used the current git master on a Linux system, and used timidity++ for playback testing locally.

This is what I tried:

$ ./midicomp d_e1m1-orig.mid > d_e1m1.asc
$ cp d_e1m1.asc d_e1m1.asc.orig
$ vi d_e1m1.asc
[make changes]
$ diff -up d_e1m1.asc.orig d_e1m1.asc
--- d_e1m1.asc.orig	2019-03-18 03:53:15.200143986 +0100
+++ d_e1m1.asc	2019-03-18 03:53:22.893528897 +0100
@@ -1,4 +1,4 @@
-MFile 1 5 89
+MFile 0 5 89
 MTrk
 0 Meta Copyright "QMUS2MID (C) S.BACQUET"
 0 KeySig 0 major
$ 

The resulting file seems broken, and will play no sound and stop after 3 seconds. Would I need to do anything else? Are there inherent incompatibilities between the formats? If so, could midicomp warn about using features that would not work in the defined format when compiling?

Here are the test files and the intermediary files, to compare with your build, just in case: midicomp-test.zip

hadess avatar Mar 18 '19 03:03 hadess

The problem is that the tracks also need to be merged, and I couldn't find an easy way to do this with midicomp itself, it might not even be its job. It would be useful if midicomp warned about the multiple tracks which aren't compatible with format 0.

This stackexchange question has some information on how to convert the formats though: https://music.stackexchange.com/questions/39040/how-can-i-convert-a-standard-midi-file-from-type-1-to-type-0

hadess avatar Jun 24 '19 21:06 hadess

Sorry about being MIA for a few months. Unfortunately I haven't been involved with MIDI for years but I'd like to think a smart filter script could do it but it's beyond my skills to test. If it's just a one-off MIDI 1 file you want to convert to MIDI 0 then apparently qtractor might do it...

https://www.linuxmusicians.com/viewtopic.php?t=11428#p44441

markc avatar Jun 25 '19 02:06 markc

No worries. I'm just happy I managed to find a way to achieve what I needed, so I can finally test my Roland MT-80s with tracks that I know :)

hadess avatar Jun 25 '19 09:06 hadess