From: bb3dan Date: Fri, 18 Oct 2013 17:41:20 +0000 (-0700) Subject: updates to patterns X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a5e5b14c18126657ce8f673173b7cb009d5ee26e;p=SugarCubes.git updates to patterns --- diff --git a/DanHorwitz.pde b/DanHorwitz.pde index 8b84f3b..856c579 100644 --- a/DanHorwitz.pde +++ b/DanHorwitz.pde @@ -411,8 +411,9 @@ class dCursor { dVertex v = vCur; if (dDebug) { p1 = v.getPoint(nFrom); float d = (p2 == null ? 0 : PointDist(p1,p2)); if (d>5) { println("too wide! quitting: " + d); exit(); }} - for (int i = nFrom; i <= nTo; i++) { pat.getColors()[v.ci + v.dir*i ] = clr; } + for (int i = nFrom; i <= nTo; i++) { pat.getColors()[v.ci + v.dir*i ] = clr; } if (v.same != null) for (int i = nFrom; i <= nTo; i++) { pat.getColors()[v.same.ci + v.same.dir*i] = clr; } + if (dDebug) { p2 = v.getPoint(nTo); i2 = nTo; } pos += nMv; return nAmount - nMv; @@ -436,15 +437,12 @@ class Worms extends SCPattern { private BasicParameter pEQ = new BasicParameter("EQ" , 0); private BasicParameter pSpawn = new BasicParameter("DIR" , 0); - // versions of worms - // 5. slow worms branching out like a tree - int zMidLat = 82; float nConfusion; private final Click moveChase = new Click(1000); xyz middle; - int AnimNum() { return floor(pSpawn.getValuef()*(3-.01)); } + int AnimNum() { return floor(pSpawn.getValuef()*(4-.01)); } float randX() { return random(model.xMax-model.xMin)+model.xMin; } float randY() { return random(model.yMax-model.yMin)+model.yMin; } xyz randEdge() { @@ -465,7 +463,7 @@ class Worms extends SCPattern { onParameterChanged(pEQ); setNewDest(); } - public void onParameterChanged(LXParameter parameter) { + void onParameterChanged(LXParameter parameter) { nConfusion = 1-pConfusion.getValuef(); for (int i=0; i0) { + if (pEQ.getValuef()>0) { // EQ eq.run(deltaMs); fBass = eq.getAverageLevel(0, 4); fTreble = eq.getAverageLevel(eq.numBands-7, 7); } - for (int i=0,s=model.points.size(); i0) colors[i] = color(hue(c), saturation(c), (float)(b-100*deltaMs/(pBlur.getValuef()*TrailTime))); + if (pBlur.getValuef() < 1) { // trails + for (int i=0,s=model.points.size(); i0) colors[i] = color(hue(c), saturation(c), (float)(b-100*deltaMs/(pBlur.getValuef()*TrailTime))); + } } int nWorms = floor(pWorms.getValuef() * numCursors * diff --git a/DanUtil.pde b/DanUtil.pde index e475059..6f4b000 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -431,6 +431,7 @@ class dLattice { s.v1 = new dVertex(s,strip.points.get(15)); s.v0.setOpp(s.v1); s.v1.setOpp(s.v0); if (col < NumBackTowers) DQ[col][row] = 16*floor((iTowerStrips-1)/16); + else s.row=-1; } for (int j=0; j