[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference napalm::commusic_v1

Title:* * Computer Music, MIDI, and Related Topics * *
Notice:Conference has been write-locked. Use new version.
Moderator:DYPSS1::SCHAFER
Created:Thu Feb 20 1986
Last Modified:Mon Aug 29 1994
Last Successful Update:Fri Jun 06 1997
Number of topics:2852
Total number of notes:33157

2681.0. "MIDI Standard File Format generation problems" by PIANST::JANZEN (Tom 223-5140 MLO23-1) Thu Jul 18 1991 15:17

	Hi.
	I am trying to write software to write standard MIDI files
	(convert IFF/SMUS [interchange file format/simple music] to SMF
	[standard MIDI file format]).
	I have done pretty well.  I can't find any more errors.
	Nevertheless, Dr. T's KCS 3.0 and Dr. T Copyist Apprentice can't
	load the output of my program unless I have it write only the
	first track, or a tempo track and the first music track.  If I
	try to load a file with all the tracks in it, I get no error message
	from KCS, but it loads a delay in one track and nothing else
	(maybe the track name).  If I load in just the first track or the
	tempo track and first music track, it loads fine and is correct and
	plays.  Apprentice justy hangs forever on the full file; I havn't
	tried the one-track file on Apprentice.
  
	I have been manually reading and re-reading the MIDI file spec,
	my file dumped in hex, and the KCS manuals.  Now I am reduced to
	studying hex dumps of the files uploaded in MIDI lib (there are only
	2 sequences in there).  They look like mine.
	To cover the obvious:
	1.  I set the numbers of tracks correctly
	2.  I set the file type to 1, correctly
	3.  The tempo numbers are now in the correct byte order
	4.  There are delays (at least a zero) for every every event.
	5.  My track lengths are correct
	6.  The tempo track has all the timing information, and 
		the other tracks have NO timing information
	7.  I removed all meta events except timing events
	8.  I never have two delays in a row. (I insert a "NULL" text event
		between two delay quantities).
	9.  
	Questions:
	1.  Do the tracks' total delay have to be exactly the same?
	2.  What else is there?
	3.  Track names have to be at time zero in the track, but 
	mine is at time one (to be fixed) and it gets loaded OK when I
	load only one track or just the tempo track and one music track.
	could this be it?  I have no idea how my program logic set the
	delay to 1; I'll use the debugger.
	
	The obvious thing is to keep trying to match up my output and
	Dr T's output.
	Incidentally, I'm disappointed that Dr. T's throws away all my
	meta event texts except track name, and key signature, and channel
	meta event, when it brings in my one-track file.  how disgusting.


	
	Thanks
	Tom
T.RTitleUserPersonal
Name
DateLines
2681.1helpPIANST::JANZENTom 223-5140 MLO23-1Fri Jul 19 1991 13:563
	can anyone please try loading my MIDI files and let me know the
	error messages?  Does Bars and Pipes have better error messages?
	Tom
2681.2I'll try...TLE::ALIVE::ASHFORTHLord, make me an instrument of thy peaceFri Jul 19 1991 14:107
Tom- upload them (if you haven't already) and I'll try them in B&P Pro.
Depending on what it says, maybe I'll also doublecheck the SMF spec and scratch
my head (in tempo with yours, of course).

I'm out next week, but I'll try to post something over the weekend.

Bob
2681.3I'll try giving 'em a look-CMAJTOM::ROBERTFri Jul 19 1991 15:2410
  It just so happens that in the past week I've taken it upon myself to
  write some programs that deal with standard MIDI files.  I'm doing somewhat
  the reverse though, I'm taking SMF from the Mac and the PC and doing stuff
  with them on the DECstation 5000.

  I could try loading your files into Cakewalk on the PC and Performer on
  the Mac, as well as see how my custom programs deal with it.

-TR
2681.4SALSA::MOELLERWelcome to - 'BAD METAPHORS'!Fri Jul 19 1991 16:445
    I don't know where you guys find the money for all this MIDI junk...
    
    ;-)
    
    karl
2681.5Bug found. Film at elevenPIANST::JANZENTom 223-5140 MLO23-1Mon Jul 22 1991 11:4619
	Mr. Ashforth kindly tried to load one of my MIDI files and reported
	similar filaures, only the first track would load.  I concluded I
	was mishandling things that tell the software where tracks are.
	By closely inspecting hex dumps of the files and parsing them
	manually, I found an extra zero delay just before the end-of-track.
	With that removed, the file is correct excepting for missing
	running status for additional tracks, which I didn't realize until
	I was falling asleep, so I'll fix it tonight and it will work.
	Then I can convert 7.5 hours of old SMUS scores to MIDI format.
	
	Persons stuck with old Amiga Deluxe Music Contrution Set 
	scores saved with the SMUS save option can contact me for
	conversion.

	The program of course has to be cleaned up, check for no	
	timing info to omit the timing track, and then I'll consider
	making it general for all SMUS files, not just DMCS smus files.

	Tom
2681.6it doesn't grow on treesMAJTOM::ROBERTMon Jul 22 1991 16:3812
re: karl:  MIDI money:  It's a matter of finding OTHER people with $$ to buy
it for you!  Then there's the traditional Rotational Credit Card Craze
(VISA -> MC -> DISCOVER -> VISA -> ETC) and of course selling your first born.


FWIW, I loaded one of Tom's files into Cakewalk, it hung.  It just sat there
blinking "Please Wait..." endlessly.  (Like, HOW LONG do I have to wait?)
Shouldn't there be some more smarts to the SMF interpreter?  If it doesn't
like the file, why doesn't it come back and say so?!

-TR