X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=DanUtil.pde;h=7eca742f3933413336926f3aa12418b1e07dcb25;hb=ba190564c9813abcffa6a6225796e720398a182f;hp=9bc52185541638b619efa11955527ccd8f34eb4c;hpb=af83f61c0f331ebf802fa6b01fa37af834fb684f;p=SugarCubes.git diff --git a/DanUtil.pde b/DanUtil.pde index 9bc5218..7eca742 100644 --- a/DanUtil.pde +++ b/DanUtil.pde @@ -67,10 +67,10 @@ public class DParam extends BasicParameter { //---------------------------------------------------------------------------------------------------------------------------------- public class xyz { float x,y,z; xyz() {x=y=z=0;} - xyz(Point p ) {x=p.fx ; y=p.fy; z=p.fz;} + xyz(Point p ) {x=p.x ; y=p.y; z=p.z;} xyz(xyz p ) {set(p); } xyz(float _x,float _y,float _z) {x=_x ; y=_y ; z=_z ;} - void set(Point p ) {x=p.fx ; y=p.fy; z=p.fz;} + void set(Point p ) {x=p.x ; y=p.y; z=p.z;} void set(xyz p ) {x=p.x ; y=p.y ; z=p.z ;} void set(float _x,float _y,float _z) {x=_x ; y=_y ; z=_z ;} @@ -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() ); -// colors[p.index] = color(0,0, p.fx >= modmin.x && p.fy >= modmin.y && p.fz >= modmin.z && -// p.fx <= modmin.x+mMax.x && p.fy <= modmin.y+mMax.y && p.fz <= modmin.z+mMax.z ? 100 : 0); +// colors[p.index] = color(0,0, p.x >= modmin.x && p.y >= modmin.y && p.z >= modmin.z && +// p.x <= modmin.x+mMax.x && p.y <= modmin.y+mMax.y && p.z <= modmin.z+mMax.z ? 100 : 0); } } } -//---------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +//----------------------------------------------------------------------------------------------------------------------------------