From: bb3dan Date: Sat, 28 Sep 2013 00:22:12 +0000 (-0400) Subject: final changes X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=af83f61c0f331ebf802fa6b01fa37af834fb684f;p=SugarCubes.git final changes --- diff --git a/DanHorwitz.pde b/DanHorwitz.pde index 0f987bf..6c46e69 100755 --- a/DanHorwitz.pde +++ b/DanHorwitz.pde @@ -51,24 +51,24 @@ public class Noise extends DPat int CurAnim, iSymm; int XSym=1,YSym=2,RadSym=3; float zTime , zTheta=0, zSin, zCos, rtime, ttime, transAdd; - DParam pSpeed , pDensity, pRotZ; + DParam pSpeed , pDensity; Pick pChoose, pSymm; int _ND = 4; NDat N[] = new NDat[_ND]; Noise(GLucose glucose) { super(glucose); - pRotZ = addParam("RotZ" , .5 ); pSpeed = addParam("Fast", .55); - pDensity= addParam("Dens" , .5); - pSymm = addPick("Symmetry" , 0, 3, new String[] {"None", "X", "Y", "Radial"} ); - pChoose = addPick("Animation", 6, 7, new String[] {"Drip", "Cloud", "Rain", "Fire", "Machine", "Spark","VWave", "Wave"} ); + pSpeed = addParam("Fast" , .55); + pDensity = addParam("Dens" , .5); + pSymm = addPick("Symmetry" , 0, 3, new String[] {"None", "X", "Y", "Radial"} ); + pChoose = addPick("Animation", 6, 7, new String[] {"Drip", "Cloud", "Rain", "Fire", "Machine", "Spark","VWave", "Wave"} ); for (int i=0; i<_ND; i++) N[i] = new NDat(); } void StartPattern() { zTime = random(500); zTheta=0; rtime = 0; ttime = 0; transAdd=0; } void StartRun(double deltaMs) { zTime += deltaMs*(pSpeed.Val()-.5)*.002 ; - zTheta += deltaMs*(pRotZ .Val()-.5)*.01 ; + zTheta += deltaMs*(pSpin .Val()-.5)*.01 ; rtime += deltaMs; iSymm = pSymm.Cur(); transAdd = 1*(1 - constrain(rtime - ttime,0,1000)/1000); @@ -77,8 +77,8 @@ public class Noise extends DPat if (pChoose.Cur() != CurAnim) { CurAnim = pChoose.Cur(); ttime = rtime; - pRotZ .reset(); zTheta = 0; - pDensity .reset(); pSpeed .reset(); + pSpin .reset(); zTheta = 0; + pDensity .reset(); pSpeed .reset(); for (int i=0; i<_ND; i++) { N[i].isActive = false; } switch(CurAnim) { @@ -160,7 +160,6 @@ public class Play extends DPat int nBeats = 0; DParam pAmp, pRadius, pBounce; - DParam pRotX, pRotY, pRotZ; float t,amp,rad,bnc; @@ -176,15 +175,11 @@ public class Play extends DPat float LastBeat=3, LastMeasure=3; int CurRandTempo = 1, CurRandTPat = 1; - - Pick pTimePattern, pTempoMult, pShape, pForm; + Pick pTimePattern, pTempoMult, pShape; int RandCube; Play(GLucose glucose) { super(glucose); - pRotX = addParam("RotX", .5); - pRotY = addParam("RotY", .5); - pRotZ = addParam("RotZ", .5); pRadius = addParam("Rad" , .1 ); pBounce = addParam("Bnc" , .2 ); pAmp = addParam("Amp" , .2 ); @@ -193,7 +188,6 @@ public class Play extends DPat "Pyramid", "Wings", "W2", "Clock", "Triangle", "Quad", "Sphere", "Cone", "Noise", "Wave", "?", "?"} ); - pForm = addPick ("Form" , 2 , 2 , new String[] {"Bar", "Volume", "Fade"} ); } public class rWave { @@ -245,15 +239,19 @@ public class Play extends DPat w.move(deltaMs); if (w.bDone) waves.remove(i); else i++; } - if (t-1) { waves.add(new rWave( - random(1), // location + pKey.b ? map(DG.KeyPressed,0,7,0,1) : random(1), // location bnc*10, // bounciness 7, // velocity 2*(1-amp))); // dampiness + DG.KeyPressed=-1; if (waves.size() > 5) waves.remove(0); + } + + if (t .5?1:0)); - case 1: return color(0,0,c1c(Pn.y < V.y ?1:0)); - case 2: return color(0,0,c1c(1 - V.distance(Pn)/rad)); - - default: return color(0,0,c1c(Pn.y < V.y ?1:0)); - } + return color(0,0,c1c(1 - V.distance(Pn)/rad)); } } //---------------------------------------------------------------------------------------------------------------------------------- diff --git a/DanUtil.pde b/DanUtil.pde index 9ae6f19..9bc5218 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -113,10 +113,11 @@ public class DGlobals { MidiOutput APCOut = null; MidiInput APCIn = null, OxygenIn = null; DPat CurPat = null; + int KeyPressed = -1; float Sliders[] = new float [] {1,0,0,0,0,0,0,0}; - String SliderText[] = new String[] {"Level", "SpinHue", "Spark", "Xwave", "Ywave", "Trails", "??", "??", "??"}; + String SliderText[] = new String[] {"Level", "SpinHue", "Spark", "Xwave", "Ywave", "Trails", "Quant", "??", "??"}; void SetNoteOn (int row, int col, int clr){ if (APCOut != null) APCOut.sendNoteOn (col, row, clr); } void SetNoteOff (int row, int col, int clr){ if (APCOut != null) APCOut.sendNoteOff (col, row, clr); } @@ -126,12 +127,13 @@ public class DGlobals { Pick GetPick (int i) { return (Pick) CurPat.picks .get(i); } DParam GetParam(int i) { return (DParam) CurPat.params.get(i); } - float _Dim () { return Sliders[0]; } + float _Level () { return Sliders[0]; } float _SpinHue () { return Sliders[1]; } float _Spark () { return Sliders[2]; } float _XWave () { return Sliders[3]; } float _YWave () { return Sliders[4]; } float _Trails () { return Sliders[5]; } + float _Quantize () { return Sliders[6]; } void Init () { if (bInit) return; bInit=true; @@ -185,7 +187,8 @@ public class DGlobals { int row = note.getPitch(), col = note.getChannel(); for (int i=0; i 0) { float tRamp = (lx.tempo.rampf() % (1./pow(2,floor((1-fQuant) * 4)))); float f = LastQuant; LastQuant = tRamp; if (tRamp > f) return; @@ -293,6 +307,7 @@ public class DPat extends SCPattern for (Point p : model.points) { nPoint++; P.set(p); P.subtract(modmin); + P.subtract(pTrans); if (sprk > 0) { P.y += sprk*randctr(50); P.x += sprk*randctr(50); P.z += sprk*randctr(50); } if (yWv > 0) P.y += interpWv(p.x-modmin.x, yWaveNz); if (xWv > 0) P.x += interpWv(p.y-modmin.y, xWaveNz); @@ -313,7 +328,7 @@ public class DPat extends SCPattern colors[p.index] = color( (hue(cNew) + zSpinHue) % 360, saturation(cNew) + 100*(fSaturate*2-1), - 100 * b * DG._Dim() + 100 * b * DG._Level() ); // colors[p.index] = color(0,0, p.fx >= modmin.x && p.fy >= modmin.y && p.fz >= modmin.z && diff --git a/_MIDI.pde b/_MIDI.pde index 623b2c0..68cc832 100644 --- a/_MIDI.pde +++ b/_MIDI.pde @@ -363,12 +363,17 @@ public class APC40MidiInput extends SCMidiInput { case 83: EFF_flash .trigger(); break; // Flash case 90: lx.tempo.trigger(); Tap1 = getNow(); break; // dan's dirty tapping mechanism + + case 91: // play + case 95: // bank + midiEngine.setFocusedDeck(0); + break; + + case 93: // rec case 94: // right bank midiEngine.setFocusedDeck(1); break; - case 95: // left bank - midiEngine.setFocusedDeck(0); - break; + case 96: // up bank if (shiftOn) { glucose.incrementSelectedEffectBy(1); @@ -398,8 +403,7 @@ public class APC40MidiInput extends SCMidiInput { lx.tempo.setBpm(lx.tempo.bpm() - (shiftOn ? 1 : .1)); break; - case 91: // play - case 93: // rec + case 62: // Detail View releaseEffect = glucose.getSelectedEffect(); if (releaseEffect.isMomentary()) { releaseEffect.enable(); @@ -408,7 +412,7 @@ public class APC40MidiInput extends SCMidiInput { } break; - case 92: // stop + case 63: // rec quantize glucose.getSelectedEffect().disable(); break; } @@ -426,14 +430,15 @@ public class APC40MidiInput extends SCMidiInput { } break; - case 93: // rec + + case 63: // rec quantize if (releaseEffect != null) { if (releaseEffect.isMomentary()) { releaseEffect.disable(); } } break; - + case 98: // shift shiftOn = false; break;