[CM] midifile import

Ralf Mattes rm at seid-online.de
Thu Mar 19 07:37:03 PDT 2009


On Thu, 2009-03-19 at 13:22 +0100, Orm Finnendahl wrote:
> Hi Rick,
> 
>  I doublechecked the state of affairs and as far as I can see cm isn't
> doing anything wrong.
> 
> There are two things in the exported file, cm doesn't like (I
> erroneously thought the 2nd was related to the NoteOffs as NoteOns
> with velocity 0):
> 
> 1. The time signature has a length of 2
> 
> 2. There is a midi meta event of unknown type (#x0F)
> 
> The meta event is displayed by Muse as a "comment" and is containing
> ascii characters. I couldn't find any information in the web about
> that meta event type.

Somehow i using comments in midi files, but that was on a distant Mac in
a different life :-) I'd just ignore unknown messages.

>  Neither could I find anything about the validity
> of time signatures of length 2 (the midi file format specs I have
> actually quite clearly state the opposite but that might be outdated).
> 
> The fact that Rosegarden *can* import the file doesn't necessarily
> mean that the file is adhering to the standard. I will wait about
> comments from the Muse developers.

Hey, this _is_ Open Source. Just read it:

       case MIDI_TIME_SIGNATURE:
           numerator = (int) (*midiEvent)->getMetaMessage()[0];
           denominator = 1 << ((int)(*midiEvent)->getMetaMessage()[1]);

           // NB. a MIDI time signature also has
           // metamessage[2] and [3], containing some timing data

           if (numerator == 0)
               numerator = 4;
           if (denominator == 0)
               denominator = 4;


So the Rosegarden programmers just decided to always ignore part of the
time signature message. Tsk.

  
Cheers, RalfD




More information about the Cmdist mailing list