From: Mark Slee Date: Fri, 18 Oct 2013 23:19:45 +0000 (-0700) Subject: Add switch to go monochromatic X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ec5a2e4a39c4f87b8ad72d0f13dadbd5aabf6f44;p=SugarCubes.git Add switch to go monochromatic --- diff --git a/MarkSlee.pde b/MarkSlee.pde index 81b2629..7a556d5 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -1199,6 +1199,7 @@ class ColorFuckerEffect extends SCEffect { final BasicParameter desat = new BasicParameter("DSAT", 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); @@ -1210,6 +1211,7 @@ class ColorFuckerEffect extends SCEffect { addParameter(desat); addParameter(sharp); addParameter(soft); + addParameter(mono); addParameter(invert); addParameter(hueShift); } @@ -1223,10 +1225,14 @@ class ColorFuckerEffect extends SCEffect { float hMod = hueShift.getValuef(); float fSharp = 1/(1.0001-sharp.getValuef()); float fSoft = soft.getValuef(); + boolean mon = mono.getValuef() > 0.5; boolean ivt = invert.getValuef() > 0.5; - if (bMod < 1 || sMod < 1 || hMod > 0 || fSharp > 0 || ivt || fSoft > 0) { + if (bMod < 1 || sMod < 1 || hMod > 0 || fSharp > 0 || ivt || mon || fSoft > 0) { for (int i = 0; i < colors.length; ++i) { lx.RGBtoHSB(colors[i], hsb); + if (mon) { + hsb[0] = lx.getBaseHuef() / 360.; + } if (ivt) { hsb[2] = 1 - hsb[2]; } diff --git a/_MIDI.pde b/_MIDI.pde index 06c3244..ae14990 100644 --- a/_MIDI.pde +++ b/_MIDI.pde @@ -441,6 +441,9 @@ public class APC40MidiInput extends GenericDeviceMidiInput { case 49: // SOLO/CUE switch (nChan) { + case 4: + EFF_colorFucker.mono.setValue(1); + break; case 5: EFF_colorFucker.invert.setValue(1); break; @@ -526,6 +529,9 @@ public class APC40MidiInput extends GenericDeviceMidiInput { case 49: // SOLO/CUE switch (nChan) { + case 4: + EFF_colorFucker.mono.setValue(0); + break; case 5: EFF_colorFucker.invert.setValue(0); break;