Forums > MaxMSP

### Weighted choices in random melody

Jan 08 2011 | 12:20 am

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

Jan 08 2011 | 1:29 am

http://algocomp.blogspot.com/2008/10/probability-distribution.html

Jan 08 2011 | 1:39 am

Litter or RTC is probably best, but there’s always this kinda simple thingamaging with itable:

``````
-- Pasted Max  Patch, click to expand. --

```
```
Jan 08 2011 | 2:47 am

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

Jan 08 2011 | 2:50 am

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

Jan 08 2011 | 11:24 am

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

Jan 08 2011 | 11:29 am

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

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

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

Forums > MaxMSP