re: odd rhythms - how?

[email protected] ("Jackie McBride") Wed, 14 May 2003 12:47:52 -0700
Newsgroups perl.midi
Message-ID <00ce01c31a51$e2f3af80$6731f842@jackie>
 On Monday, May 12, 2003 8:31 PM, Sean Burke wrote:
>
> "So... so... where's all the fun things people are writing with MIDI-Perl?
> I want to hear!  I promise to say only nice things -- since I am endlessly
> and reliably entertained by whatever kookoo stuff people do with
MIDI-Perl.
>
> Sean, I should like nothing better to amuse you--& I promise, I'll even
> smile if you curse me out for what I do with midiPerl.  However, I am
> finding the documentation uh, well, a bit daunting, to say the very very
> very least.  I need to be able to change the timing of events in a midi
> file, to delete events, to filter events by type & channel, etc.  If
anyone
> could send me off list snippits of their code that does these things to
> kinda show me how it's done, I'd be more than appreciative.  My email is
in
> my signature (the first address would be better).
>
> Also, (& I'm sorry, Mr. Moderator, I know this might be stretching things
a
> bit), does anyone know of a good IDE for PERL that doesn't cost an arm, a
> leg, & both eyes?  I know about komodo, however, I happen to be blind, &
no
> screenreader I've seen to date can detect where the caret is, making it
just
> a *little* difficult to edit with.  So, if anyone has any suggestions
> regarding that, please feel free to contact me offlist as well.
>
> TIA for any help.
> Love like there's no tomorrow!
> Jackie McBride, Qchord distributor & author of qchord manual for visually
> impaired
> website:
> www.tacticus.com/qchord
> email:
> [email protected]
> or
> [email protected]
> ----- Original Message -----
> From: "Sean M. Burke" <[email protected]>
> To: "Noel Lairson" <[email protected]>; <[email protected]>;
> <[email protected]>
> Sent: Monday, May 12, 2003 8:31 PM
> Subject: Re: odd rhythms - how?
>
>
> > At 07:03 PM 2003-05-12 -0700, Noel Lairson wrote:
> > >>I am just trying to write some code to create rhythms like 5:3 or
3:2 -
> > >>so five beats in the same time of three beats or three in the same of
> two.
> > >[...]Tempo(480);
> > >The basic idea is that more tics gives more opportunities fot the math
to
> > >work out even (or make it less obvious when it doesn't).  I use 480
> because
> > >it's the highest Cakewalk can handle, in case I have to dump the file
in
> for
> > >editing).  You can use more but it should generally be a multiple of
> 96.[...]
> >
> > In case anyone missed the logic there, here's more of a hint:  intervals
> in
> > MIDI are expressed in "ticks", an arbitrary unit of time that is a level
> or
> > two removed from being an actual unit of time (like microseconds), via a
> > detour thru two variables:  ticks-per-quarter-note, and
> > quarter-notes-per-second (well, actually it's how many
> > milliseconds-per-quarter-note, but don't think too much about that).
> >
> > So be able to slice a quarter note into N parts, the
> ticks-per-quarter-note
> > has to be a multiple of N -- so if you want to have a third of a quarter
> > note, you'll need ticks-per-quarter-note to be a multiple of three.
> > The normal value is 96, which is 2*2*2*2*2 * 3.  So if you want to have
a
> > 6th of a qn, or an 8th of a qn, or a 24th of a qn, this is fine, because
6
> > is 2*3, and there's a 2 and a 3 in 2*2*2*2*2 * 3; ditto 8 (2*2*2); and
> > ditto 24 (2*2*2 * 3).
> >
> > But if you want a 5th of a quarter-note, you're in trouble, because 96
> > isn't a multiple of 5.  Now, you could just change
ticks-per-quarter-note
> > to 5, and you could express a fifth of a quarter note as being 1 tick
> > long.  But then you wouldn't be able to express an eighth note, because
5
> > isn't evenly divisible by 2.  So to get all the expressive power of
> current
> > note stuff (as determined by the fact it's based on 96), it's safest to
> > just multiply 96 by whatever numbers you'll be wanting to slice on (like
> 5).
> >
> > In a pinch, you could probably just make it a multiple of 48 (2*2*2*2 *
> 3),
> > since the situations where you'd need to have all five 2's in the
> > ticks-per-quarter-note are very rare.  I think it comes up only when
> you're
> > trying to do a double-dotted 64th-note.
> >
> > Of course, this all assumes your notes last exactly as long as a
textbook
> > plain/dotted/doubledotted/triplet whole/half/quarter/8th/16th/32nd/64th
> > note.  MIDI data captured from actual hands-moving-on-an-instrument will
> > likely have no particular relationship to these ideal durations.
> >
> >
> > So... so... where's all the fun things people are writing with
> > MIDI-Perl?  I want to hear!  I promise to say only nice things -- since
I
> > am endlessly and reliably entertained by whatever kookoo stuff people do
> > with MIDI-Perl.
> >
> > --
> > Sean M. Burke    http://search.cpan.org/~sburke/
> >
> >
>