clean-up #1:
two supercollider classes i wrote long ago (nov 2008) after a technique described by Godfried Toussaint in his paper 'The Euclidean Algorithm Generates Traditional Musical Rhythms'
also see for another implementation with some great demos. and Bjorn Westergard has a sc demo here.

lots of typical patterns in say techno music can be described like this using only two numbers (relation).

Bjorklund is now available as a supercollider quark. install it via the following commands...

//and recompile

below is some example supercollider code with resulting output as mp3. the hihat plays a 9/16 rhythm throughout and the snare plays 3 different ones... 5/8, 15/16 and 3/8.

a=, "sounds/Free_CR68/CR68_BD_B_03.wav")
b=, "sounds/Free_CR68/CR68_SD_B1.wav")
c=, "sounds/Free_CR68/CR68_hh_02.wav")

SynthDef(\oneshotMono, {|out= 0, amp= 0.1, pan= 0, rate= 1, buffer|
        var src=, buffer, rate*, doneAction:2);,, pan, amp));

d= TempoClock(120/60)
Pdef(\bd).play(d, quant:4)
Pdef(\hh).play(d, quant:4)
Pdef(\sd).play(d, quant:4)
Pdef(\bd, Pbind(\instrument, \oneshotMono, \buffer, a, \dur, 1.00, \amp, 0.7))
Pdef(\hh, Pbind(\instrument, \oneshotMono, \buffer, c, \dur, 0.25, \amp, Pbjorklund(9, 16, inf)*0.7, \pan, Pbrown(-1, 1, 0.2, inf)))
Pdef(\sd, Pbind(\instrument, \oneshotMono, \buffer, b, \dur, 0.25, \amp, Pbjorklund(5, 8, inf)*0.3))
Pdef(\sd, Pbind(\instrument, \oneshotMono, \buffer, b, \dur, 0.25, \amp, Pbjorklund(15, 16, inf)*0.3))
Pdef(\sd, Pbind(\instrument, \oneshotMono, \buffer, b, \dur, 0.25, \amp, Pbjorklund(3, 8, inf)*0.3))

update 110316: adapted Pbjorklund to also take patterns as arguments.
update 110320: made a quark out of it