Re: shorten midi file

[email protected] ("C. Church") Fri, 31 Jan 2003 19:11:15 -0600
Newsgroups perl.midi
Message-ID <011a01c2c98e$e3b0d0b0$4701a8c0@eurynome>
> I am curious about this question too -- or actually in the more general
> question of "how do you turn MIDI tick-times into seconds?"

Isn't the (midi) tempo the amount of time per quarter note, in
micro-seconds?  If so, then you can say if tempo is 500,000 microS, then
each QN = .5s (120BPM, in this case), thus you could, to read a minute, read
120 quarter notes (there should be rests filling in the blanks, no?  Err,
ok, I'm thinking live playback...)

I've only used MIDI::Simple, and not to any great degree, but I think you'd
have to take the delta-time into your accounts, as well...

Does MIDI::Event write rests for silence?

> As I was writing MIDI-Perl, I thought I understood how this all worked,
but
> then I learned that there were tempo-change events, and that seemed really
> hard to think about.  Since I writing a parse and not a sequencer, I
> decided that I could just ignore the whole issue.  But I'm still curious
> about it.
> Anyone know how this works?

If you read a tempo change event, I'd assume that you'd just re-calculate
how many quarter notes you need, taking into account that you've already
read x time, subtract x from one minute, then re-calculate based on your new
time + tempo.

!c

C. Church
http://www.digitalKOMA.com/church/
http://www.DroneColony.com/