X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=blobdiff_plain;f=TobySegaran.pde;h=8769b101ef17b728d1281d169bef79eb6aff036a;hp=82ad4d27c0d1ee337602e1e9a38df62a8f4b8349;hb=7d60f6f6ea82fd5c9794524ce11d40e7d6c00bf7;hpb=a41f334c045811daef7e319214da557b5e48143a diff --git a/TobySegaran.pde b/TobySegaran.pde index 82ad4d2..8769b10 100644 --- a/TobySegaran.pde +++ b/TobySegaran.pde @@ -7,8 +7,8 @@ class GlitchPlasma extends SCPattern { BasicParameter speedParameter = new BasicParameter("SPEED", 0.1); BasicParameter glitchParameter = new BasicParameter("GLITCH", 0.0); - public GlitchPlasma(GLucose glucose) { - super(glucose); + public GlitchPlasma(LX lx) { + super(lx); addParameter(saturationParameter); addParameter(speedParameter); addParameter(glitchParameter); @@ -24,7 +24,7 @@ class GlitchPlasma extends SCPattern { } public void run(double deltaMs) { - for (Point p : model.points) { + for (LXPoint p : model.points) { float hv = sin(dist(p.x + pos, p.y, 128.0, 128.0) / 8.0) + sin(dist(p.x, p.y, 64.0, 64.0) / 8.0) + sin(dist(p.x, p.y + pos / 7, 192.0, 64.0) / 7.0) @@ -49,8 +49,8 @@ class FireEffect extends SCPattern { private int ym; BasicParameter decayParameter = new BasicParameter("DECAY", 0.3); - public FireEffect(GLucose glucose) { - super(glucose); + public FireEffect(LX lx) { + super(lx); xm = int(model.xMax); ym = int(model.yMax); @@ -81,7 +81,7 @@ class FireEffect extends SCPattern { } } - for (Point p : model.points) { + for (LXPoint p : model.points) { int x = max(0,(int(p.x)+int(p.z))%xm); int y = constrain(ym-int(p.y),0,ym-1); colors[p.index] = flameColor(intensity[x][y]); @@ -97,8 +97,8 @@ class StripBounce extends SCPattern { SinLFO[] sat = new SinLFO[numOsc]; float[] colorOffset = new float[numOsc]; - public StripBounce(GLucose glucose) { - super(glucose); + public StripBounce(LX lx) { + super(lx); for (int i=0;ibright[p.index]) { colors[p.index] = lx.hsb(hv,sat[i].getValuef(),br); bright[p.index] = br; @@ -142,8 +142,8 @@ class SoundRain extends SCPattern { SinLFO col1 = new SinLFO(0, model.xMax, 5000); BasicParameter gainParameter = new BasicParameter("GAIN", 0.5); - public SoundRain(GLucose glucose) { - super(glucose); + public SoundRain(LX lx) { + super(lx); addModulator(pos).trigger(); addModulator(col1).trigger(); addParameter(gainParameter); @@ -154,7 +154,7 @@ class SoundRain extends SCPattern { gain = 50*parameter.getValuef(); } } - protected void onActive() { + void onActive() { if (this.fft == null) { this.fft = new FFT(lx.audioInput().bufferSize(), lx.audioInput().sampleRate()); this.fft.window(FFT.HAMMING); @@ -184,7 +184,7 @@ class SoundRain extends SCPattern { for (int j=0; javgSize) seq=avgSize-seq;