Submit Browse Random
Anonymous Login RSS

SuperCollider Code

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

    ... accel, vel and loc world.contain(o); //keep object within the world //--render Pen.fillColor= Color.grey(1-(o.mass/12), 0.5); Pen.fillOval(Rect.aboutRedObject2D(o)); }; }; w.play; CmdPeriod.doOnce({w.close}); )

  2. 051-boids2 Doc

    ... .mouse; }); //o.addForce(world.gravity); o.update; world.contain(o); //--render Pen.fillColor= Color.grey(1-(i/n), 0.5); Pen.fillOval(Rect.aboutRedObject2D(o)); }; }; w.play; CmdPeriod.doOnce({w.close}); )

  3. 122-collision_objects_synth Doc

    ... thin a world with gravity force and also collision detection //color and size depends on object's mass //sound - collision velocity mapped to amplitude, mass to dur and freq ( s.waitForBoot{ var width= 300, height= 300, w, wgrav, world, n= ...

  4. 003-multiple_wind Doc

    ... dForce(world.gravity); o.addForce(wind); o.update; world.contain(o); //--render Pen.strokeColor= Color.grey(o.mass/4); Pen.strokeRect(Rect.aboutRedObject2D(o)); }; }; w.play; CmdPeriod.doOnce({w.close}); )

  5. 030-wave Doc

    ... 2D[0, sys.wave.wrapAt(i)]; o.addForce(world.gravity); }; sys.update; //--render Pen.fillColor= Color.grey(1, 0.4); sys.do{|o, i| Pen.fillOval(Rect.aboutRedObject2D(o)); }; }; w.play; CmdPeriod.doOnce({w.close}); )

  6. 210-patterns_and_particles Doc

    ... i| o.addForce(world.gravity); o.update; if(o.age<=0, {dead.add(o)}); //--render Pen.fillColor= Color.red; Pen.addOval(Rect.aboutRedVector2D(o.loc, o.age)); Pen.fill; }; dead.do{|o| world.remove(o)}; }; w.play; CmdPeriod.doOnce({w.close}); ) ...

  7. 032-wave_synth2 Doc

    ... -1; synths[i].set(\amp, amp, \freq, freq, \pan, pan); }; sys.update; //--render Pen.fillColor= Color.grey(1, 0.4); sys.do{|o, i| if(i.odd, { Pen.fillOval(Rect.aboutRedObject2D(o)); }, { Pen.fillRect(Rect.aboutRedObject2D(o)); }); }; }; w.pl ...

  8. 013-attraction4 Doc

    ... orce(o.gravityForce(oo).neg); }); }); }; o.update; world.contain(o); //--render Pen.fillColor= Color.hsv(0.4, 1-(o.mass/12), 1, o.mass/12); Pen.fillRect(Rect.aboutPoint(o.loc.asPoint, 0.5, 0.5)); }; }; w.play; CmdPeriod.doOnce({w.close}); )

  9. Redraw Doc

    ... position as a Point . . clear Clears the drawing. . close Close the window if open. . width Set Pen stroke width. . strokeColor Set Pen stroke colour. . background Set drawing background colour. Inherited instance methods Examples a= Redra ...

  10. 054-boids_3d Doc

    ... (i-1).loc); //o.addForce(world.gravity); o.update; world.contain(o); //--render Pen.strokeColor= Color.grey((depth-o.loc[2]/(depth*0.5)).clip(0, 1)); Pen.strokeOval(Rect.aboutRedObject3D(o, s, f)); }; }; w.play; CmdPeriod.doOnce({w.close}); ...

prev 11 12 13 14 15 16 17 18 next

SuperCollider home doc forum wiki git legacy help book

contact | by vividsnow