X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=DanUtil.pde;h=cb40292cd3e84c4f86c07bd5709a06aeda249141;hb=ef52f20be0b2c10f01096d510dc2c4ff6d5dd2f0;hp=16e19359ed4c2412fd2e54621b1f84c2c2a2f397;hpb=dd00b10f32e4512228dade7200a0da56741db327;p=SugarCubes.git diff --git a/DanUtil.pde b/DanUtil.pde index 16e1935..cb40292 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -7,14 +7,15 @@ boolean btwn (int a,int b,int c) { return a >= 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