I am making a Midi viewing application and am wondering how to handle
the possibility of multiple timeSignature events within a bar. My
understanding is that a measure can only have a single timeSignature,
but of course within a midi file timeSignature events could happen
anywhere, so it would be quite possible to have several timeSignature
events within the one measure.
Of course the measures here have to be reconstructed from the timing
info so it is semi artificial but the following example will show what I
ppqn = 100
no time signature at the beginning so assume 4/4
therefore each measure is 100 * 4 'wide'
What happens though if a 3/4 timeSignature event occurs at say 390 -
just before the end of the first measure?
My inclination is to use the first time signature event that occurs
within a measure and ignore the rest. So in the above example if the
timeSignature arrived at 600 - halfway into the second measure - then
that second measure would be converted to 3/4 time and would be only 300
units long. I would make it that the second measure could be 'converted'
to another time by any timeSig event that occured upto 799.
Is this a resonable way to go about it? The only problem is that two
sequencers that Ive looked at dont appear to handle it this way! They
both handle it the same but I just cant figure it out.
Any suggestions would be very helpful,