[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference napalm::commusic_v1

Title:* * Computer Music, MIDI, and Related Topics * *
Notice:Conference has been write-locked. Use new version.
Moderator:DYPSS1::SCHAFER
Created:Thu Feb 20 1986
Last Modified:Mon Aug 29 1994
Last Successful Update:Fri Jun 06 1997
Number of topics:2852
Total number of notes:33157

641.0. "Beat Divider Basic Program" by DRUMS::FEHSKENS () Mon Jan 12 1987 13:50

    I have written a BASIC program that figures out how to divide a
    span of fixed clock pulses into arbitrary subdivisions.
    
    Uh, let me say that again.
    
    Suppose you've got a sequencer that has 96 clocks per quarter note.
    Suppose that you want to step sequence septuplets.  Well, 7 doesn't
    go into 96 evenly, so the 7 notes can't all be the same number of
    clocks apart.  What's the best you can do?  2 intervals of 13 and
    5 intervals of 14  (2*13 + 5*14 = 96).  This is a simple arithmetic
    operation, so I wrote a program that generates a table of all
    "interesting" combinations.
    
    Any interest in the program or the table?
    
    I'd just post them, but I left them home.
    
    len.
    
T.RTitleUserPersonal
Name
DateLines
641.1More Divider QuestionsNOVA::RAVANTue Jan 13 1987 13:1714
    I'm interested in a copy of the code.  Some follow-on questions are:
    
    1)	Given the subdivision groupings - for example, two 13's and five
    	14's - how should the groups be ordered?
    
    2)	Is there a 'best' ordering, or at least some metric by which
    	various orderings can be ranked?
    
    3)	If there is a metric, does it vary depending on either vertical
    	or horizontal adjacencies, that is, does it depend on what is
    	happening 'around' the tuplet, either before it or after it
    	in the same voice or other voices?
    
    -jim
641.2Some Handwaving and a Trivial AlgorithmDRUMS::FEHSKENSTue Jan 13 1987 13:4147
    Ah, you ask the hard questions.
    
    No, I do not have any basis for ordering the short intervals vs.
    the long ones.  My guess is that for a sufficiently finely resolved
    clock, most people wouldn't be able to hear the difference anyway.
    There would seem to me to be three "distribution strategies":
    
    	1) put the short ones all at the beginning
    
    	2) put the short ones all at the end
    
    	3) distribute them randomly
    
    It might be worth doing some experiments - I'll program up some
    16th note quintuplets and sextuplets on my MC-500 using all three
    strategies and see what they sound like.
    
    Another guess is that human players might tend to "rush" the beginning
    of such rhythmic figures, and so the most "natural sound" would
    be to put the short ones first.  Alternatively they might start
    slow and then rush at the end to get "caught up".  But remember,
    we're talking about only 1 clock period difference in the intervals,
    and my experience examining real timing values from human players
    (using the MC-500's "microscope mode") is that actual differences
    are typically larger than that.  
    
    I looked at the code last night, and it's almost all Amiga user
    interface stuff that probably doesn't exist in any other Basics,
    so I'll just give you the algorithm, which is really pretty trivial.
    
    Suppose that the duration you want to subdivide is d, and the number
    of subdivisions you want is s.  (In the example I gave earlier,
    d = 96 and s = 7.)
    
    	q = INT(d/s)
    
    	r = d MOD s
    
    Subdivide as (s-r) intervals of length q, and r intervals of q+1. 
    
    You can see that (s-r)*q + r*(q+1) = d.
    
    (I.e., s*q - r*q + r*q + r = s*q + r = d by definition of q and r.)
    
    
    len.
    
641.3Why 96THUNDR::MORSEWed Jan 28 1987 11:3816
    In response to the original note, I got to thinking, "why 96". 
    I guess if you own a hard-wired sequencer and that's what it has,
    then you are stuck.  But I am working on sequencer software, and
    it seems to me that given a choice you would want to pick a number
    with more multiples of primes, like 5 and maybe 7, in exchange (if
    necessary) for fewer multiples of 2.
    
    96 is 3 x 32.  Why not chose 120, which is 5 x 3 x 8?
    
    Or are we so far beyond what the human ear/brain can perceive that
    it doesn't matter?
    
    I am new to this stuff, so would appreciate any insight that those
    of you with experience can give.
    
    John
641.4Just a guess...ECADSR::SHERMANWed Jan 28 1987 12:035
    I note that to represent 96 it takes 7 bits:
      2*2*2*2*2*3 (two bits to represent the 3)
    Perhaps some sequencers use an eight-bit bus and the eighth bit
    is used as a flag of some sort.  Thus, 96 would be the highest number
    that could be easily manipulated that allows for division by 3.
641.5Just A Convenient NumberDRUMS::FEHSKENSWed Jan 28 1987 13:2116
    Most sequencers pick 96 because it readily handles most of the common
    subdivisions of the beat (binary subdivisions are far more common
    than ternary, and quints etc. are relatively rare, particularly
    in pop music).  If Tom were still around, I'm sure he'd blast me for
    espousing such rhythmically arrested opinions, but I'm not the guy
    who made these design decisions.                                    
    
    One of the "clocks per beat" value I ran was 120, and it turns out
    to not fit a whole lot better than 96, expecially if you want to
    get 64ths.  360 looks like a good compromise if you're really obsessive
    about such things.             
    
    I doubt that the choice has anything to do with bus widths.
    
    len.
    
641.6STAR::MALIKKarl MalikWed Jan 28 1987 15:114
    
    	'Performer' (from Mark of the Unicorn) divides the beat into
    840 'ticks'.
					- km    
641.7*I'd* Go With 2*2*2*2*3*3*5 = 720DRUMS::FEHSKENSWed Jan 28 1987 16:2313
    840!  Shazam!  Divisible by just about everything but 9.  I figure
    840 factors to 2*2*2*3*5*7.  That allows 8ths of a beat (32nd notes),
    triplets, quintuplets and septuplets.
    
    I'm now very strongly motivated to do my "what's the smallest timing
    'discrepancy' a listener can hear" experiments.  This whole discussion,
    while theoretically interested, may ultimately prove academic. 
    If listeners can't hear differences this small, and it doesn't look
    as if there's a whole lot of algorithmic simplification or performance
    enhancement to be gained, why bother?
    
    len.
    
641.8The other end of the questionTHUNDR::MORSEWed Jan 28 1987 16:4911
    840 doesn't sound bad (I mean intellectually -- I haven't actually
    *listened* to the result of using it yet).  The number doesn't want
    to be too big, or it will start to impinge on the *longested* duration
    that can be represented.  With unsigned 16-bit integers, the maximum
    duration would be just over 78 quarter notes, or 19 1/2 bars in
    4/4.  I could live with that.
    
    Anyway, thanks for the responses -- you guys really follow this
    forum closely to generate 3 replys in half a day!
    
    John
641.9Another Reason for 720DRUMS::FEHSKENSThu Jan 29 1987 14:436
    The longest held note I've seen is 54 bars of 3/8 in the pedal part
    of the Bach F major Tocatta.  That's 81 quarter notes' worth.  While
    840 clocks per quarter note couldn't handle this, 720 (which in
    16 bits is 91 and a tad quarters) would.  Just.
    
    len.
641.10STAR::MALIKKarl MalikThu Jan 29 1987 15:586
    
    	I'm not disputing anything here - just pointing out how
    Performer handles things.  The 840 division is per beat, whatever
    that may happen to be; thus solving the sort of problem you
    mentioned.
    						- km
641.11Tell Roland Quarter Note Not Synonymous With BeatDRUMS::FEHSKENSThu Jan 29 1987 19:4612
    Ah ha - my silly MC500 divides *quarter notes*, not beats, into
    (in its case) 96 parts.  Tell it you want to do something in 12/8
    and it thinks of that as 6/4.  You have to tell it to do an 8th note
    metronome to get a count of 12.  It's especially wierd when what
    you're really doing is 4/4 with a triplet/shuffle feel.
    
    Incidentally, no disputation perceived or inferred.  I found it
    interesting that a designer would consider 7 a significant divisor,
    and also 840 is the finest resolution I've seen anywhere.
    
    len.
    
641.12My Favorite Piece Yet!THUNDR::MORSEFri Jan 30 1987 12:199
    WRT .9   Just when I was about to say "Who cares about holding a
    note for 81 quarter notes, you cite one of my all time favorite
    pieces of music!
    
    But -- I'll bet that a reasonable rendition of that bass note would
    have a sufficiently wimpy attack that you could cheat, breaking
    it into 2 notes, starting the second in some non-obvious place.
    
    John