X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=DanUtil.pde;h=4ce685ad68f0d63e56d08e1a366378f80700e63f;hb=73687629fdcb02aa7c0a7c605319252da07f91d7;hp=9bc52185541638b619efa11955527ccd8f34eb4c;hpb=af83f61c0f331ebf802fa6b01fa37af834fb684f;p=SugarCubes.git diff --git a/DanUtil.pde b/DanUtil.pde index 9bc5218..4ce685a 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -114,6 +114,7 @@ public class DGlobals { MidiInput APCIn = null, OxygenIn = null; DPat CurPat = null; int KeyPressed = -1; + boolean bSustain = false; float Sliders[] = new float [] {1,0,0,0,0,0,0,0}; @@ -144,6 +145,7 @@ public class DGlobals { boolean isFocused () { return CurPat != null && CurPat == midiEngine.getFocusedDeck().getActivePattern(); } void Deactivate (DPat p) { if (p != CurPat) return; uiDebugText.setText(""); CurPat = null; } void Activate (DPat p) { + bSustain = false; CurPat = p; while (lx.tempo.bpm() > 40) lx.tempo.setBpm(lx.tempo.bpm()/2); for (int i=0; i0) b = b < .5 ? pow(b,fSharp) : 1-pow(1-b,fSharp); if (DG._Trails()>0 && fQuant == 0) b = max(b, (float) (brightness(cOld)/100. - (1-DG._Trails()) * deltaMs/200.)); + if (DG.bSustain == true) b = max(b, (float) (brightness(cOld)/100.)); + + if (pInvert.b) { b = 1-b; s = 1-s; } colors[p.index] = color( (hue(cNew) + zSpinHue) % 360, - saturation(cNew) + 100*(fSaturate*2-1), + s, 100 * b * DG._Level() );