diff --git a/effects.pde b/effects.pde index ea64009..6d2c4a6 100644 --- a/effects.pde +++ b/effects.pde @@ -45,27 +45,27 @@ class WEBCAM extends Shader { params.add(new Param("saturation", FLOATVAL, 0.0, 1.0, new int[]{TRIANG, SINE, RAMPUPDOWN })); params.add(new Param("blend mode", INTVAL, 0, this.blends.length-1, new int[]{RANDOM })); params.add(new Param("webcam", INTVAL, 0, Capture.list().length-1, new int[]{TRIANG, SINE, RAMPUPDOWN, })); - camSelected = (int)params.get(13).value; - camSelectedPrev = (int)params.get(13).value; + camSelected = (int)params.get(13).getValue(); + camSelectedPrev = (int)params.get(13).getValue(); } void apply() { rw = canvas.width; rh = canvas.height; - x = int(params.get(0).value*rw); - y = int(params.get(1).value*rh); - w = int(params.get(2).value*(rw*2)); - h = int(params.get(3).value*(rh*2)); + x = int(params.get(0).getValue()*rw); + y = int(params.get(1).getValue()*rh); + w = int(params.get(2).getValue()*(rw*2)); + h = int(params.get(3).getValue()*(rh*2)); - camSelected = (int)params.get(13).value; + camSelected = (int)params.get(13).getValue(); /* if (camSelected != camSelectedPrev) { - currentCam = camSelected; - camSelectedPrev = camSelected; - stopWebcam(); - startWebcam(); - //new Capture(this, 1920,1080, Capture.list()[camSelected]); - }*/ + currentCam = camSelected; + camSelectedPrev = camSelected; + stopWebcam(); + startWebcam(); + //new Capture(this, 1920,1080, Capture.list()[camSelected]); + }*/ @@ -100,12 +100,12 @@ class ASDFPIXELSORT extends Shader { } int previousMode; void apply() { - if (previousMode != int(params.get(1).value)) { - if (params.get(1).value == 0) changeParam(0, new Param("black", INTVAL, -17000000, -2000000, new int[]{SINE, SAWTOOTH, RAMPUPDOWN, TAN, TANINVERSE, TRIANG})); - if (params.get(1).value == 1) changeParam(0, new Param("brightness", INTVAL, 0, 200, new int[]{SINE, SAWTOOTH, RAMPUPDOWN, TAN, TANINVERSE, TRIANG})); - if (params.get(1).value == 2) changeParam(0, new Param("white", INTVAL, -15000000, -700000, new int[]{SINE, SAWTOOTH, RAMPUPDOWN, TAN, TANINVERSE, TRIANG})); + if (previousMode != int(params.get(1).getValue())) { + if (params.get(1).getValue() == 0) changeParam(0, new Param("black", INTVAL, -17000000, -2000000, new int[]{SINE, SAWTOOTH, RAMPUPDOWN, TAN, TANINVERSE, TRIANG})); + if (params.get(1).getValue() == 1) changeParam(0, new Param("brightness", INTVAL, 0, 200, new int[]{SINE, SAWTOOTH, RAMPUPDOWN, TAN, TANINVERSE, TRIANG})); + if (params.get(1).getValue() == 2) changeParam(0, new Param("white", INTVAL, -15000000, -700000, new int[]{SINE, SAWTOOTH, RAMPUPDOWN, TAN, TANINVERSE, TRIANG})); } - previousMode = (int)params.get(1).value; + previousMode = (int)params.get(1).getValue(); row = 0; column = 0; @@ -134,7 +134,7 @@ class ASDFPIXELSORT extends Shader { int y = row; int xend = 0; while (xend < canvas.width-1) { - switch((int)params.get(1).value) { + switch((int)params.get(1).getValue()) { case 0: x = getFirstNotBlackX(x, y); xend = getNextBlackX(x, y); @@ -179,7 +179,7 @@ class ASDFPIXELSORT extends Shader { int yend = 0; while (yend < canvas.height-1) { - switch((int)params.get(1).value) { + switch((int)params.get(1).getValue()) { case 0: y = getFirstNotBlackY(x, y); yend = getNextBlackY(x, y); @@ -222,7 +222,7 @@ class ASDFPIXELSORT extends Shader { int x = _x; int y = _y; color c; - while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).getValue()) { x++; if (x >= canvas.width) return -1; } @@ -233,7 +233,7 @@ class ASDFPIXELSORT extends Shader { int x = _x+1; int y = _y; color c; - while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).getValue()) { x++; if (x >= canvas.width) return canvas.width-1; } @@ -245,7 +245,7 @@ class ASDFPIXELSORT extends Shader { int x = _x; int y = _y; color c; - while (brightness (c = canvas.pixels[x + y * canvas.width]) < params.get(0).value) { + while (brightness (c = canvas.pixels[x + y * canvas.width]) < params.get(0).getValue()) { x++; if (x >= canvas.width) return -1; } @@ -256,7 +256,7 @@ class ASDFPIXELSORT extends Shader { int x = _x+1; int y = _y; color c; - while (brightness (c = canvas.pixels[x + y * canvas.width]) > params.get(0).value) { + while (brightness (c = canvas.pixels[x + y * canvas.width]) > params.get(0).getValue()) { x++; if (x >= canvas.width) return canvas.width-1; } @@ -268,7 +268,7 @@ class ASDFPIXELSORT extends Shader { int x = _x; int y = _y; color c; - while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).getValue()) { x++; if (x >= canvas.width) return -1; } @@ -279,7 +279,7 @@ class ASDFPIXELSORT extends Shader { int x = _x+1; int y = _y; color c; - while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).getValue()) { x++; if (x >= canvas.width) return canvas.width-1; } @@ -293,7 +293,7 @@ class ASDFPIXELSORT extends Shader { int y = _y; color c; if (y < canvas.height) { - while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).getValue()) { y++; if (y >= canvas.height) return -1; } @@ -306,7 +306,7 @@ class ASDFPIXELSORT extends Shader { int y = _y+1; color c; if (y < canvas.height) { - while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).getValue()) { y++; if (y >= canvas.height) return canvas.height-1; } @@ -320,7 +320,7 @@ class ASDFPIXELSORT extends Shader { int y = _y; color c; if (y < canvas.height) { - while (brightness (c = canvas.pixels[x + y * canvas.width]) < params.get(0).value) { + while (brightness (c = canvas.pixels[x + y * canvas.width]) < params.get(0).getValue()) { y++; if (y >= canvas.height) return -1; } @@ -333,7 +333,7 @@ class ASDFPIXELSORT extends Shader { int y = _y+1; color c; if (y < canvas.height) { - while (brightness (c = canvas.pixels[x + y * canvas.width]) > params.get(0).value) { + while (brightness (c = canvas.pixels[x + y * canvas.width]) > params.get(0).getValue()) { y++; if (y >= canvas.height) return canvas.height-1; } @@ -347,7 +347,7 @@ class ASDFPIXELSORT extends Shader { int y = _y; color c; if (y < canvas.height) { - while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) > params.get(0).getValue()) { y++; if (y >= canvas.height) return -1; } @@ -360,7 +360,7 @@ class ASDFPIXELSORT extends Shader { int y = _y+1; color c; if (y < canvas.height) { - while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).value) { + while ( (c = canvas.pixels[x + y * canvas.width]) < params.get(0).getValue()) { y++; if (y >= canvas.height) return canvas.height-1; } @@ -451,18 +451,24 @@ class DISTORTER extends Shader { buffer = canvas.get(); buffer.resize(canvas.width, canvas.height); - float neww = map(params.get(0).value, 2, initBufferW-2, 2, buffer.width/4-2); - float newh = map(params.get(1).value, 2, initBufferH-2, 2, buffer.height/4-2); + float neww = map(params.get(0).getValue(), 2, initBufferW-2, 2, buffer.width/4-2); + float newh = map(params.get(1).getValue(), 2, initBufferH-2, 2, buffer.height/4-2); - - do_blend = boolean(int(params.get(2).value)); - shift_amt = params.get(3).value; - scalex = params.get(4).value; - scaley = params.get(5).value; - blend_mode = blends[(int)params.get(6).value]; - channel = (int)params.get(7).value; - + /* + do_blend = boolean(int(params.get(2).getValue())); + shift_amt = params.get(3).getValue(); + scalex = params.get(4).getValue(); + scaley = params.get(5).getValue(); + blend_mode = blends[(int)params.get(6).getValue()]; + channel = (int)params.get(7).getValue(); + */ + do_blend = boolean(int(params.get(2).getValue())); + shift_amt = params.get(3).getValue(); + scalex = params.get(4).getValue(); + scaley = params.get(5).getValue(); + blend_mode = blends[(int)params.get(6).getValue()]; + channel = (int)params.get(7).getValue(); float totalnum = neww+newh; float times = (totalnum/floor(totalnum/neww)); @@ -636,12 +642,12 @@ class FM extends Shader { rw = canvas.width; - do_blend = boolean(int(params.get(0).value)); - blend_mode = blends[(int)params.get(1).value]; - omega = map(sqrt(params.get(2).value), 0, 1, min_omega, max_omega); - float phase = map(sq(params.get(3).value), 0, 1, min_phase_mult, max_phase_mult); - colorspace = (int)params.get(4).value; - quantval = (int) params.get(5).value; + do_blend = boolean(int(params.get(0).getValue())); + blend_mode = blends[(int)params.get(1).getValue()]; + omega = map(sqrt(params.get(2).getValue()), 0, 1, min_omega, max_omega); + float phase = map(sq(params.get(3).getValue()), 0, 1, min_phase_mult, max_phase_mult); + colorspace = (int)params.get(4).getValue(); + quantval = (int) params.get(5).getValue(); if (rw != canvas.width || rh != canvas.height) { @@ -830,7 +836,7 @@ class WZIP extends Shader { canvas.noStroke(); - if (boolean((int)params.get(3).value)) { ///////////////////// + if (boolean((int)params.get(3).getValue())) { ///////////////////// canvas.colorMode(HSB, 255); colorMode(HSB, 255); } else { @@ -838,8 +844,8 @@ class WZIP extends Shader { colorMode(RGB, 255); } - scalingfactorin = map(params.get(1).value, 0, 1, 0, params.get(0).value); ///////////////////// - scalingfactorout = map(params.get(2).value, 0, 1, 0, params.get(0).value); ///////////////////// + scalingfactorin = map(params.get(1).getValue(), 0, 1, 0, params.get(0).getValue()); ///////////////////// + scalingfactorout = map(params.get(2).getValue(), 0, 1, 0, params.get(0).getValue()); ///////////////////// @@ -849,7 +855,7 @@ class WZIP extends Shader { for (int x=0; x127?hue(c)-256:hue(c); g = saturation(c)>127?saturation(c)-256:saturation(c); b = brightness(c)>127?brightness(c)-256:brightness(c); @@ -895,7 +901,7 @@ class WZIP extends Shader { } - if (boolean((int)params.get(4).value)) option1(); ///////////////////// + if (boolean((int)params.get(4).getValue())) option1(); ///////////////////// else option2(); @@ -1035,7 +1041,7 @@ class AUECHO extends Shader { } void apply() { canvas.beginDraw(); - if (boolean((int)params.get(0).value)) { + if (boolean((int)params.get(0).getValue())) { canvas.colorMode(HSB); colorMode(HSB); } else { @@ -1044,12 +1050,12 @@ class AUECHO extends Shader { } canvas.loadPixels(); - float _delay = params.get(1).value; - float decay = params.get(2).value; + float _delay = params.get(1).getValue(); + float decay = params.get(2).getValue(); int delay = (int)(canvas.pixels.length * _delay); color[] history = new color[canvas.pixels.length]; - int blendMode =this.blends[(int)params.get(3).value]; + int blendMode =this.blends[(int)params.get(3).getValue()]; for ( int i = 0, l = canvas.pixels.length; i 0) colorMode(HSB); + if (params.get(3).getValue() > 0) colorMode(HSB); else { colorMode(RGB); } @@ -1709,7 +1715,7 @@ class AMPLIFY extends Shader { float h = hue(canvas.pixels[i]); float s = saturation(canvas.pixels[i]); float b = brightness(canvas.pixels[i]); - canvas.pixels[i] = color(h+params.get(0).value, s+params.get(1).value, b+params.get(2).value); + canvas.pixels[i] = color(h+params.get(0).getValue(), s+params.get(1).getValue(), b+params.get(2).getValue()); } canvas.updatePixels(); canvas.endDraw(); @@ -1741,14 +1747,14 @@ class BROKENCOLORROT extends Shader { } void apply() { canvas.beginDraw(); - if (params.get(3).value > 0) colorMode(HSB); + if (params.get(3).getValue() > 0) colorMode(HSB); else { colorMode(RGB); } canvas.loadPixels(); - float h = params.get(0).value; - float s = params.get(1).value; - float b = params.get(2).value; + float h = params.get(0).getValue(); + float s = params.get(1).getValue(); + float b = params.get(2).getValue(); for (int i = 0; i < canvas.width*canvas.height; i++) { h = hue(canvas.pixels[i])+h; if (h > 255) h -= 255; @@ -1779,7 +1785,7 @@ class POSTER extends Shader { params.add(new Param("levels", INTVAL, 2, 10, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); } void apply() { - levels = (int)params.get(0).value; + levels = (int)params.get(0).getValue(); canvas.beginDraw(); canvas.filter(POSTERIZE, levels); canvas.endDraw(); @@ -1809,7 +1815,7 @@ class DUAL extends Shader { buffer = createImage(canvas.width, canvas.height, ARGB); } void apply() { - switch((int)params.get(1).value) { + switch((int)params.get(1).getValue()) { case(0): dirx = 1; diry = 1; @@ -1827,13 +1833,13 @@ class DUAL extends Shader { diry = -1; break; } - dualColor = (int)params.get(0).value; + dualColor = (int)params.get(0).getValue(); buffer.resize(canvas.width, canvas.height); canvas.beginDraw(); canvas.imageMode(CORNER); canvas.loadPixels(); buffer.loadPixels(); - if ((int)params.get(2).value > 0) { + if ((int)params.get(2).getValue() > 0) { for (int i = 0; i < canvas.width*canvas.height; i++) { buffer.pixels[i] = canvas.pixels[i]+dualColor; } @@ -1867,17 +1873,17 @@ class GRAUZONE extends Shader { GRAUZONE() { name = "fxGrauzone"; params.add(new Param("delay (in frames)", INTVAL, 3, 100, new int[]{RANDOM})); - nFrames = (int)params.get(0).value; + nFrames = (int)params.get(0).getValue(); buffer = new PImage[nFrames]; } int nFramesPrev; void apply() { nFramesPrev = nFrames; - if (nFramesPrev != (int)params.get(0).value) { + if (nFramesPrev != (int)params.get(0).getValue()) { iWrite = 0; iRead = 1; int nFramesOld = nFrames; - nFrames = (int)params.get(0).value; + nFrames = (int)params.get(0).getValue(); if (nFrames > nFramesOld) { buffer = new PImage[nFrames]; } @@ -1933,10 +1939,10 @@ class COPYZOOM extends Shader { canvas.imageMode(CORNER); if (buffer.width != canvas.width || buffer.height != canvas.height) buffer.resize(canvas.width, canvas.height); buffer = canvas.get(); - coprw = int(map(params.get(0).value, 0, 1, 1, canvas.width)); - coprh = int(map(params.get(1).value, 0, 1, 1, canvas.height)); - coprx = int(map(params.get(2).value, 0, 1, 0, canvas.width-coprw)); - copry = int(map(params.get(3).value, 0, 1, 0, canvas.height-coprh)); + coprw = int(map(params.get(0).getValue(), 0, 1, 1, canvas.width)); + coprh = int(map(params.get(1).getValue(), 0, 1, 1, canvas.height)); + coprx = int(map(params.get(2).getValue(), 0, 1, 0, canvas.width-coprw)); + copry = int(map(params.get(3).getValue(), 0, 1, 0, canvas.height-coprh)); canvas.beginDraw(); buffer.copy(coprx, copry, coprw, coprh, 0, 0, canvas.width, canvas.height); canvas.image(buffer, 0, 0, canvas.width, canvas.height); @@ -1987,10 +1993,10 @@ class SUBTLESORT extends Shader { } void apply() { - channel_weight = map(renderSize, 4, 15000, 0, 1.5)*params.get(0).value; - channel = (int)params.get(1).value; - direction = (int)params.get(2).value; - mode = (int)params.get(3).value; + channel_weight = map(renderSize, 4, 15000, 0, 1.5)*params.get(0).getValue(); + channel = (int)params.get(1).getValue(); + direction = (int)params.get(2).getValue(); + mode = (int)params.get(3).getValue(); canvas.beginDraw(); canvas.noStroke(); @@ -2089,10 +2095,10 @@ class SCANKER extends Shader { directionParamIndex = 4; } void apply() { - mode = (int)params.get(3).value; + mode = (int)params.get(3).getValue(); canvas.beginDraw(); canvas.loadPixels(); - float factor = params.get(0).value + params.get(1).value + params.get(2).value; + float factor = params.get(0).getValue() + params.get(1).getValue() + params.get(2).getValue(); if (mode == 0) { for (int i = 0; i < canvas.width*canvas.height; i++) { // canvas.pixels[i] = canvas.pixels[i]+((i/1000)*scankMulti); @@ -2150,14 +2156,14 @@ class MASK extends Shader { if (foreground.width != canvas.width || foreground.height != canvas.height) foreground.resize(canvas.width, canvas.height); - backgroundLayer = (int)params.get(0).value; - maskLayer = (int)params.get(1).value; - invert = (int)params.get(2).value; - bandwidth = (int)params.get(3).value; - val = (int)params.get(4).value; - chan = (int)params.get(5).value; - do_blend = boolean((int)params.get(6).value); - blend_mode = blends[(int)params.get(7).value]; + backgroundLayer = (int)params.get(0).getValue(); + maskLayer = (int)params.get(1).getValue(); + invert = (int)params.get(2).getValue(); + bandwidth = (int)params.get(3).getValue(); + val = (int)params.get(4).getValue(); + chan = (int)params.get(5).getValue(); + do_blend = boolean((int)params.get(6).getValue()); + blend_mode = blends[(int)params.get(7).getValue()]; if (backgroundLayer <= 0) { background.resize(source.width, source.height); @@ -2296,13 +2302,13 @@ class DRAWSTROKES extends Shader { int rw, rh; void apply() { - stat_type = (int)params.get(0).value; - stroke_len = (int)params.get(1).value; - angles_no = (int)params.get(2).value; - segments = (int)params.get(3).value; - stroke_width = params.get(4).value; - stroke_alpha = (int)params.get(5).value; - iterations = (int)params.get(6).value; + stat_type = (int)params.get(0).getValue(); + stroke_len = (int)params.get(1).getValue(); + angles_no = (int)params.get(2).getValue(); + segments = (int)params.get(3).getValue(); + stroke_width = params.get(4).getValue(); + stroke_alpha = (int)params.get(5).getValue(); + iterations = (int)params.get(6).getValue(); if (rw != canvas.width || rh != canvas.height) { //doesnt account image swap len = (canvas.width sketchClass; VideoExport videoExport; +AudioIn audioIn; +Amplitude loudness; +float volume; +float volumeRoof = 1.0; + int maxFx = 15; //possible amount of effect layers SDrop drop; PImage source; diff --git a/secondapplet.pde b/secondapplet.pde index 9fbe0c1..6a14e9c 100644 --- a/secondapplet.pde +++ b/secondapplet.pde @@ -185,8 +185,7 @@ public class SecondApplet extends PApplet { //audioindicator fill(map(volume,0,0.5,0,255)); noStroke(); - ellipse(260,15,15,15); - + ellipse(260,height-105,15,15); } boolean heightOverLimit; @@ -389,7 +388,11 @@ public class SecondApplet extends PApplet { for (int i = 0; i < slider.size(); i++) { if (slider.get(i).hovering || slider.get(i).hovering_anim_btn) sliderHover = true; if (paused && slider.get(i).animated) paused = false; + + params.get(i).audioMulti = slider.get(i).audioVal * volume * 2; + } + if (mouseX > 10 && mouseX < 22 && mouseY > 4+totalBrickHeight+scrollAmount && mouseY < 4+totalBrickHeight+13+scrollAmount) { hoverActiveButton = true; @@ -421,8 +424,12 @@ public class SecondApplet extends PApplet { } for (int i = 0; i < slider.size(); i++) { - slider.get(i).update(); + //params.get(i).value = slider.get(i).value; + + //* map(volume,0,1,0.8,1.2); + //slider.get(i).value = map(volume,0,1,0.8,1.2) * slider.get(i).value; params.get(i).value = slider.get(i).value; + slider.get(i).update(); } brickBGcol = color(85, 85, 85); } @@ -484,8 +491,8 @@ public class SecondApplet extends PApplet { class Slider { int x, y, w, h, mode; int[] osciModes; - float minVal, maxVal, value; //should be private but doesnt work lol - boolean hovering, hovering_anim_btn, animated; + float minVal, maxVal, value, audioVal; //should be private but doesnt work lol + boolean hovering, hovering_anim_btn,hovering_audio_slider, animated; String label; Oscillator osci; @@ -503,7 +510,8 @@ public class SecondApplet extends PApplet { osci = new Oscillator(int(random(2, 5)), osciModes); osci.amplitude(minVal, maxVal); osci.update(); - setValue(osci.value); + //setValue(osci.value); + setValue((minVal+maxVal)/2); animated = true; @@ -546,14 +554,17 @@ public class SecondApplet extends PApplet { void update() { + //float audioImpact = (audioVal * volume) + 1; + //setValue(value*(1+audioVal)); - - osci.update(); + // osci.update(); if (animated) { + + osci.update(); setValue(osci.value); } - + if (mouseX >= x && mouseX <= x+w && mouseY >= y+scrollAmount && mouseY <= y+h+scrollAmount) { hovering = true; @@ -566,6 +577,12 @@ public class SecondApplet extends PApplet { } else { hovering_anim_btn = false; } + + if (mouseX >= x+w+20 && mouseX <= x+w+35 && mouseY >= y+scrollAmount && mouseY <= y+h+scrollAmount) { + hovering_audio_slider = true; + } else { + hovering_audio_slider = false; + } } void display() { @@ -585,6 +602,11 @@ public class SecondApplet extends PApplet { fill(100+(40*int(hovering_anim_btn))); } rect(x+w+5, y, h, h); + + stroke(255); + line(x+w+5+h+10,y, x+w+5+h+10, y+h); + + line(x+w+5+h+5, y+h-(audioVal*h), x+w+5+h+15, y+h-(audioVal*h)); } } @@ -650,6 +672,9 @@ public class SecondApplet extends PApplet { Slider s = slider.get(i); if (s.hovering) s.press(i); if (s.hovering_anim_btn) s.animated = !s.animated; + if (s.hovering_audio_slider){ + s.audioVal = map(mouseY-(s.y+scrollAmount),0,12,1,0); + } } for (int i = bricks.size()-1; i >= 0; i--) { if (bricks.get(i).hovering) { @@ -729,12 +754,10 @@ public class SecondApplet extends PApplet { } textSize(10); - if (mouseX > 245 && mouseY < 30) { - volumeRoof -= float(event.getCount())/1000; - if(volumeRoof > 1.0) volumeRoof = 1; - if(volumeRoof < 0.0) volumeRoof = 0; - println(volume); - println(volumeRoof); + if (mouseX > 245 && mouseY < height-90 && mouseY > height-120) { + volumeRoof -= float(event.getCount())/100; + if(volumeRoof > 100) volumeRoof = 100; + if(volumeRoof <= 0.01) volumeRoof = 0.01; } } int numberTypedFrame; diff --git a/shader.pde b/shader.pde index 4d0212c..b601f5e 100644 --- a/shader.pde +++ b/shader.pde @@ -3,6 +3,7 @@ class Param { int type; float minValue, maxValue; float value; + float audioMulti; int[] osciModes; Param(String name_, int type_, float minValue_, float maxValue_, int[] osciModes_) { name = name_; @@ -11,6 +12,9 @@ class Param { maxValue = maxValue_; osciModes = osciModes_; } + float getValue(){ + return(value + ((maxValue-minValue) * audioMulti)); //wenn man so auch die automation-values handhabt, kann man mit automatisierten slidern besser spielen .. mayb + } } class Shader { @@ -59,6 +63,8 @@ class Shader { paramChanged = true; } previousPos = pos; + + if(volume > 0) paramChanged = true; try{ if (previousActive != gui.bricks.get(pos).active) { //fails if brick has not yet been loaded but shader has @@ -86,7 +92,7 @@ class Shader { gui.bricks.get(pos).exchangeSlider(paramNo, newParam); paramChanged = true; } - + void shade() { if (renderSizeChanged || paramChanged) { this.setupCanvas();