Any C programmers wanna help convert code to convert between MIDI + CSV?
#42
MID2ASC seems to be adding extra linefeeds.  Note below the lines which contain only " &00" or " &0c".
This example is from the MID2ASC output of Frank Zappa's "King Kong Itself", downloaded from the FreeMidi.org link you posted:
Code: (Select All)
BA    1  CR        0  TR  0  CH  1  ST &B0 &65
&00
BA    1  CR        0  TR  0  CH  1  ST &B0 &64
&00
BA    1  CR        0  TR  0  CH  1  ST &B0 &06
&0C
I took a quick look through the MID2ASC source code, but it is a compacted, uncommented mess.  Someone may have to step through it with a debugger to see where those linefeeds are being emitted.


ASC2MID doesn't seem to like those linefeeds.  If I remove the extra linefeeds and merge lines to look like this:
Code: (Select All)
BA    1  CR        0  TR  0  CH  1  ST &B0 &65 &00
BA    1  CR        0  TR  0  CH  1  ST &B0 &64 &00
BA    1  CR        0  TR  0  CH  1  ST &B0 &06 &0C
then ASC2MID will quietly produce a MIDI file from the ASCII file.
The MIDI file does not seem to be properly formed, though.  FFPlay complains and doesn't even try to play anything.  I do not currently have VLC set up, nor do I have any other means of listening to MIDI files.

I've compiled the programs with MinGW, Digital Mars, Open Watcom, Orange C, and Tiny C, all under Windows and all with no improvement.

The author's website (http://www.archduke.org/midi/index.html) mentions an unrelated program which was compiled & tested under Linux/Unix, so maybe these programs would work better under Linux?
Unfortunately, I am not currently set up to try compiling and testing under Linux.

Maybe it could work under Cygwin.  I tried compilation using my old, homebrew "portable" Cygwin setup, but GCC crashed badly, so no luck there.  (Well, my version of Cygwin is old.  I think I built it back in the WinXP days and don't think I've used it since.)

Anyway, this is all I can add ATM.   Undecided
Reply


Messages In This Thread
RE: Any C programmers wanna help convert code to convert between MIDI + CSV? - by JRace - 09-01-2022, 03:15 AM



Users browsing this thread: 45 Guest(s)