Forums > MaxMSP

markov chainz

April 9, 2012 | 12:29 pm

Hello, i have a synth part that i wish to markov chain-up. I have the method of inputting the midi notes and the STM which it will populate, but how would i keep the note timings the same? The part i have written was in Logic and as its quite unpredictable timing and melody wise i think it will sound good letting a markov chain do its thing. I just don’t really know how to tackle it as i would like each note to be the same length as it were in the original "riff".

Sorry if what i have asked isn’t very coherent.


April 9, 2012 | 1:55 pm

um, have you actually written any code involving markov chanins before?


April 9, 2012 | 2:07 pm

Well, i have been following Christopher Dobrian’s tutorials concerning algorithmic composition. I haven’t written a markov chain patch myself, i have built the example patch and was wondering about the best way to alter note values or even to mimic the values of those imported into the patch.

Whoops…tried to paste the patch but apparently there is a method other than copying and pasting it into this box. My patch is just basically the one found here:

http://www.algorithmiccomposer.com/2010/05/algorithmic-composition-markov-chains.html


April 9, 2012 | 3:12 pm

well it is a bit hard to trigger the duration of notes in realtime, that works better with a database collected prior to playing from it.

in that case you`d simply extract the duration from the notes and treat them as part of the note/chord event,
i.e. you store a list with 2 numbers (notenumber and duration).

of course this will create a very big database … and it will require that you quantize the note durations or you will end up with one database entry for each not in the phrase, all with a probabilty of 1/number of events :)

-110


April 9, 2012 | 3:29 pm

Ok, that makes sense. Unfortunately i think thats slightly beyond my limited max capabilities. I think i will go for a global transport object with some sort of probability based decision on how fast the notes are played back. Thanks for your help


April 9, 2012 | 5:10 pm

or leave the position and duration as it is, triggered by the original (midi file?) and onyl markov the pitches … can work great, musically. :)


April 9, 2012 | 6:39 pm

Sorry i don’t know what you mean by that, could you elaborate please? All i have going in is the midi note values so theres no instructions other than the bang being outputted by the metro of timing, what do you mean by position? (i tried randomly note values and it sounded a little too chaotic). Thanks again!


April 10, 2012 | 2:38 am

ah ja, "position" was careless of me position already has another meaning when
we discuss chains. :)

what i ment is the position on the timeline … when the next event has to be played
from the adatbase … usually called the "delta time" of the note.

from the perspective of the most basic note event (one number for frequency) the
delta time is probably the second value we weould like to add to our markov thing.

but instead of including the delta times of the original to the database of our
markov analysis, i suggest to create the trigger bangs by just playing the original
melody as rythm generator.

or the other way round.

or one could markov the times and the pitches indepently, that is still easier to
program than both together as one event (so that there will be 15 different C-E-G
chords of different lenghts and/or delta times) in your database, as this would
cause almost as much database entries as you had events in the original melody …

they would look like (60 64 67 | delta 240 | duration 131.1 | 0.07%) and the markov
chain will play back almost like the original. :)

-110


April 10, 2012 | 2:39 am

i can cause more confusion and typos, just ask.


Viewing 9 posts - 1 through 9 (of 9 total)