Submit Browse Random
Anonymous Login RSS

SuperCollider Code

All (764) Code (64) Doc (175) Help (16) Quark (509) SCDoc ↗ Forum ↗ Google ↗
  1. 175-springs_interconnected2 Doc

    ... |x| x.notNil}; }.flat; syns= {Synth(\imp2)}.dup(n); //--loop w.draw{ //--render Pen.smoothing= true; Pen.strokeColor= Color.white; sprs.do{|spr| spr.update; //--render springs Pen.moveTo(spr.object.loc.asPoint); Pen.lineTo(spr.target.loc.as ...

  2. 131-obstacle_rocks Doc

    ... Rock(world, RedVector2D[width.rand, height].rand)}.dup(rocks); //--loop w.draw{ Pen.width= 1; world.objects.do{|o, i| //iterate all objects in this world o.addForce(o.world.gravity); //add gravity world.objects.copyToEnd(i+1).do{|oo| o.coll ...

  3. cloth Doc

    ... on.set(mx, my, 0); particles[0][gridSize-1].velocity.clear; px= mx; py= my; }); Pen.color= Color.black; gridSize.do{|i| Pen.moveTo(Point(particles[i][0].position.x, particles[i][0].position.y)); gridSize.do{|j| //particles[i][j].position.x. ...

  4. NearestN Doc

    ... s: // Find/make a dataset of points: x = 15.collect{[1.0.rand, 1.0.rand]}; // Append the index onto the end, for later reference x = x.collect{|data, i| data ++ i }; // Use the KDTree quark and the .makeBufferData method to put the data in ...

  5. red03 Doc

    ... y, 0)}; usr.mouseMoveAction= usr.mouseDownAction; usr.drawFunc= { physics.tick; Pen.width= 0.1; Pen.strokeColor= Color.grey(0, sin(usr.frame%1000/1000*2pi)*0.5+0.5); physics.springs.do{|s, i| Pen.moveTo(Point(s.getOneEnd.position.x, s.getOn ...

  6. Simple_Pendulum Doc

    //Simple_Pendulum //Originally created by Jeffrey Traer Bernstein http://murderandcreate.com/physics/ ( var width= 400, height= 400; var win= Window("Simple Pendulum", Rect(100, 100, width, height), false); var usr= UserView(win, Rect(0, 0, ...

  7. RedPerlin Doc

    ... , {|x| a.noise1D(x/100, 0.75, 3, 0)}).normalize.plot //interpolation off //--1d pen test ( var width= 300, height= 300, w, u, a, persistance= 0.75, octaves= 8; w= Window("perlin test 1d", Rect(128, 64, width, height), false); u= UserView(w, ...

  8. 015-repulsive Doc

    ... addForce(obj.gravityForce(rep).neg); obj.update; world.contain(obj); //--render Pen.strokeColor= Color.green; Pen.strokeRect(Rect.aboutRedObject2D(rep)); Pen.strokeColor= Color.white; Pen.strokeRect(Rect.aboutRedObject2D(obj)); }; w.play; C ...

  9. 022-viscosity Doc

    ... ddForce(obj.viscosityForce(vv)); }); obj.update; world.contain(obj); //--render Pen.fillColor= Color.yellow; Pen.fillRect(visc); Pen.strokeColor= Color.white; Pen.strokeRect(Rect.aboutRedObject2D(obj)); }; w.play; CmdPeriod.doOnce({w.close} ...

  10. 046-pendulum5 Doc

    //some pendulums drifting and coming to a halt ( var width= 640, height= 480, w, wgrav, world, ypos; //--world w= RedWindow("pendulum test5", Rect(128, 64, width, height)).front; w.clearOnRefresh= false; wgrav= RedVector2D[0, 0]; world= Red ...

prev 1 2 3 4 5 6 7 8 9 10 next

SuperCollider home doc forum wiki git legacy help book

contact | by vividsnow