pRotZ = addParam("RotZ" , .5 ); pSpeed = addParam("Fast", .55);\r
pDensity= addParam("Dens" , .5);\r
pSymm = addPick("Symmetry" , 0, 3, new String[] {"None", "X", "Y", "Radial"} );\r
- pChoose = addPick("Animation", 1, 5, new String[] {"Drip", "Cloud", "Rain", "Fire", "Machine", "Spark"} );\r
+ pChoose = addPick("Animation", 6, 7, new String[] {"Drip", "Cloud", "Rain", "Fire", "Machine", "Spark","VWave", "Wave"} );\r
for (int i=0; i<_ND; i++) N[i] = new NDat();\r
}\r
\r
color c = 0;\r
P.RotateZ(mCtr, zSin, zCos);\r
\r
+ if (CurAnim == 6 || CurAnim == 7) {\r
+ P.setNorm();\r
+ return color(0,0, 100 * (\r
+ constrain(1-50*(1-pDensity.Val())*abs(P.y-sin(zTime*10 + P.x*(300))*.5 - .5),0,1) + \r
+ (CurAnim == 7 ? constrain(1-50*(1-pDensity.Val())*abs(P.x-sin(zTime*10 + P.y*(300))*.5 - .5),0,1) : 0))\r
+ );\r
+ } \r
+ \r
if (iSymm == XSym && P.x > mMax.x/2) P.x = mMax.x-P.x;\r
if (iSymm == YSym && P.y > mMax.y/2) P.y = mMax.y-P.y;\r
\r
void set() { prvA = dstA; dstA = random(2*PI); prvA = fixAngle(prvA, dstA);\r
prvR = dstR; dstR = random(mCtr.y); }\r
}\r
+\r
int nBeats = 0;\r
DParam pAmp, pRadius, pBounce;\r
DParam pRotX, pRotY, pRotZ;\r
\r
float t,amp,rad,bnc;\r
+ \r
+ ArrayList<rWave> waves = new ArrayList<rWave>(10);\r
+ \r
rAngle a1 = new rAngle(), a2 = new rAngle(),\r
a3 = new rAngle(), a4 = new rAngle();\r
xyz cPrev = new xyz(), cRand = new xyz(),\r
pBounce = addParam("Bnc" , .2 );\r
pAmp = addParam("Amp" , .2 );\r
pTempoMult = addPick ("TMult" , 0 , 5 , new String[] {"1x", "2x", "4x", "8x", "16x", "Rand" } );\r
- pTimePattern= addPick ("TPat" , 6 , 7 , new String[] {"Bounce", "Sin", "Roll", "Quant", "Accel", "Deccel", "Slide", "Rand"} );\r pShape = addPick ("Shape" , 13, 15 , new String[] {"Line", "Tap", "V", "RandV",\r
+ pTimePattern= addPick ("TPat" , 6 , 7 , new String[] {"Bounce", "Sin", "Roll", "Quant", "Accel", "Deccel", "Slide", "Rand"} );\r pShape = addPick ("Shape" , 2 , 15 , new String[] {"Line", "Tap", "V", "RandV",\r
"Pyramid", "Wings", "W2", "Clock",\r
"Triangle", "Quad", "Sphere", "Cone",\r
"Noise", "Wave", "?", "?"} );\r
pForm = addPick ("Form" , 2 , 2 , new String[] {"Bar", "Volume", "Fade"} );\r
}\r
\r
+ public class rWave {\r
+ float v0, a0, x0, t,damp,a;\r
+ boolean bDone=false;\r
+ final float len=8;\r
+ rWave(float _x0, float _a0, float _v0, float _damp) { x0=_x0*len; a0=_a0; v0=_v0; t=0; damp = _damp; }\r
+ void move(double deltaMs) {\r
+ t += deltaMs*.001;\r
+ if (t>4) bDone=true;\r
+ }\r
+ float val(float _x) {\r
+ _x*=len;\r
+ float dist = t*v0 - abs(_x-x0);\r
+ if (dist<0) { a=1; return 0; }\r
+ a = a0*exp(-dist*damp) * exp(-abs(_x-x0)/(.2*len)); // * max(0,1-t/dur)\r
+ return -a*sin(dist);\r
+ }\r
+ }\r
\r
-float zTime = random(1000);\r
void StartRun(double deltaMs) {\r
- zTime += deltaMs*.001; zTime = zTime % 1000.;\r
t = lx.tempo.rampf();\r
amp = pAmp.Val();\r
rad = pRadius.getValuef();\r
case 4: t = (t*16.)%1.; break;\r
}\r
\r
+ int i=0; while (i< waves.size()) {\r
+ rWave w = waves.get(i);\r
+ w.move(deltaMs); if (w.bDone) waves.remove(i); else i++;\r
+ }\r
+\r
if (t<LastBeat) {\r
cPrev.set(cRand); cRand.setRand();\r
a1.set(); a2.set(); a3.set(); a4.set();\r
+ waves.add(new rWave(\r
+ random(1), // location\r
+ bnc*10, // bounciness\r
+ 7, // velocity\r
+ 2*(1-amp))); // dampiness\r
+ if (waves.size() > 5) waves.remove(0);\r
} LastBeat = t;\r
\r
switch (nTPat) {\r
\r
cMid.set (cPrev); cMid.interpolate (t,cRand);\r
cMidNorm.set (cMid); cMidNorm.setNorm();\r
-\r
a1.move(); a2.move(); a3.move(); a4.move();\r
}\r
\r
case 12: return color(100 + noise(Pn.x,Pn.y,Pn.z + (NoiseMove+50000)/1000.)*200,\r
85,c1c(Pn.y < noise(Pn.x + NoiseMove/2000.,Pn.z)*(1+amp)-amp/2.-.1 ? 1 : 0)); // noise\r
\r
- case 13: V.set(Pn.x, map(\r
- sin( zTime*3.7 + Pn.x*2.0*PI)\r
- + sin( zTime*4.2 + Pn.x*1.7*PI)\r
- + sin( -zTime*4.7 + Pn.x*2.1*PI)\r
- + sin( -zTime*5.2 + Pn.x*1.5*PI)\r
- ,-2,2,.2,.8), Pn.z); break;\r
- \r
- \r
+ case 13: float y=0; for (rWave w : waves) y += .5*w.val(Pn.x);\r
+ V.set(Pn.x, .7+y, Pn.z);\r
+ break;\r
+\r
default: return color(0,0,0);\r
}\r
\r
MidiInput APCIn = null, OxygenIn = null;
DPat CurPat = null;
+
float Sliders[] = new float [] {1,0,0,0,0,0,0,0};
String SliderText[] = new String[] {"Level", "SpinHue", "Spark", "Xwave", "Ywave", "Trails", "??", "??", "??"};
String Text1="", Text2="";
for (int i=0; i<CurPat.bools.size(); i++) if (GetBool(i).b) Text1 += " " + GetBool(i).tag + " ";
for (int i=0; i<CurPat.picks.size(); i++) Text1 += GetPick(i).tag + ": " + GetPick(i).CurDesc() + " ";
- for (int i=0; i<5; i++) Text2 += SliderText[i] + ": " + round(100*Sliders[i]) + " ";
+ for (int i=0; i<8; i++) Text2 += SliderText[i] + ": " + round(100*Sliders[i]) + " ";
uiDebugText.setText(Text1, Text2);
}
//----------------------------------------------------------------------------------------------------------------------------------
public class DPat extends SCPattern
{
- ArrayList picks = new ArrayList();
+ ArrayList picks = new ArrayList(); // should be ArrayList<Pick> picks = new ArrayList<Pick>();
ArrayList params = new ArrayList();
ArrayList bools = new ArrayList();
int nMaxRow = 53;