In a private message, Sebastien wrote
> to follow-up on my previous posting ("MTx, PMx and the number of lines"), it
> seems there is something amiss in the compiling process : the MIDI files are
> corrupted when I compile the original source with f2c (aka the Unix source).
He used the DOS/Win version of GNU FORTRAN g77. I downloaded and
installed it, and verified that there is a problem in the MIDI file
produced. I've isolated the problem down to one particular byte but I
don't know how to fix it. On the off chance that there's someone out
there who might delurk from the shadow world of FORTRAN long enough to
help me out, I want to pose this to the list.
In writing bytes to the midi file, I ended up using the following syntax
whenever there was not an ascii character to get the bytes I needed:
write(51,'(a,$)') char(10)
(The "$" suppresses an end-of-record character after the write). I
arrived at this method after lots of hand-wringing (which I do remember)
and trying lots of other ways (which I don't remember most of). This
should write one byte to the binary file, hex "0A". And it does that
just fine with the compiler I normally use in DOS/Win, and also with the
linux version of g77. But when DOS/Win g77 comes to this statement, it
converts char(10) to the 2-byte sequence "0D 0A" . This clearly has
something to do with how it's trying to deal with the difference in
line-ending conventions between DOS and *nix, but for our purpose it
screws up everything.
Does anyone know a different way in FORTRAN to write the byte "0A" to
the midi file?
--Don
PS If you'd like to try this in the pmx code itself, just search the
FORTRAN source for "char(10)" (without the quotes). It only occurs in
one place.
_______________________________________________
TeX-music mailing list
[EMAIL PROTECTED]
http://sunsite.dk/mailman/listinfo/tex-music