From: bb3dan Date: Tue, 24 Sep 2013 21:28:34 +0000 (-0400) Subject: More DPat Fixes X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ef52f20be0b2c10f01096d510dc2c4ff6d5dd2f0;p=SugarCubes.git More DPat Fixes - Picks are now documented in the debug text - APC knobs now sync up with code when you switch patterns --- diff --git a/DanHorwitz.pde b/DanHorwitz.pde index 51b22cd..e8780db 100755 --- a/DanHorwitz.pde +++ b/DanHorwitz.pde @@ -14,7 +14,7 @@ public class Pong extends DPat { addModulator(y = new SinLFO(cRad, ydMax - cRad, 0)).trigger(); y.modulateDurationBy(dy); addModulator(z = new SinLFO(cRad, zdMax - cRad, 0)).trigger(); z.modulateDurationBy(dz); pSize = addParam ("Size" , 0.4 ); - pChoose = addPick ("Animiation" , 0 , 3 ); + pChoose = addPick ("Animiation" , 0 , 3, new String[] {"Pong", "Ball", "Cone"} ); } void StartRun(double deltaMs) { cRad = xdMax*pSize.Val()/6; } @@ -51,9 +51,10 @@ public class Noise extends DPat Noise(GLucose glucose) { super(glucose); - pRotZ = addParam("RotZ" , .5 ); pSpeed = addParam("Fast", .55); - pDensity= addParam("Dens" , .5); - pSymm = addPick("Symmetry", 0, 4); pChoose = addPick("Animation", 1, 6); + pRotZ = addParam("RotZ" , .5 ); pSpeed = addParam("Fast", .55); + pDensity= addParam("Dens" , .5); + pSymm = addPick("Symmetry" , 0, 4, new String[] {"None", "X", "Y", "Radial"} ); + pChoose = addPick("Animation", 1, 6, new String[] {"Drip", "Cloud", "Rain", "Fire", "Machine", "Spark"} ); } void StartRun(double deltaMs) { @@ -122,15 +123,16 @@ public class Play extends DPat Play(GLucose glucose) { super(glucose); - pAmp = addParam("Amp" , .2); pRotX = addParam("RotX", .5); pRotY = addParam("RotY", .5); pRotZ = addParam("RotZ", .5); - pRad = addParam("Rad" , .1 ); - pTimePattern= addPick ("TimePattern", 0 , 5 ); - pTempoMult = addPick ("TimeMult" , 0 , 6 ); - pShape = addPick ("Shape" , 0 , 16 ); - pForm = addPick ("Form" , 0 , 3 ); + pAmp = addParam("Amp" , .2); + pRad = addParam("Rad" , .1 ); + pTempoMult = addPick ("TMult" , 0 , 6 , new String[] {"1x", "2x", "4x", "8x", "16x", "Rand" } ); + pTimePattern= addPick ("TPat" , 0 , 5 , new String[] {"Bounce", "?", "Roll", "Quant", "Accel" } ); + pShape = addPick ("Shape" , 0 , 10 , new String[] {"Line", "Tap", "V", "RandV", "Pyramid", + "Wings", "W2", "Sphere", "Cone", "Noise" } ); + pForm = addPick ("Form" , 0 , 3 , new String[] {"Bar", "Volume", "Fade" } ); } float t,a; @@ -147,7 +149,7 @@ public class Play extends DPat TCos .set(cos(Theta.x), cos(Theta.y), cos(Theta.z)); if (t= b && a <= c; } boolean btwn (double a,double b,double c) { return a >= b && a <= c; } public class Pick { - Pick (String label, int _Def, int _Max) { NumPicks=_Max; Default = _Def; tag=label; } + Pick (String label, int _Def, int _Max, String d[]) { NumPicks=_Max; Default = _Def; tag=label; Desc = d; } int Cur() { return (CurRow-StartRow)*NumApcCols + CurCol; } int NumPicks, Default, CurRow, CurCol, StartRow, EndRow; - String tag; + String Desc[] ; + String tag ; } //---------------------------------------------------------------------------------------------------------------------------------- public class _DhP extends BasicParameter { - double dflt; + double dflt; _DhP (String label, double value) { super(label,value); dflt=value; } void Set (double value) { super.updateValue(value); } void reset () { super.updateValue(dflt); } @@ -55,7 +56,6 @@ public class xyz { float x,y,z; if (t.y != 0) { z = z*tcos.y - x*tsin.y; x = z*tsin.y + x*tcos.y; } if (t.z != 0) { x = x*tcos.z - y*tsin.z; y = x*tsin.z + y*tcos.z; } { x += o.x; y += o.y; z += o.z; } - } xyz setRand () { return new xyz ( random(xdMax), random(ydMax), random(zdMax)); } @@ -79,7 +79,9 @@ public class DGlobals { int mapRow (int a) { return btwn(a,53,57) ? a-53 : a; } int unmapRow (int a) { return btwn(a,0 , 4) ? a+53 : a; } + void SetLight (int row, int col, int clr){ if (APCOut != null) APCOut.sendNoteOn(col, unmapRow(row), clr); } + void SetKnob (int cc , int chan,int val){ if (APCOut != null) APCOut.sendController(cc , chan , val); } float _Trails () { return Sliders[0]; } float _Dim () { return Sliders[1]; } @@ -109,11 +111,12 @@ public class DGlobals { Text1 += " ZSym: " + (_ZSym ? "ON" : "OFF") + " "; Text1 += " RSym: " + (_RSym ? "ON" : "OFF") + " "; for (int i=0; i