From: Ben Morrow Date: Mon, 19 Aug 2013 02:23:23 +0000 (-0700) Subject: Basic knob driving X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a1d396e5e60b812d1b7d0f250c7eff6a57706024;p=SugarCubes.git Basic knob driving --- diff --git a/BenMorrow.pde b/BenMorrow.pde index 8a1dd02..8b2b4f5 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -112,4 +112,41 @@ class GranimTestPattern2 extends GranimPattern } +}; + +class DriveableCrossSections extends CrossSections +{ + BasicParameter xd = new BasicParameter("XD", 1.0); + BasicParameter yd = new BasicParameter("YD", 1.0); + BasicParameter zd = new BasicParameter("ZD", 1.0); + + DriveableCrossSections(GLucose glucose) { + super(glucose); + } + + public void addParams() + { + addParameter(xd); + addParameter(yd); + addParameter(zd); + addParameter(xr); + addParameter(yr); + addParameter(zr); + addParameter(xw); + addParameter(xl); + addParameter(yl); + addParameter(zl); + addParameter(yw); + addParameter(zw); + } + + + + public void updateXYZVals() + { + xv = xd.getValuef(); + yv = yd.getValuef(); + zv = zd.getValuef(); + } + } \ No newline at end of file diff --git a/MarkSlee.pde b/MarkSlee.pde index 7b1b86b..f955f97 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -365,6 +365,11 @@ class CrossSections extends SCPattern { addModulator(x).trigger(); addModulator(y).trigger(); addModulator(z).trigger(); + addParams(); + } + + public void addParams() + { addParameter(xr); addParameter(yr); addParameter(zr); @@ -375,8 +380,8 @@ class CrossSections extends SCPattern { addParameter(yw); addParameter(zw); } - - void onParameterChanged(LXParameter p) { + + public void onParameterChanged(LXParameter p) { if (p == xr) { x.setDuration(10000 - 8800*p.getValuef()); } else if (p == yr) { @@ -386,10 +391,19 @@ class CrossSections extends SCPattern { } } + float xv; + float yv; + float zv; + + public void updateXYZVals() + { + xv = x.getValuef(); + yv = y.getValuef(); + zv = z.getValuef(); + } + public void run(int deltaMs) { - float xv = x.getValuef(); - float yv = y.getValuef(); - float zv = z.getValuef(); + updateXYZVals(); float xlv = 100*xl.getValuef(); float ylv = 100*yl.getValuef(); float zlv = 100*zl.getValuef(); diff --git a/SugarCubes.pde b/SugarCubes.pde index 4222846..7a03248 100644 --- a/SugarCubes.pde +++ b/SugarCubes.pde @@ -25,6 +25,7 @@ LXPattern[] patterns(GLucose glucose) { return new LXPattern[] { + new DriveableCrossSections(glucose), new GranimTestPattern2(glucose), new GranimTestPattern(glucose), new Sandbox(glucose),