X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=DanUtil.pde;fp=DanUtil.pde;h=4861f470e35c2ed184623d95a052e142f393c200;hb=596f331f49e47b2164af07e7c5a113f44e5d2a26;hp=85f49fd8573ded8ae85591d35576528457130961;hpb=66067e53a4adab2860ba09f88e2c3f8984ff65ba;p=SugarCubes.git diff --git a/DanUtil.pde b/DanUtil.pde index 85f49fd..4861f47 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -1,6 +1,6 @@ //---------------------------------------------------------------------------------------------------------------------------------- xyz mMax, mCtr, mHalf; -int NumApcRows = 5, NumApcCols = 8; +int NumApcRows=4, NumApcCols=8; 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; } @@ -23,10 +23,11 @@ float distToSeg(float x, float y, float x1, float y1, float x2, float y2) { public class Pick { - int NumPicks, Default , CurRow , CurCol , + int NumPicks, Default , + CurRow , CurCol , StartRow, EndRow ; String tag , Desc[] ; - + Pick (String label, int _Def, int _Num, int nStart, String d[]) { NumPicks = _Num; Default = _Def; StartRow = nStart; EndRow = StartRow + floor((NumPicks-1) / NumApcCols); @@ -84,19 +85,19 @@ public class xyz { float x,y,z; // extends pVector; eliminate half of the functi void subtract(xyz b) {x -= b.x; y -= b.y; z -= b.z; } void scale (float b) {x *= b ; y *= b ; z *= b ; } - void RotateZ (xyz o, float nSin, float nCos) { + void rotateZ (xyz o, float nSin, float nCos) { float nX = nCos*(x-o.x) - nSin*(y-o.y) + o.x; float nY = nSin*(x-o.x) + nCos*(y-o.y) + o.y; x = nX; y = nY; } - void RotateX (xyz o, float nSin, float nCos) { + void rotateX (xyz o, float nSin, float nCos) { float nY = nCos*(y-o.y) - nSin*(z-o.z) + o.y; float nZ = nSin*(y-o.y) + nCos*(z-o.z) + o.z; y = nY; z = nZ; } - void RotateY (xyz o, float nSin, float nCos) { + void rotateY (xyz o, float nSin, float nCos) { float nZ = nCos*(z-o.z) - nSin*(x-o.x) + o.z; float nX = nSin*(z-o.z) + nCos*(x-o.x) + o.x; z = nZ; x = nX; @@ -109,55 +110,11 @@ public class xyz { float x,y,z; // extends pVector; eliminate half of the functi //---------------------------------------------------------------------------------------------------------------------------------- public class DPat extends SCPattern { - MidiOutput APCOut = null; - - boolean noteOff(Note note) { if (!isFocused()) return false; - int row = note.getPitch(), col = note.getChannel(); - for (int i=0; i picks = new ArrayList (); ArrayList bools = new ArrayList (); ArrayList params = new ArrayList(); + MidiOutput APCOut; int nMaxRow = 53; float LastQuant = -1, LastJog = -1; float[] xWaveNz, yWaveNz; @@ -167,10 +124,9 @@ public class DPat extends SCPattern float NoiseMove = random(10000); DParam pSpark, pWave, pRotX, pRotY, pRotZ, pSpin, pTransX, pTransY; - DBool pXsym, pYsym, pRsym, pXdup, pXtrip, pJog, pGrey; + float lxh () { return lx.getBaseHuef(); } - float Dist (xyz a, xyz b) { return dist(a.x,a.y,a.z,b.x,b.y,b.z); } int c1c (float a) { return round(100*constrain(a,0,1)); } float interpWv(float i, float[] vals) { return interp(i-floor(i), vals[floor(i)], vals[ceil(i)]); } @@ -187,13 +143,35 @@ public class DPat extends SCPattern params.add(P); return P; } - Pick addPick(String name, int def, int _max, String[] desc) { + Pick addPick(String name, int def, int _max, String[] desc) { Pick P = new Pick(name, def, _max+1, nMaxRow, desc); nMaxRow = P.EndRow + 1; picks.add(P); return P; } + boolean noteOff(Note note) { + int row = note.getPitch(), col = note.getChannel(); + for (int i=0; i 100) return; + + if (this == midiEngine.getFocusedDeck().getActivePattern()) { + String Text1="", Text2=""; + for (int i=0; i