Submit Browse Random
Anonymous Login RSS

SuperCollider Code

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

    ... contain(~objA); world.contain(~objB); bary= ~objA.barycenter(~objB); //--render Pen.strokeColor= Color.magenta; Pen.strokeOval(Rect.aboutRedObject2D(~objA)); Pen.strokeColor= Color.cyan; Pen.strokeOval(Rect.aboutRedObject2D(~objB)); Pen.fil ...

  2. 034-wave-system Quark

    ... sys.wave.wrapAt(i)]); }; //sys.addForce(world.gravity); sys.update; //--render Pen.fillColor= Color.grey(1, 0.5); //Pen.strokeColor= Color.grey(1, 0.5); //Pen.moveTo(sys.objects[0].loc.asPoint); sys.do{|o, i| Pen.fillOval(Rect.aboutRedObje ...

  3. 043-pendulum-render Quark

    //render pendulums - takes a little while ( var width= 640, height= 480, w, wgrav, world, n= 50, ploc; //--world w= RedWindow("pendulum test3", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0.98]; world= RedWorld(RedVector2D[wi ...

  4. 010-attraction Quark

    ... tor2D[0, 0], 1.5, 10); //world,loc,vel,acc,mass,size }.dup(n); //--loop w.draw{ Pen.strokeColor= Color.green; Pen.strokeOval(Rect.aboutRedObject2D(att)); Pen.strokeColor= Color.white; world.objects.do{|o| if(o!=att, { o.addForce(o.gravityFo ...

  5. 042-pendulum3 Quark

    //many pendulums in a world with gravity ( var width= 300, height= 300, w, wgrav, world, n= 100, ploc; //--world w= RedWindow("pendulum test3", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0]; world= RedWorld3(RedVector2D[widt ...

  6. 261-oscillators_clocks Quark

    ... p| if(p!=o, { o.couple(p); }); }; }; world.objects.do{|o| o.update}; //--render Pen.width= 5; Pen.strokeColor= Color.black; Pen.fillColor= Color.white; world.objects.do{|o| var p, x, y; p= o.loc.asPoint; Pen.addOval(Rect.aboutPoint(p, o.siz ...

  7. MPadView Quark

    ... * 0.5 ); var name; rect = vw.bounds.moveTo(0, 0).insetBy(1,1); if( pressed ) { Pen.width = 2; fillColor = hiliteColor; fillRect = rect.insetAll(0, (1 - value) * rect.height,0,0 ); if (useMoveValue) { fillRect2 = rect.insetAll(0, (1 - moveV ...

  8. 040-pendulum Quark

    //simple pendulum in a world with gravity ( var width= 300, height= 300, w, wgrav, world, n= 1, ploc; //--world w= RedWindow("pendulum test1", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0.98]; world= RedWorld(RedVector2D[wid ...

  9. 016-repulsive2 Quark

    ... ctor2D[0, 0], 1.5, 10) }.dup(n); //world,loc,vel,acc,mass,size //--loop w.draw{ Pen.strokeColor= Color.green; rep.loc= w.mouse; Pen.strokeRect(Rect.aboutRedObject2D(rep)); Pen.strokeColor= Color.white; world.objects.do{|o| if(o!=rep, { o.ad ...

  10. 045-pendulum4 Quark

    //a few pendulums that attract eachother ( var width= 300, height= 300, w, wgrav, world, n= 18, ploc; //--world w= RedWindow("pendulum test3", Rect(128, 64, width, height)).front; wgrav= RedVector2D[0, 0.98]; world= RedWorld(RedVector2D[wid ...

prev 11 12 13 14 15 16 17 18 19 20 next

SuperCollider home doc forum wiki git legacy help book

contact | by vividsnow