-
... assignments ++ centroids.size; centroids = centroids ++ [datum]; } } // Choose random centroids by randomly resampling from the data-derived marginals reset { k.do{|i| centroids[i] = data[0].size.collect{|d| data.choose[d]} }; data.do{|dat ...
-
... t less flexible. Compare these two examples: // first with a Function. Note the random frequency each time 'play' is called. f = { SinOsc .ar(440 + 200.rand, 0, 0.2) }; x = f.play; y = f.play; z = f.play; x.free; y.free; z.free; // Now with ...
-
... SCPen .translate(100, 100); 10.do{ // set the Color SCPen .color = Color .blue(rrand(0.0, 1), rrand(0.0, 0.5)); SCPen .addWedge((100.rand)@(100.rand), rrand(10, 100), 2pi.rand, 2pi.rand); SCPen .perform([ \stroke , \fill ].choose); } }; w.r ...
-
... umIns = 2; var numOuts = 0; var bounds = Rect((Window.screenBounds.width - 250).rand, (Window.screenBounds.width - 90).rand, 250, 90); var name = "HrDAC"; ^super.new(argParentApp, name, argIdent, argUniqueID, argExtraArgs, bounds, numIns, n ...
-
... elements as there are keys. Examples ( a = Pbind ( \x , Pseq ([1, 2, 3]), \y , Prand ([100, 300, 200], inf ), \zzz , 99); x = a.asStream; ) x.next(()); // pass in an event () x.next(()); x.next(()); x.next(()); // end: nil // sound examples ...
-
... t less flexible. Compare these two examples: // first with a Function. Note the random frequency each time 'play' is called. f = { SinOsc.ar(440 + 200.rand, 0, 0.2) }; x = f.play; y = f.play; z = f.play; x.free; y.free; z.free; // Now with ...
-
... html Description Uses succesive iterations of a k-means clustering algorithm on random data with random initial means to form break points in a 2-D space. These are then converted to wavetables in output synthesis based on the oscillator fr ...
-
... height], wgrav, 99, 0); //dim,grav,maxvel,damp //--objects objs= { var mass= 1.rrand(10); RedObject(world, RedVector2D[width.rand, height.rand], RedVector2D[0, 0], RedVector2D[0, 0], mass, mass); }.dup(n); sprs= objs.collect{|x| objs.collec ...
-
... height], wgrav, 99, 0); //dim,grav,maxvel,damp //--objects objs= { var mass= 1.rrand(10); RedObject(world, RedVector2D[width.rand, height.rand], RedVector2D[0, 0], RedVector2D[0, 0], mass, mass); }.dup(n); sprs= objs.collect{|x| objs.collec ...
-
... l only post part of the data, or a simplified // representation. // n times 200 random numbers // will just add ... etc ... after 123 ( var n = 3; (1..n).do { |num| { 1000.rand }.dup(200).postln }; ) // posts the compile string, i.e. the co ...