| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. MIDIREXX in halftime #5940 | Hi,
I've been using Reginald and the MIDIRexx libraries to write a series of humanising/performance modeling routines for myself. (BTW, this is my first time working in REXX, and I'm liking it a lot.) I've run into a bit of a glitch when processing MIDI files which are in time signatures based on the half note, i.e., 2/2, 3/2, 4/2 etc. (All other time signatures are processed with no problems.)
To illustrate:
Here's a simple four note MIDI file:
2:01:000 D 5 100 3:000 2:02:120 C 5 100 60 2:02:180 Bb4 100 60 3:01:000 A 4 100 4:000 (We're in 2/2 time; 100 BPM with a timebase of 120 PPQ.)
Now run this bit of code on the above (this simply advances the note onset by two ticks):
tracknum = MIDITrack('\') if tracknum \= 0 then do do while MIDIGetEvent('On Note') == "" MIDIEvent.!Clock = MIDIEvent.!Clock+2 call MIDISetEvent('TIME') end end This will work fine on notes 1 and 4, but notes 2 and 3 will generate the error "Clock cannot be larger than timebase!" Ok, I get this: notes 2 and 3 have a position which is greater than (or equal to) the timebase, and MIDIREXX doesn't like this. But in 2/2 time, there is *always* the possibility of notes at positions greater than the timebase!
So my question is: Why is this ? And is there a work around for it?
Right now, I'm simply changing any base 2 time signatures into base 4 (e.g., 2/2 to 4/4); then changing back (4/4 to 2/2) after processing. But is there a more elegant way to handle this? How do sequencers manage this?
Thanks. | 2. Re: MIDIREXX in halftime #5945 Posted by: misi01 2005-03-11 16:21:01 | Fascinating - I HAVEN'T a clue what you're talking about !-). (Don't bother to explain, it'll be like teaching calculus to a monkey) Michael | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|