Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / MIDIREXX in halftime

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. MIDIREXX in halftime
#5940
Posted by: longfellow 2005-03-06 02:59:25
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.
Message2. 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 • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-10-5  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0