From: Mark Slee Date: Tue, 25 Feb 2014 20:55:19 +0000 (-0800) Subject: No more SCEffect or SCTransition X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a22015f47ca6e4286137ed2a449cde23bb8c3a10;p=SugarCubes.git No more SCEffect or SCTransition --- diff --git a/DanKaminsky.pde b/DanKaminsky.pde index 8e236a2..87bfa3b 100644 --- a/DanKaminsky.pde +++ b/DanKaminsky.pde @@ -75,9 +75,9 @@ OscP5 listener; // -class ObjectMuckerEffect extends SCEffect { - ObjectMuckerEffect(GLucose glucose) { - super(glucose); +class ObjectMuckerEffect extends LXEffect { + ObjectMuckerEffect(LX lx) { + super(lx); } public void apply(int[] colors){ /*for(Strip s: model.strips){ @@ -90,13 +90,13 @@ class ObjectMuckerEffect extends SCEffect { } } -class BlendFrames extends SCEffect { +class BlendFrames extends LXEffect { int fcount; int frames[][]; int maxfbuf; int blendfactor; - BlendFrames(GLucose glucose) { - super(glucose); + BlendFrames(LX lx) { + super(lx); maxfbuf = 30; blendfactor=30; fcount=0; diff --git a/MarkSlee.pde b/MarkSlee.pde index 7ccf8aa..d4ee633 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -694,12 +694,12 @@ class Swarm extends SCPattern { } } -class SwipeTransition extends SCTransition { +class SwipeTransition extends LXTransition { final BasicParameter bleed = new BasicParameter("WIDTH", 0.5); - SwipeTransition(GLucose glucose) { - super(glucose); + SwipeTransition(LX lx) { + super(lx); setDuration(5000); addParameter(bleed); } @@ -720,84 +720,6 @@ class SwipeTransition extends SCTransition { } } -abstract class BlendTransition extends SCTransition { - - final int blendType; - - BlendTransition(GLucose glucose, int blendType) { - super(glucose); - this.blendType = blendType; - } - - void computeBlend(int[] c1, int[] c2, double progress) { - if (progress < 0.5) { - for (int i = 0; i < c1.length; ++i) { - colors[i] = lerpColor( - c1[i], - blendColor(c1[i], c2[i], blendType), - (float) (2.*progress), - RGB); - } - } else { - for (int i = 0; i < c1.length; ++i) { - colors[i] = lerpColor( - c2[i], - blendColor(c1[i], c2[i], blendType), - (float) (2.*(1. - progress)), - RGB); - } - } - } -} - -class MultiplyTransition extends BlendTransition { - MultiplyTransition(GLucose glucose) { - super(glucose, MULTIPLY); - } -} - -class ScreenTransition extends BlendTransition { - ScreenTransition(GLucose glucose) { - super(glucose, SCREEN); - } -} - -class BurnTransition extends BlendTransition { - BurnTransition(GLucose glucose) { - super(glucose, BURN); - } -} - -class DodgeTransition extends BlendTransition { - DodgeTransition(GLucose glucose) { - super(glucose, DODGE); - } -} - -class OverlayTransition extends BlendTransition { - OverlayTransition(GLucose glucose) { - super(glucose, OVERLAY); - } -} - -class AddTransition extends BlendTransition { - AddTransition(GLucose glucose) { - super(glucose, ADD); - } -} - -class SubtractTransition extends BlendTransition { - SubtractTransition(GLucose glucose) { - super(glucose, SUBTRACT); - } -} - -class SoftLightTransition extends BlendTransition { - SoftLightTransition(GLucose glucose) { - super(glucose, SOFT_LIGHT); - } -} - class BassPod extends SCPattern { private GraphicEQ eq = null; @@ -908,7 +830,7 @@ class CubeEQ extends SCPattern { } } -class BoomEffect extends SCEffect { +class BoomEffect extends LXEffect { final BasicParameter falloff = new BasicParameter("WIDTH", 0.5); final BasicParameter speed = new BasicParameter("SPD", 0.5); @@ -945,8 +867,8 @@ class BoomEffect extends SCEffect { } } - BoomEffect(GLucose glucose) { - super(glucose, true); + BoomEffect(LX lx) { + super(lx, true); addParameter(falloff); addParameter(speed); addParameter(bright); @@ -1381,7 +1303,7 @@ class Traktor extends SCPattern { } } -class ColorFuckerEffect extends SCEffect { +class ColorFuckerEffect extends LXEffect { final BasicParameter level = new BasicParameter("BRT", 1); final BasicParameter desat = new BasicParameter("DSAT", 0); @@ -1394,8 +1316,8 @@ class ColorFuckerEffect extends SCEffect { float[] hsb = new float[3]; - ColorFuckerEffect(GLucose glucose) { - super(glucose); + ColorFuckerEffect(LX lx) { + super(lx); addParameter(level); addParameter(desat); addParameter(sharp); @@ -1450,14 +1372,14 @@ class ColorFuckerEffect extends SCEffect { } } -class QuantizeEffect extends SCEffect { +class QuantizeEffect extends LXEffect { color[] quantizedFrame; float lastQuant; final BasicParameter amount = new BasicParameter("AMT", 0); - QuantizeEffect(GLucose glucose) { - super(glucose); + QuantizeEffect(LX lx) { + super(lx); quantizedFrame = new color[glucose.lx.total]; lastQuant = 0; } @@ -1481,14 +1403,14 @@ class QuantizeEffect extends SCEffect { } } -class BlurEffect extends SCEffect { +class BlurEffect extends LXEffect { final BasicParameter amount = new BasicParameter("AMT", 0); final int[] frame; final LinearEnvelope env = new LinearEnvelope(0, 1, 100); - BlurEffect(GLucose glucose) { - super(glucose); + BlurEffect(LX lx) { + super(lx); addParameter(amount); addModulator(env); frame = new int[lx.total]; diff --git a/SugarCubes.pde b/SugarCubes.pde index 5fe3c7b..16e2402 100644 --- a/SugarCubes.pde +++ b/SugarCubes.pde @@ -132,11 +132,11 @@ LXPattern[] patterns(GLucose glucose) { LXTransition[] transitions(GLucose glucose) { return new LXTransition[] { new DissolveTransition(lx), - new AddTransition(glucose), - new MultiplyTransition(glucose), - new OverlayTransition(glucose), - new DodgeTransition(glucose), - new SwipeTransition(glucose), + new AddTransition(lx), + new MultiplyTransition(lx), + new OverlayTransition(lx), + new DodgeTransition(lx), + new SwipeTransition(lx), new FadeTransition(lx), // new SubtractTransition(glucose), // similar to multiply - dh // new BurnTransition(glucose), // similar to multiply - dh @@ -148,10 +148,10 @@ LXTransition[] transitions(GLucose glucose) { // Handles to globally triggerable effects class Effects { FlashEffect flash = new FlashEffect(lx); - BoomEffect boom = new BoomEffect(glucose); - BlurEffect blur = new BlurEffect(glucose); - QuantizeEffect quantize = new QuantizeEffect(glucose); - ColorFuckerEffect colorFucker = new ColorFuckerEffect(glucose); + BoomEffect boom = new BoomEffect(lx); + BlurEffect blur = new BlurEffect(lx); + QuantizeEffect quantize = new QuantizeEffect(lx); + ColorFuckerEffect colorFucker = new ColorFuckerEffect(lx); Effects() { blur.enable(); diff --git a/code/GLucose.jar b/code/GLucose.jar index c7c05bd..4855034 100755 Binary files a/code/GLucose.jar and b/code/GLucose.jar differ