+ void noteOnReceived (Note note) { if (!isFocused()) return;
+ int row = note.getPitch(), col = note.getChannel();
+ for (int i=0; i<CurPat.picks.size(); i++) if (GetPick(i).set(row, col)) return;
+ for (int i=0; i<CurPat.bools.size(); i++) if (GetBool(i).set(row, col, true)) return;
+
+ if (row == 84 && col==0) { Activate(CurPat); CurPat.StartPattern(); return; }
+ if (row == 85 && col==0) { bSustain=true; return; }
+
+ if (row == 52) { KeyPressed = col; return; }
+ println("row: " + row + " col: " + col);
+ }
+}
+//----------------------------------------------------------------------------------------------------------------------------------
+public class DPat extends SCPattern
+{
+ ArrayList picks = new ArrayList(); // should be ArrayList<Pick> picks = new ArrayList<Pick>();
+ ArrayList params = new ArrayList();
+ ArrayList bools = new ArrayList();
+ int nMaxRow = 53;
+ float zSpinHue = 0;
+ float LastQuant = -1, LastJog = -1;
+ float[] xWaveNz, yWaveNz;
+ int nPoint , nPoints;
+ xyz xyzJog = new xyz(), vT1 = new xyz(), vT2 = new xyz();
+ xyz modmin;
+
+ float NoiseMove = random(10000);
+ DParam pRotX, pRotY, pRotZ, pSpin, pSharp, pSaturate, pTransX, pTransY;
+
+ DBool pXsym, pYsym, pRsym, pXdup, pXtrip, pJog, pKey, pInvert;
+ 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)]); }
+
+ float CalcCone (xyz v1, xyz v2, xyz c) { vT1.set(v1); vT2.set(v2); vT1.subtract(c); vT2.subtract(c);
+ return degrees( acos ( vT1.dot(vT2) / (sqrt(vT1.dot(vT1)) * sqrt(vT2.dot(vT2)) ) )); }
+
+ void StartPattern() { }
+ void StartRun(double deltaMs) { }
+ color CalcPoint(xyz p) { return lx.hsb(0,0,0); }
+ boolean IsActive() { return this == DG.CurPat; }
+ boolean IsFocused() { return this == midiEngine.getFocusedDeck().getActivePattern(); }
+ void onInactive() { UpdateState(); }
+ void onActive () { UpdateState(); StartPattern(); }
+ void UpdateState() { if (IsFocused() != IsActive()) { if (IsFocused()) DG.Activate(this); else DG.Deactivate(this); } }
+ color blend3(color c1, color c2, color c3){ return blendColor(c1,blendColor(c2,c3,ADD),ADD); }
+
+ DParam addParam(String label, double value) {
+ DParam P = new DParam(label, value);
+ super.addParameter(P);
+ params.add(P); return P;