Author 
Message 
w minor
Joined: Sep 28, 2006 Posts: 12 Location: Reading, UK

Posted: Fri Sep 29, 2006 7:31 pm Post subject:
Random Rhythm Generator  Probabilities 


Hi,
I'm in the process of programming an algorithmic composer that will generate rhythms as midi signals.
A random number generator feeds into each patch and some sort of probability determins weather or not that number triggers a note or not.
I would like to give these probabilities some sort of mathematical significance rather than just random values.
Something to do with the golden ration perhaps or the fibbonachi sequence? i haven't studied maths for years so my memory is a bit rusty and i'm having trouble figuring out which way to go with this particular aspect of my project...
i know this isn't really the place to ask but i wasn't sure where else to look... so anyone with any ideas or who could direct me to some starting points it would be very much appreciated.
Thanks
w minor 

Back to top



Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3


Back to top



dewdrop_world
Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4

Posted: Sat Sep 30, 2006 11:36 am Post subject:



Wow, breakage looks really cool.
BTW, 2 of the people listed in the "thanks" section are avid SuperCollider users (Nick Collins and Thor Magnusson), both of whom I had the pleasure to meet at the sc symposium in Birmingham this year. Nice chaps.
I'm also doing algorithmic rhythm programming in sc, will share some thoughts later. Right now I've a small project to try to finish today, so not much time for chitchat...
hjh _________________ ddw online: http://www.dewdropworld.net
sc3 online: http://supercollider.sourceforge.net 

Back to top



Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3

Posted: Sat Sep 30, 2006 11:53 am Post subject:



Cool!
I'm not so much into litteral algorithmic rithem creation but lately I've been quite deeply into using algorthems to modify handprogramed rithems (X0X style) based on live input (think breakdowns/ fillin, etc). this is in ChucK.
Anyway, no time for me either tonight (I have to spin some records) so let's share notes later! _________________ Kassen 

Back to top



kruhft
Joined: Oct 20, 2006 Posts: 50 Location: Canada
Audio files: 5

Posted: Sat Oct 21, 2006 3:30 pm Post subject:
Re: Random Rhythm Generator  Probabilities 


w minor wrote:  Hi,
I'm in the process of programming an algorithmic composer that will generate rhythms as midi signals.
A random number generator feeds into each patch and some sort of probability determins weather or not that number triggers a note or not.
I would like to give these probabilities some sort of mathematical significance rather than just random values.

I base a lot of my songs on random numbers, or 'filtered' random numbers as I like to say. There's a chance that if you based your input sources on something more structured it might create something interesting, but I've found that just plain old random numbers and some range tweaking (min/max values, trigger frequencies, etc) give really decent results.
I find that random numbers give a good overall 'average' effect, rather than always totally rising like the fibbonacci sequence (in that case you'd have to do some modifications to the input values, thus losing the fibbonacci sequence anyways).
Don't get stuck in the idea of using Pi (π) though; it may have a whole lot of mathematical significance, but it's just another random number generator in the end...
I'd say stick with random numbers and tweak them; randomness contains the most information out of any transmission and filtering it allows you to find the best part for your purposes, whether you know it's there at the start or not . It's not easy sometimes, but like anything, it gets easier with practice, and sometimes, I hear, it can almost be a substitute for creativity...
Good luck. _________________ http://www.myspace.com/kruhft
http://kruhft.info 

Back to top



w minor
Joined: Sep 28, 2006 Posts: 12 Location: Reading, UK

Posted: Sat Oct 21, 2006 5:36 pm Post subject:



funny you should say all that, but that's exactly what i've been doing anyway. I decided to get my head round just building the thing before i worried about stuff like that. No time to fully explain now but will be backs soon to explain and post the patch
laters 

Back to top



kruhft
Joined: Oct 20, 2006 Posts: 50 Location: Canada
Audio files: 5


Back to top



dobart
Joined: Feb 20, 2007 Posts: 10 Location: SEATTLE

Posted: Thu Oct 25, 2007 10:11 am Post subject:



There are some interesting 'candle flicker' circuits that generate nonrepeating random signals; IE a 2mhz oscillator being sampled by a ~100hz oscillator through a flipflop. I breadboard these to control vactrols to provide 'random' variation, and the samplng oscillator can be clocked to give discrete pulses or higher frequency noise. So far I've used 3 stages of this circuit in a 3color LED lamp, which drives my LDR controlled instruments in cool ways. Another source of randomness can be feedback, where the output of the instrument feeds back into it in complex ways. I played a bit with that on this LDR controlled 556 (APC) +741 wsg VCF thingy, breaking the CD4040 and LFO driven LED feedback up through LDR gated oscillators:
http://www.youtube.com/watch?v=VGsdvYE9W4E
here's the 'flicker' circuit
http://members.shaw.ca/novotill/FireLightFlicker/ 

Back to top



williamsharkey
Joined: Jul 31, 2005 Posts: 61 Location: usa

Posted: Tue Dec 18, 2007 9:11 am Post subject:



Markov chains are a good way to organize random jumps.
Even though they are called "chains", I think you should forget about the word "chain" for now. Try to visualize frogs jumping from lillypad to lillypad, that's what markov chains are all about.
Lets say there are two states: Snare, and Kick. Now, we program the machine with example probabilities:
After a kick, there is a 100% chance of a snare.
After a snare there is a 50% chance of a snare, and a 50% chance of a kick.
Here is what the Probability matrix would look like:
Code:  c u r r e n t
kick snare
++
n kick  0  0.5 
e +++
x snare  1  0.5 
t +++ 
Is this not an elegant way to describe what is happening? It can be expanded for more states, perhaps a state for a woodblock, or a rest.
Math stuff:
1. Each column must add up to 1. That means there is a 100% chance that there is a "next time".
2. "Whats the probability that 100 beats from now, it will play a snare?!" Well, just take the matrix to the 100th power. Then add up the column called snare. That's the answer! This assumes a 50/50 chance of starting on snare/kick. Last edited by williamsharkey on Tue Dec 18, 2007 9:43 am; edited 1 time in total 

Back to top



williamsharkey
Joined: Jul 31, 2005 Posts: 61 Location: usa

Posted: Tue Dec 18, 2007 9:42 am Post subject:



Quote:  I would like to give these probabilities some sort of mathematical significance rather than just random values. 
I think that you should use probabilities that make interesting/compelling music. I think that the beauty of mathematical ratios would not be expressed when it is translated to trigger probabilities. Have you ever listened to an image mapped to a frequencytime plot? It does not matter if the image is of car or a ladybug, basically it sounds the same because the native meaning is lost in that translation. 

Back to top



jksuperstar
Joined: Aug 20, 2004 Posts: 2501 Location: Denver
Audio files: 1
G2 patch files: 18

Posted: Tue Dec 18, 2007 11:51 am Post subject:



The markov chains could also be note lengths, or multiple things triggered by an event...after a whole note bass drum (or bass on 1 beat), you can have probabilities that intertwine the probabilities of other instruments. 50% chance of snare, 75% chance of hihat 16th notes, etc. Or have 2 markov chains triggering the same sound, so you get the complexity of 2 patterns mingling (and since the sound triggers, one pattern effects the other!). 

Back to top



frijitz
Joined: May 04, 2007 Posts: 1730 Location: NM USA
Audio files: 54


Back to top



Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 5978 Location: San Antonio, Tx, USA
Audio files: 258

Posted: Thu Jan 17, 2008 10:33 am Post subject:
Re: Random Rhythm Generator  Probabilities 


w minor wrote:  Hi,
I'm in the process of programming an algorithmic composer that will generate rhythms as midi signals.
A random number generator feeds into each patch and some sort of probability determins weather or not that number triggers a note or not.
I would like to give these probabilities some sort of mathematical significance rather than just random values.

Consider trying my Boolean Sequencer if your implementation supports logic input. You make a binary counter, then create logic expressions off the counter that say when the drums beat. Can sound really good without much logic. I say "my" because I rediscovered it, but it really originates back to the early days of synthesizers, I think. If you're interested I can explain more and there are posts about it. Good luck.
Oh, wait, you said MIDI, not transistors, sorry  then you could use ChucK to implement the sequencer, and I already have several files for that done, just add midi commands i guess.
Inventor 

Back to top



plagal
Joined: Dec 28, 2007 Posts: 18 Location: South Carolina

Posted: Wed Jan 23, 2008 6:36 pm Post subject:



Just to add my 2 cents 
Maybe have a chain of a few arpeggiators that do switching in various ways such as a tempo change everyother time an arp plays. Same for delayed notes, overlaping, rests, muting, and number of notes each arp plays in turn, and so on...
There's nothing random about this, but its cool to get accurate results from playing with the controls.
BTW this has already been done, but perhaps someone can do it better 
but then, since it was me who already did it, I doubt it 

Back to top



Undergrind
Joined: Jan 19, 2008 Posts: 32 Location: Berlin by night
Audio files: 1


Back to top



