- public boolean noteOnReceived (Note note) {
- if (CurPat == null) return false;
- int row = mapRow(note.getPitch()), col = note.getChannel();
-
- if (row == 50 && col == 0) { lx.tempo.trigger(); Tap1 = getNow(); return true; }
- else if (row == 82 && col == 0) { _XSym = !_XSym ; return true; }
- else if (row == 83 && col == 0) { _YSym = !_YSym ; return true; }
- else if (row == 84 && col == 0) { _ZSym = !_ZSym ; return true; }
- else if (row == 85 && col == 0) { _RSym = !_RSym ; return true; }
- else {
- for (int i=0; i<CurPat.picks.size(); i++) { Pick P = (Pick)CurPat.picks.get(i);
- if (!btwn(row,P.StartRow,P.EndRow) ) continue;
- if (!btwn(col,0,NumApcCols-1) ) continue;
- if (!btwn((row-P.StartRow)*NumApcCols + col,0,P.NumPicks-1) ) continue;
- P.CurRow=row; P.CurCol=col; return true;
- }
- //println(row + " " + col);
- }
- return false;
- }
-}
-//----------------------------------------------------------------------------------------------------------------------------------
-public class DPat extends SCPattern
-{
- DGlobals DG = new DGlobals();
-
- ArrayList picks = new ArrayList();
- ArrayList paramlist = new ArrayList();
- int nMaxRow = 0;
- float zSpinHue = 0;
- int nPoint , nPoints;
- xyz xyzHalf = new xyz(.5,.5,.5),
- xyzdMax = new xyz(),
- xyzMid = new xyz();
-
- float NoiseMove = random(10000);
- _DhP pSharp, pRotX, pRotY, pRotZ;
- 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 int(100*constrain(a,0,1)); }
- float CalcCone (xyz v1, xyz v2, xyz c) { return degrees( acos ( v1.minus(c).dot(v2.minus(c)) /
- (sqrt(v1.minus(c).dot(v1.minus(c))) * sqrt(v2.minus(c).dot(v2.minus(c))) ) )); }
- void StartRun(double deltaMs) { }
- color CalcPoint(xyz p) { return color(0,0,0); }
- boolean IsActive() { return this == DG.CurPat; }
- void onInactive() { DG.Deactivate(this); }
- void onActive () { DG.Activate(this); }
-
- _DhP addParam(String label, double value) {
- _DhP P = new _DhP(label, value);
- super.addParameter(P);
- paramlist.add(P); return P;
- }
-
- Pick addPick(String name, int def, int nmax, String[] desc) {
- Pick P = new Pick(name, def, nmax, desc);
- P.StartRow = nMaxRow;
- P.EndRow = P.StartRow + int((nmax-1) / NumApcCols);
- nMaxRow = P.EndRow + 1;
- P.CurCol = def % NumApcCols;
- P.CurRow = P.StartRow + def / NumApcCols;
- picks.add(P);
- return P;