Weighted choices in random melody

davidestevens's icon

Hi all,

I'm wanting to generate a random melodic line, that clusters around specific degrees of the scale.
Each bang that the system receives creates a number between 0 & 11, but with the choice weighted towards 0, 2, 5, 7 for example. (transposition, forcing to a scale, and rhythm are handled seperately).

So - a continuous stream of single numbers, between 0 & 11, with variable amounts of weighting towards specific numbers.
(I have both Litter Pro & RTC-lib, but I can't figure out how to use them for this - if indeed this is what I should do!)

I don't have the math experience to make sense of this, so I'd be gratefu lfor any help offered!

Thanks

David

Christopher Dobrian's icon
Roman Thilenius's icon

one way oif many would be to use random and then map the output to the notenumbers stored in a coll.

Chris Muir's icon

fill the first 12 slots of a table with your weights and bang it to generate a weighted random.

davidestevens's icon

Thanks everybody.

Christopher - thanks for the reminder about algocomp - that article made a lot clear to me, as well as introducing a use of itable that I didn't know!

I had a quick look through the following posts, but couldn't see the one about using Markov chains to "melodify" the results. Have you written that? Or is there maybe a draft version I could look at? And the one about synchronous decision making?

Thanks

David

davidestevens's icon

A forum search also turned up a lnk to Markov chains on Algorithmic Composer -