From 29d8acbb812206793be02523854cc34dfd73c592 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Thu, 24 Oct 2013 23:30:49 -0700 Subject: [PATCH] Bug fixes and new mapping for sub --- MarkSlee.pde | 19 ++++++++++++++++--- _MIDI.pde | 21 ++++++++++++++++++++- _Mappings.pde | 10 +++++----- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/MarkSlee.pde b/MarkSlee.pde index 58b0ea6..928f7ab 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -21,6 +21,12 @@ class MidiMusic extends SCPattern { addModulator(sparkle).setValue(1); } + void onReset() { + for (LightUp light : lights) { + light.noteOff(null); + } + } + class Sweep extends LXLayer { final LinearEnvelope position = new LinearEnvelope(0, 1, 1000); @@ -145,6 +151,12 @@ class MidiMusic extends SCPattern { sparkleDirection = false; sparkle.trigger(); break; + case 39: + effects.boom.trigger(); + break; + case 40: + effects.flash.trigger(); + break; } } } @@ -1282,7 +1294,7 @@ class Traktor extends SCPattern { colors[p.index] = lx.hsb( (360 + lx.getBaseHuef() + .8*abs(p.x-model.cx)) % 360, 100, - constrain(9 * (bass[pos]*model.cy - abs(p.y - model.cy)), 0, 100) + constrain(9 * (bass[pos]*model.cy - abs(p.y - model.cy + 5)), 0, 100) ); colors[p.index] = blendColor(colors[p.index], lx.hsb( (400 + lx.getBaseHuef() + .5*abs(p.x-model.cx)) % 360, @@ -1298,11 +1310,12 @@ class ColorFuckerEffect extends SCEffect { final BasicParameter level = new BasicParameter("BRT", 1); final BasicParameter desat = new BasicParameter("DSAT", 0); + final BasicParameter hueShift = new BasicParameter("HSHFT", 0); final BasicParameter sharp = new BasicParameter("SHARP", 0); final BasicParameter soft = new BasicParameter("SOFT", 0); final BasicParameter mono = new BasicParameter("MONO", 0); final BasicParameter invert = new BasicParameter("INVERT", 0); - final BasicParameter hueShift = new BasicParameter("HSHFT", 0); + float[] hsb = new float[3]; @@ -1311,10 +1324,10 @@ class ColorFuckerEffect extends SCEffect { addParameter(level); addParameter(desat); addParameter(sharp); + addParameter(hueShift); addParameter(soft); addParameter(mono); addParameter(invert); - addParameter(hueShift); } public void doApply(int[] colors) { diff --git a/_MIDI.pde b/_MIDI.pde index 99c60d2..a336320 100644 --- a/_MIDI.pde +++ b/_MIDI.pde @@ -411,7 +411,7 @@ public class APC40MidiInput extends GenericDeviceMidiInput { case 7: switch (channel) { case 0: - effects.colorFucker.hueShift.setValue(value); + // effects.colorFucker.hueShift.setValue(value); return true; case 1: effects.colorFucker.desat.setValue(value); @@ -437,6 +437,19 @@ public class APC40MidiInput extends GenericDeviceMidiInput { case 15: lx.engine.getDeck(GLucose.RIGHT_DECK).getFader().setValue(value); return true; + + // Cue level + case 47: + float val = effects.colorFucker.hueShift.getValuef(); + int cv = cc.getValue(); + if (cv < 64) { + cv = 64 + cv; + } else { + cv = cv - 64; + } + val += (cv - 64) / 300.; + effects.colorFucker.hueShift.setValue((val+1) % 1); + return true; } int parameterIndex = -1; @@ -893,6 +906,12 @@ class ArturiaMinilabMidiInput extends GenericDeviceMidiInput { case 18: parameterIndex = 5; break; case 19: parameterIndex = 6; break; case 16: parameterIndex = 7; break; + + case 75: + float val = effects.colorFucker.hueShift.getValuef(); + val += (cc.getValue() - 64) / 256.; + effects.colorFucker.hueShift.setValue((val+1) % 1); + break; } if (parameterIndex >= 0) { List parameters = midiEngine.getFocusedPattern().getParameters(); diff --git a/_Mappings.pde b/_Mappings.pde index 4649b62..52c6245 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -102,7 +102,7 @@ scubes.add(new StaggeredTower(//tower 3 27, // x 0 , // y 64, // z - 0, 4, new Cube.Wiring[]{ WFR, WRL, WFR, WRL}) ); + 0, 4, new Cube.Wiring[]{ WFR, WRL, WRL, WFR}) ); scubes.add(new StaggeredTower(//tower 4 54, // x 7, // y @@ -124,7 +124,7 @@ scubes.add(new StaggeredTower(// tower 7 119, // x 0 , // y 56.5, // z - 0, 4, new Cube.Wiring[]{ WRL, WFR, WRL, WFR}) ); + 0, 4, new Cube.Wiring[]{ WRL, WFR, WFR, WRL}) ); scubes.add(new StaggeredTower(//tower 8 136.5, // x @@ -151,12 +151,12 @@ scubes.add(new StaggeredTower(// tower 12 CENTER TOWER AT 45degrees 73, // x 0 , // y 58, // z - -45, 4, new Cube.Wiring[]{ WFL, WRR, WFL, WRR}) ); + -45, 4, new Cube.Wiring[]{ WFR, WRL, WFR, WRL}) ); scubes.add(new StaggeredTower(// Single cube on top of tower 3 22, // x 81.5 , // y 39, // z - -45, 1, new Cube.Wiring[]{ WFR}) ); + -45, 1, new Cube.Wiring[]{ WRL}) ); scubes.add(new StaggeredTower(// Single cube on top of tower 4 42, // x 112 , // y @@ -403,4 +403,4 @@ class ChannelMapping { objectIndices[i] = (i < rawObjectIndices.length) ? rawObjectIndices[i] : NO_OBJECT; } } -} \ No newline at end of file +} -- 2.34.1