Multiple TimeSignature Events in a Single Measure

Multiple TimeSignature Events in a Single Measure

Post by Peter Zegeli » Thu, 03 Jul 2003 22:17:23



Hi,
   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
mean:

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,

thanks!

Peter

 
 
 

Multiple TimeSignature Events in a Single Measure

Post by Stephane Richar » Thu, 03 Jul 2003 22:57:13


I might suggest:

When playing the song file or track sequence, you simply need to adapt your
timing engine live.  your timing mechanism monitors what is to happen and
when, this should give you all the info you need no?

001:01:001 TIMESIG=4/4
...
001:01:360 TIMESIG=3/4

it all depends on your PPQN resolution  if it's 480 then whatever occurs in
between each tick is what must be considered.  So if you have 3 time
signatures within a tick, chances are you made 2 mistakes and corrected it
in the last time signature event.

When the player receives a time signature event (whether within a single bar
or not, you still need to do the same thing, and that is change your number
of intervals to the nominator of the time signature.  the rest of the
playing of sogn should simply adjust itself accordingly.
--
Stphane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs

Quote:> Hi,
>    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
> mean:

> 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,

> thanks!

> Peter


 
 
 

Multiple TimeSignature Events in a Single Measure

Post by Murray Rober » Thu, 03 Jul 2003 18:43:21


On Wed, 02 Jul 2003 23:17:23 +1000, Peter Zegelin


>Hi,
>   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
>mean:

>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,

>thanks!

>Peter

No sequencer will allow this because a measure must be allowed to run
its course otherwise your 4/4 will not be 4/4 but some other hybrid
26/32 or 5/16 or something.

I'd suggest you insert a note at the point where you want your time
change within that 4/4 measure and adjust your 4/4 measure (at the
start of measure) till that note is at a new barline. You could very
well end up with a hybrid timing...... but this is midi.

Can you have adjust to higher resolution of ppqn, it may help.

Mur

 
 
 

Multiple TimeSignature Events in a Single Measure

Post by Laurence Payn » Fri, 04 Jul 2003 18:26:02


Quote:>   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
>mean:

Can you construct a midi file with this included and see how it's
treated by whatever commercial sequencers you have available?  Or make
it available on a web page and point us to it?  Would be interesting
to see how Cubase etc. deal with it - whether they throw away one of
the timesig events or just treat it as a corrupt file.

CubaseFAQ page www.laurencepayne.co.uk/CubaseFAQ.htm

 
 
 

Multiple TimeSignature Events in a Single Measure

Post by Günter Nagle » Fri, 04 Jul 2003 20:30:54


It is easy to destroy correct bar info of a midi file by adding or
deleting pauses at wrong positions or wrong length.
For midi playing this isn't important, for score editing or printing the
wrong bar info produces problems. The software should handle this as
good as possible e.g. ignore bar info totally and assume 4/4. It would
be too bad if a software doesn't accept files that contain minor bugs.

It is clear that the problem is inside the MIDI file and there exists no
correct handling of this authoring problem. The software should warn
about the wrong info in the midi file and ignore the wrong bar positions
(but not loose the notes of these bars).

Or try demos of existing products and see how they handle midi files
with wrong bar positions.


> >Peter Zegelin
> >I am making a Midi viewing application and am wondering how to handle
> >the possibility of multiple timeSignature events within a bar.
> >What happens though if a 3/4 timeSignature event occurs at say 390 -
> >just before the end of the first measure?

> What happens is that the customer who purchased the software should write the
> manufacturer and say "Your software has a bug in it. Please fix it". Better
> yet, he should avail himself of other software.

 
 
 

Multiple TimeSignature Events in a Single Measure

Post by Peter Zegeli » Sat, 05 Jul 2003 07:43:16




> It is easy to destroy correct bar info of a midi file by adding or
> deleting pauses at wrong positions or wrong length.
> For midi playing this isn't important, for score editing or printing the
> wrong bar info produces problems. The software should handle this as
> good as possible e.g. ignore bar info totally and assume 4/4. It would
> be too bad if a software doesn't accept files that contain minor bugs.

> It is clear that the problem is inside the MIDI file and there exists no
> correct handling of this authoring problem. The software should warn
> about the wrong info in the midi file and ignore the wrong bar positions
> (but not loose the notes of these bars).

> Or try demos of existing products and see how they handle midi files
> with wrong bar positions.


> > >Peter Zegelin
> > >I am making a Midi viewing application and am wondering how to handle
> > >the possibility of multiple timeSignature events within a bar.
> > >What happens though if a 3/4 timeSignature event occurs at say 390 -
> > >just before the end of the first measure?

> > What happens is that the customer who purchased the software should write
> > the
> > manufacturer and say "Your software has a bug in it. Please fix it". Better
> > yet, he should avail himself of other software.

Thanks Gunter and Jeff!
   Its good to confirm what I suspected as I'm neither a musician or
expert on the midi format. I will have to think of a good way to handle
this although my original way (ignoring 'extra' timing events in a
measure) is probably as good as any and easy to program correctly.

   Fortunately I've never actually come across this (I think!) in a real
file. I was writing a timing test file with some other software and soon
found that it was quite possible to enter several timing events within
the same bar, with strange results. What threw me was that another piece
of software displayed this file the same way, so I thought I must have
missed some inside knowledge on how to handle the situation.

   My software works fine even with this bad info so I will just display
a warning and continue if I find this in a file. My software will only
be able to view at first but I am hoping to add editing capabilities
later on and will definitely endeavor to avoid (or at least warn about)
this situation.

thanks again,

Peter