From 863c24900aeec8f30f0ca562b88a830e9e4ea9e3 Mon Sep 17 00:00:00 2001 From: Kieran McAuliffe Date: Mon, 22 Jul 2024 16:19:03 +0200 Subject: [PATCH] show NONE for new item --- enums.js | 4 ++-- example.maxpat | 8 ++++---- lfogui.js | 2 +- modulators.js | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/enums.js b/enums.js index 0396ad9..d813503 100644 --- a/enums.js +++ b/enums.js @@ -51,7 +51,7 @@ function enumerate(name, inval, count, keys, vals){ }); } - - window.max.outlet(name + " " + output); + if (name !== "NONE") + window.max.outlet(name + " " + output); } diff --git a/example.maxpat b/example.maxpat index e54907d..1970af3 100644 --- a/example.maxpat +++ b/example.maxpat @@ -47,7 +47,7 @@ "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 493.0, 444.0, 161.0, 35.0 ], - "text" : "\"harmoniclarity 0.572005391276114\"" + "text" : "\"harmoniclarity 0.1955362124045653\"" } } @@ -81,7 +81,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 1054.0, 325.0, 150.0, 60.0 ], + "patching_rect" : [ 1039.0, 50.0, 150.0, 60.0 ], "text" : "You can use the `phase` control to phase offset two LFOs of the same frequency" } @@ -143,7 +143,7 @@ "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 115.0, 201.0, 197.0, 47.0 ], - "text" : "This parameter is defined in the modulators, and when sent will act as the center value for that LFO" + "text" : "This parameter is defined in the modulators, and when sent will act as the low value for that LFO" } } @@ -301,7 +301,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 438.52631402015686, 108.0, 611.105266809463501, 325.0 ], + "patching_rect" : [ 438.52631402015686, 115.0, 643.105266809463501, 318.0 ], "rendermode" : 0, "url" : "file://lfogui.html" } diff --git a/lfogui.js b/lfogui.js index 8456e4b..a769be6 100644 --- a/lfogui.js +++ b/lfogui.js @@ -48,7 +48,7 @@ function MasterLfoHandler(){ const [modCenterVals, setModCenterVals] = React.useState({}); const [shapeArr, setShapeArr] = React.useState(Array(MAXLFOS).fill('Sine')); - const [djParamArr, setDjParamArr] = React.useState(Array(MAXLFOS).fill('attenuation')); + const [djParamArr, setDjParamArr] = React.useState(Array(MAXLFOS).fill('NONE')); const [freqArr, setFreqArr] = React.useState(Array(MAXLFOS).fill('1')); const [ampArr, setAmpArr] = React.useState(Array(MAXLFOS).fill('1')); diff --git a/modulators.js b/modulators.js index 9948d8d..987c119 100644 --- a/modulators.js +++ b/modulators.js @@ -3,7 +3,7 @@ ///////////////////////// var SHAPETYPES = ["Sine", "SawUp", "SawDown", "Tri", "Square"]; -const MODPARAMOPTIONS = ["stream", "pulse_length", "eventfulness", "event_length", "metriclarity", +const MODPARAMOPTIONS = ["NONE", "stream", "pulse_length", "eventfulness", "event_length", "metriclarity", "harmoniclarity", "melodic_cohesion", "melody_scope", "tonic_pitch", "pitch_center", "pitch_range", "dynamics", "attenuation", "chordal_weight", "tonality-profile", "ostinato-buffer", "ostinato", "meter", "scale"]; @@ -54,7 +54,8 @@ function operateModulators(visibleArr, paramNames, centers, freqs, amps, waveTyp center = centers[name]; } let output = operateModulator(center, freqs[i], amps[i], waveTypes[i], phaseArr, i, name, time); - window.dispatchEvent(new CustomEvent('enum', {'detail' : [name, output]})); + if (name !== "NONE") + window.dispatchEvent(new CustomEvent('enum', {'detail' : [name, output]})); } } }