From a22015f47ca6e4286137ed2a449cde23bb8c3a10 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Tue, 25 Feb 2014 12:55:19 -0800 Subject: [PATCH] No more SCEffect or SCTransition --- DanKaminsky.pde | 12 +++--- MarkSlee.pde | 108 +++++++---------------------------------------- SugarCubes.pde | 18 ++++---- code/GLucose.jar | Bin 3986 -> 3298 bytes 4 files changed, 30 insertions(+), 108 deletions(-) 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 c7c05bd85190eedbd65f10a137fe08ba00d04d55..4855034f84828b470511fbd54ba540dcfd295c12 100755 GIT binary patch delta 150 zcmbOv|45Q2z?+$ci-CcIfx#(lB9A7MW77oDXQ9e?8n~x11bZ8t|F36FS)n}^PT3@FZcl@bRxXI?y+4oXQ-)jGP{W2%& zuEwqD)>-*0KCnHV+*4L|wf)`&fdrFW=XPOkKi*ljuF1*!Y{oD~$691{vvU*N< z_m+rdm1mdT%usfZel6;^am&R2y{U`q=BCb`qI0iR=I!b76Pji%C4BQzxLPd*t{f6& zE19!H`--&kx5(y5>2pUPc=bMdBD;L|q29^-d+e3>!@`k+0T@v0I1-rZA>j(*N4kVF z7Hm2T3@8&|fJvbQSV&P~UU6ngW_}(d(5%1aU$XqeF0=pN9 zsOj8>z%(}b6t@YGH;E?zBo@Tun1U^d0Rs&TmNYH`rd8|-4q+K2)YrU-7c^yJVEE0< zz#tAY07x%sJjgkDABSWdx(4)Ug6Ub(sLg|HDSD&@c(byB)N%r$570sbUJwre3MVs5 -- 2.34.1