Markov Chains
Hi all,
I'm looking to experiment with some simple Markov Chains to do some probabilistic switching of a matrix. I'm looking for some general guidance.
Firstly, is the attached patch an accurate representation of a zero order chain? I think it is, but I'm not certain.
Secondly, would higher order chains be useful for this kind of switching? I'm a little lost in the technicalities.
I've had a look at ml.markov but I'd rather not get involved with MIDI data. I've also looked at prob but not really understanding how it works.
instead of prob you can build something around random and gate which does the same, then you will know what it does on a lower level.
a 0th order state/transition system is about as useful as 0th oder ambisonics i guess (and i am not sure how it will look.)
starting with 1st order seems easier. :)
for higher order you can then simply write the additional future states (seen from here) as list into a coll. likewise with parallel states, such as note number, velocity and duration, no matter how you want them to be combined.
at the moment i dont see how histo could be of help? you want to count identical data input, not make it a new entry.
Thanks Roman. I've put histo in there to keep track more easily (for me) of the count. Just a visual aid.
What I'd like to figure out is how to use the previous 'n' states to influence the probability of future ones. I'll take a look at using coll.
for smaller amounts you can write the repetition of an already existing entry again, so that
1, 5 6 6;
means that from 1 you go to 6 with 66% probability, to 5 with 33%, and to all other next states with 0%.
the random function itself for this is then simply linear: choose one of all entries.
for bigger numbers of the same data you might want to use symbols of two ints and write the amount as additional int.
1, "5 1", "6 2"
Hey roman! could you maybe post a little example of how a second order markov chain could be designed with the coll method you described? i cant get my head around how i would read out the data out of coll with the specific markov dependecies. Really apreciate your help!
Luca, a detailed explanation here:
http://www.algorithmiccomposer.com/2010/05/algorithmic-composition-markov-chains.html
One way to use coll is that you combine the previous n states into one index number to store a list of the next possible states. So if you had a 2nd order markov of 16 states, you could have 16x16=256 indices to represent every combination of 2 states. So 9,3 would be index 9x16 + 3 = 147. At least thats how I did it. You can extend that to any order, though coll could get big