You could try this approach(I also attached a patch with it):

48 = 4 * 10 + 1 * 8

so you use

n1=random(10)
n2 = 10 - n1

n3 = random(10)
n4 = 10-n3
.
.
n9 = random(8)
n10 = 8 - n9

On 03.03.2011 02:20, Caio Barros wrote:
> Hey guys, long time since I posted here.
> I've been trying to think a way to divide a number into random parts.
> Let me explain myself better:
> I'm writing a piece where I want 10 chords played during 48 seconds but the
> duration of each chord should be different.
> So I'm trying to figure out a way to divide 48 into 10 unequal parts, I think
> using random numbers should be the best way but the difficulty is to get 10
> random numbers wich summed give 48.
> Since I'm not expert at math maybe someone can help me.
> I want to do this operation with other numbers, therefore a pd patch would be 
> great.
> 
> 
> 
> _______________________________________________
> Pd-list@iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> http://lists.puredata.info/listinfo/pd-list
#N canvas 1068 504 450 300 10;
#X obj -122 98 random 10;
#X obj -122 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom -122 163 5 0 0 0 - - -;
#X obj -84 122 - 10;
#X obj -84 144 abs;
#X floatatom -84 164 5 0 0 0 - - -;
#X obj -46 99 random 10;
#X floatatom -46 164 5 0 0 0 - - -;
#X obj -8 121 - 10;
#X obj -8 143 abs;
#X floatatom -8 164 5 0 0 0 - - -;
#X obj 29 99 random 10;
#X floatatom 29 164 5 0 0 0 - - -;
#X obj 67 123 - 10;
#X obj 67 145 abs;
#X floatatom 67 165 5 0 0 0 - - -;
#X obj 105 100 random 10;
#X floatatom 105 165 5 0 0 0 - - -;
#X obj 143 122 - 10;
#X obj 143 144 abs;
#X floatatom 143 165 5 0 0 0 - - -;
#X floatatom 181 165 5 0 0 0 - - -;
#X obj 219 144 abs;
#X floatatom 219 165 5 0 0 0 - - -;
#X obj 181 100 random 8;
#X obj 219 122 - 8;
#X connect 0 0 3 0;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 0 6 0;
#X connect 1 0 11 0;
#X connect 1 0 16 0;
#X connect 1 0 24 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 6 0 8 0;
#X connect 6 0 7 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 11 0 13 0;
#X connect 11 0 12 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 16 0 18 0;
#X connect 16 0 17 0;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X connect 22 0 23 0;
#X connect 24 0 21 0;
#X connect 24 0 25 0;
#X connect 25 0 22 0;
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to