From 5b4795e6474df9f53012a8fa201b56e729f1207f Mon Sep 17 00:00:00 2001 From: Kharfmann <33815851+Kharfmann@users.noreply.github.com> Date: Sun, 10 Nov 2019 20:34:20 -0600 Subject: [PATCH 1/2] fix 8 input for glitch --- .../src/coreV2_visuals/GlitchVisual.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2_visuals/GlitchVisual.java b/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2_visuals/GlitchVisual.java index fcff792f..6e3cdf95 100644 --- a/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2_visuals/GlitchVisual.java +++ b/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2_visuals/GlitchVisual.java @@ -138,7 +138,24 @@ public void drawVisual() } } - this.drawVisualForInput(i, this.xPos[i], this.parent.height/2); + if(this.numChannels == 8) + { + int xVal = this.parent.width / 4; + int iVal = i%4; + + if(i <= 3) + { + this.drawVisualForInput(i, (iVal*xVal + (xVal/2)), this.parent.height/4); + } + else + { + this.drawVisualForInput(i, (iVal*xVal + (xVal/2)), (this.parent.height/4 + this.parent.height/2)); + } + } + else + { + this.drawVisualForInput(i, this.xPos[i], this.parent.height/2); + } } this.parent.rectMode(PConstants.CORNER); @@ -168,6 +185,7 @@ private void drawVisualForInput(int channelNumber, int centerX, int centerY) size += this.sizeIncrease; + randX = (int) ((Math.random() - .5) * (float)this.randomness); randY = (int) ((Math.random() - .5) * (float)this.randomness); alpha = (int) (255 - 255*((float)i/(float)this.numShapes)); From 7a6f595fd8b5eeab95ca9c059cfe556f8f494d05 Mon Sep 17 00:00:00 2001 From: Danny Mahota Date: Tue, 12 Nov 2019 18:16:07 -0600 Subject: [PATCH 2/2] added ability to switch between visuals using the numbers on the keyboard. --- .../src/coreV2/ModuleDriver.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2/ModuleDriver.java b/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2/ModuleDriver.java index 72ea5b95..d58e5191 100644 --- a/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2/ModuleDriver.java +++ b/Visuals/Eclipse/workspace/CodeAndChordsEclipseProject/src/coreV2/ModuleDriver.java @@ -3,6 +3,7 @@ import java.awt.Color; import controlP5.ControlP5; +import controlP5.ScrollableList; import controlP5.Tab; import coreV2_EffectsAndFilters.Drawable; @@ -186,6 +187,14 @@ public void keyEvent(KeyEvent e) this.cp5.show(); } } + + int numVisuals = ((ScrollableList)this.cp5.getController("VisualSelect")).getItems().size(); + int valFor1 = '1'; + + if(e.getKeyCode() >= valFor1 && e.getKeyCode() < valFor1 + numVisuals) { + //System.out.println("setting VisualSelect value to " + (e.getKeyCode()-valFor1)); + ((ScrollableList)this.cp5.getController("VisualSelect")).setValue(e.getKeyCode()-valFor1); + } }