# [PD] To divide a number in random parts

Mathieu Bouchard matju at artengine.ca
Sat Mar 5 05:10:35 CET 2011

```On Fri, 4 Mar 2011, Caio Barros wrote:

> Until now tim's solution seems best for me, I'll try to build the patch
> these days.

without a maximum, where all possibilities are EQUALLY LIKELY :

for two chords, pick a number from 0 to 1 with equal probability ; it will
be the fraction of the time given to the 1st chord. The 2nd chord takes
the rest.

for three chords, pick a number from 0 to 1 with equal probability, then
square it. Then for the two remaining chords, use the two-chord method on
the rest of the available time.

for four chords, pick a number from 0 to 1 with equal probability, then
cube it. Then apply the three-chord method on the rest.

for N chords, pick a number from 0 to 1 with equal probability, then raise
it to the power N-1. Then apply the method for N-1 chords on the rest.

I'm basing this on the formula for the right-isoceles triangle area, n²/2,
and the formula for the right-pyramid volume, n³/6, and I extrapolated.

I hope I didn't make any mistake in there... but it looks right.

> And by the way (a little off-topic now): Mathieu, I recently compilated
> GridFlow and tried the [note] object you did. Humm! What a nice object.
> I still would prefer that the output would be the midi note and the
> slide to go chromatically because at least for me is so much easier for
> the calculations, but kudos to you.

Well, when I made it, I already planned that I would incompatibly change
it from what it is, so that it becomes MIDI. That's on my TODO list. Maybe
I will do it for 9.14.

_______________________________________________________________________
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
```