13 Commits

6 changed files with 548 additions and 248 deletions

View File

@@ -5,7 +5,8 @@ function isNumeric(str) {
} }
function DropDown(props) { function DropDown(props) {
return e('select', {type: "number", onChange: props.onChange, value: props.value}, let className = props.locked ? 'locked-component' : '';
return e('select', {className, type: "number", onChange: props.onChange, value: props.value},
...props.options.map((item) => Option(item))); ...props.options.map((item) => Option(item)));
} }
@@ -18,11 +19,13 @@ function Label(text){
} }
function NumberBox(props){ function NumberBox(props){
return e('input', {type: "number", onChange: props.onChange, step: props.step, value: props.value, className: props.className}, null); let extraClassName = props.locked ? ' locked-component' : '';
return e('input', {type: "number", onChange: props.onChange, step: props.step, value: props.value, className: props.className + extraClassName}, null);
} }
function TextBox(props){ function TextBox(props){
return e('input', {type: "text", value: props.value, onChange: props.onChange, id: props.id}); let className = props.locked ? 'locked-component' : '';
return e('input', {className, type: "text", value: props.value, onChange: props.onChange, id: props.id});
} }
function Option(str, value){ function Option(str, value){
@@ -30,7 +33,8 @@ function Option(str, value){
} }
function Button(props){ function Button(props){
return e('button', {onClick: props.onClick}, props.text); let className = props.locked ? 'locked-component' : '';
return e('button', {onClick: props.onClick, className}, props.text);
} }
function Switch(props){ function Switch(props){

View File

@@ -5,13 +5,13 @@
// NOT A REACT FUNCTIONAL COMPONENT. MERELY RETURNS AN ARRAY WHICH IS UNPACKED // NOT A REACT FUNCTIONAL COMPONENT. MERELY RETURNS AN ARRAY WHICH IS UNPACKED
function EnumeratorItems(index, enumBreakPoints, setEnumBreakPoints, enumNames, setEnumNames, djParam){ function EnumeratorItems(index, enumBreakPoints, setEnumBreakPoints, enumNames, setEnumNames, djParam, locked){
let items = []; let items = [];
for (let i = 0; i < MAXENUMPOINTS; i++){ for (let i = 0; i < MAXENUMPOINTS; i++){
items.push(ListItem(e(TextBox, {onChange: CreateMatrixParamChanger(enumNames, setEnumNames, index, i), value: enumNames[index][i], id:`text-${djParam}-${enumNames[index][i]}`}, null))); items.push(ListItem(e(TextBox, {locked, onChange: CreateMatrixParamChanger(enumNames, setEnumNames, index, i), value: enumNames[index][i], id:`text-${djParam}-${enumNames[index][i]}`}, null)));
// Add 1 to make up for the lower enum bound // Add 1 to make up for the lower enum bound
items.push(ListItem(e(NumberBox, {onChange: CreateMatrixParamChanger(enumBreakPoints, setEnumBreakPoints, index, i + 1), value:enumBreakPoints[index][i + 1]}, null))); items.push(ListItem(e(NumberBox, {locked, onChange: CreateMatrixParamChanger(enumBreakPoints, setEnumBreakPoints, index, i + 1), value:enumBreakPoints[index][i + 1]}, null)));
} }
return items; return items;
} }
@@ -20,13 +20,13 @@ function EnumeratorRow(props){
let linkedText = props.linked ? "<- mods" : ""; let linkedText = props.linked ? "<- mods" : "";
let content = e('ul', {className: 'lfo-item', id: `${props.djParam}-enum-row`}, let content = e('ul', {className: 'lfo-item', id: `${props.djParam}-enum-row`},
ListItem(DropDown({onChange: props.setInstanceNum, value:props.instanceNum, options: INSTANCEOPTIONS})), ListItem(DropDown({locked:props.locked, onChange: props.setInstanceNum, value:props.instanceNum, options: INSTANCEOPTIONS})),
ListItem(DropDown({onChange: props.setDjParam, value: props.djParam, options: MODPARAMOPTIONS})), ListItem(DropDown({locked:props.locked, onChange: props.setDjParam, value: props.djParam, options: MODPARAMOPTIONS})),
ListItem(e(NumberBox, {onChange: props.setEnumItemCounts, step:1, value:props.enumItems, className: 'enum-count'}, null)), ListItem(e(NumberBox, {locked:props.locked, onChange: props.setEnumItemCounts, step:1, value:props.enumItems, className: 'enum-count'}, null)),
ListItem(e(NumberBox, {onChange: CreateMatrixParamChanger(props.enumBreakPoints, props.setEnumBreakPoints, props.index, 0), value:props.enumBreakPoints[props.index][0], step:0.1}, null)), ListItem(e(NumberBox, {locked:props.locked, onChange: CreateMatrixParamChanger(props.enumBreakPoints, props.setEnumBreakPoints, props.index, 0), value:props.enumBreakPoints[props.index][0], step:0.1}, null)),
...(EnumeratorItems(props.index, props.enumBreakPoints, props.setEnumBreakPoints, props.enumNames, props.setEnumNames, props.djParam).slice(0, props.enumItems * 2)), ...(EnumeratorItems(props.index, props.enumBreakPoints, props.setEnumBreakPoints, props.enumNames, props.setEnumNames, props.djParam, props.locked).slice(0, props.enumItems * 2)),
ListItem(e(Button, {text:'+', onClick: props.addEnum}, null)), ListItem(e(Button, {locked:props.locked, text:'+', onClick: props.addEnum}, null)),
ListItem(e(Button, {text:'-', onClick: props.removeEnum}, null)), ListItem(e(Button, {locked:props.locked, text:'-', onClick: props.removeEnum}, null)),
ListItem(e("div", {className:"linked"}, linkedText)) ListItem(e("div", {className:"linked"}, linkedText))
); );
if (props.visible){ if (props.visible){

View File

@@ -4,13 +4,13 @@
"appversion" : { "appversion" : {
"major" : 8, "major" : 8,
"minor" : 6, "minor" : 6,
"revision" : 2, "revision" : 4,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
} }
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 34.0, 76.0, 1155.0, 763.0 ], "rect" : [ -1639.0, 273.0, 1357.0, 740.0 ],
"bglocked" : 0, "bglocked" : 0,
"openinpresentation" : 0, "openinpresentation" : 0,
"default_fontsize" : 12.0, "default_fontsize" : 12.0,
@@ -39,6 +39,77 @@
"subpatcher_template" : "", "subpatcher_template" : "",
"assistshowspatchername" : 0, "assistshowspatchername" : 0,
"boxes" : [ { "boxes" : [ {
"box" : {
"id" : "obj-42",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 529.0, 843.0, 99.0, 22.0 ],
"saved_object_attributes" : {
"client_rect" : [ 100, 100, 500, 600 ],
"parameter_enable" : 0,
"parameter_mappable" : 0,
"storage_rect" : [ 200, 200, 800, 500 ]
}
,
"text" : "pattrstorage asdf",
"varname" : "asdf"
}
}
, {
"box" : {
"id" : "obj-26",
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 3,
"outlettype" : [ "", "", "" ],
"patching_rect" : [ 659.0, 856.0, 40.0, 22.0 ],
"restore" : [ {
"data" : {
"enumArrays" : [ [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "2", "2", "2", "2", "2", "2", "2", "2", "2", "2" ], [ "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation" ] ],
"enumMats" : [ [ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ], [ [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ] ] ],
"modArrays" : [ [ 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO" ], [ "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "Sine Int.", "Sine Int.", "Rand", "Rand", "Rand", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int." ], [ "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz" ], [ "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ], [ "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ]
}
}
],
"saved_object_attributes" : {
"parameter_enable" : 0,
"parameter_mappable" : 0
}
,
"text" : "pattr",
"varname" : "u671001838"
}
}
, {
"box" : {
"id" : "obj-31",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 423.5, 622.0, 80.0, 22.0 ],
"text" : "route NNdata"
}
}
, {
"box" : {
"id" : "obj-13",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 402.0, 112.0, 56.0, 22.0 ],
"text" : "dumpNN"
}
}
, {
"box" : { "box" : {
"fontname" : "Arial", "fontname" : "Arial",
"fontsize" : 13.0, "fontsize" : 13.0,
@@ -167,7 +238,7 @@
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 1, "numoutlets" : 1,
"outlettype" : [ "" ], "outlettype" : [ "" ],
"patching_rect" : [ 586.0, 713.0, 89.0, 36.0 ], "patching_rect" : [ 546.0, 735.0, 89.0, 35.0 ],
"text" : "harmoniclarity 14.213599" "text" : "harmoniclarity 14.213599"
} }
@@ -180,21 +251,20 @@
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 1, "numoutlets" : 1,
"outlettype" : [ "" ], "outlettype" : [ "" ],
"patching_rect" : [ 491.0, 713.0, 85.0, 36.0 ], "patching_rect" : [ 451.0, 735.0, 85.0, 35.0 ],
"text" : "event_length 55.786401" "text" : "event_length 0.518845"
} }
} }
, { , {
"box" : { "box" : {
"id" : "obj-78", "id" : "obj-78",
"linecount" : 2,
"maxclass" : "message", "maxclass" : "message",
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 1, "numoutlets" : 1,
"outlettype" : [ "" ], "outlettype" : [ "" ],
"patching_rect" : [ 385.0, 715.0, 84.0, 36.0 ], "patching_rect" : [ 345.0, 737.0, 84.0, 22.0 ],
"text" : "metriclarity 79.192955" "text" : "metriclarity 20"
} }
} }
@@ -205,7 +275,7 @@
"numinlets" : 4, "numinlets" : 4,
"numoutlets" : 4, "numoutlets" : 4,
"outlettype" : [ "", "", "", "" ], "outlettype" : [ "", "", "", "" ],
"patching_rect" : [ 410.0, 671.0, 273.0, 22.0 ], "patching_rect" : [ 370.0, 693.0, 273.0, 22.0 ],
"text" : "routepass metriclarity event_length harmoniclarity" "text" : "routepass metriclarity event_length harmoniclarity"
} }
@@ -217,7 +287,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 1066.052632331848145, 53.0, 99.894735336303711, 89.0 ], "patching_rect" : [ 1066.052632331848145, 53.0, 99.894735336303711, 87.0 ],
"text" : "You can use Hz, seconds, ms, hh:mm:ss, or bars.beats.ticks for the period/frequency" "text" : "You can use Hz, seconds, ms, hh:mm:ss, or bars.beats.ticks for the period/frequency"
} }
@@ -229,7 +299,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 1181.315790414810181, 40.0, 81.0, 117.0 ], "patching_rect" : [ 1181.315790414810181, 40.0, 81.0, 114.0 ],
"text" : "Min and max must be ADDED to the center value to determine the true bounds. " "text" : "Min and max must be ADDED to the center value to determine the true bounds. "
} }
@@ -241,7 +311,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 913.0, 107.0, 150.0, 62.0 ], "patching_rect" : [ 913.0, 107.0, 150.0, 60.0 ],
"text" : "center values are read only, they must be configured by an upstream value" "text" : "center values are read only, they must be configured by an upstream value"
} }
@@ -252,7 +322,7 @@
"maxclass" : "newobj", "maxclass" : "newobj",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 480.5, 613.0, 32.0, 22.0 ], "patching_rect" : [ 537.0, 622.0, 32.0, 22.0 ],
"text" : "print" "text" : "print"
} }
@@ -266,7 +336,7 @@
"numinlets" : 5, "numinlets" : 5,
"numoutlets" : 5, "numoutlets" : 5,
"outlettype" : [ "", "", "", "", "" ], "outlettype" : [ "", "", "", "", "" ],
"patching_rect" : [ 626.0, 613.0, 81.0, 23.0 ], "patching_rect" : [ 558.0, 661.0, 81.0, 23.0 ],
"text" : "route 1 2 3 4" "text" : "route 1 2 3 4"
} }
@@ -325,7 +395,8 @@
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 5, "numoutlets" : 5,
"outlettype" : [ "preset", "int", "preset", "int", "" ], "outlettype" : [ "preset", "int", "preset", "int", "" ],
"patching_rect" : [ 934.0, 27.0, 100.0, 40.0 ] "patching_rect" : [ 934.0, 27.0, 100.0, 40.0 ],
"pattrstorage" : "asdf"
} }
} }
@@ -333,9 +404,9 @@
"box" : { "box" : {
"data" : { "data" : {
"data" : { "data" : {
"enumArrays" : [ [ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "2", "4", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "2", "4", 2, "2", "2", "2", "2", "2", "2", "2" ], [ "scale", "meter", "NONE", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation" ] ], "enumArrays" : [ [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "2", "2", "2", "2", "2", "2", "2", "2", "2", "2" ], [ "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation" ] ],
"enumMats" : [ [ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ], [ [ "major", "minor", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "4 4", "3 4", "7 8", "2 4", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ] ] ], "enumMats" : [ [ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ], [ [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ] ] ],
"modArrays" : [ [ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "1", "4", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "Sine", "Tri", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "metriclarity", "meter", "event_length", "harmoniclarity", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "1hz", "0.4.0", "3s", "00:00:03", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz" ], [ "20", "0", "20", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ], [ "80", "2", "70", "50", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "0", "0", "0", "0.5", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ] ] "modArrays" : [ [ 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO" ], [ "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "Sine Int.", "Sine Int.", "Rand", "Rand", "Rand", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int.", "Sine Int." ], [ "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz", "1hz" ], [ "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ], [ "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ]
} }
} }
@@ -345,7 +416,7 @@
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 5, "numoutlets" : 5,
"outlettype" : [ "dictionary", "", "", "", "" ], "outlettype" : [ "dictionary", "", "", "", "" ],
"patching_rect" : [ 773.0, 808.0, 166.0, 22.0 ], "patching_rect" : [ 786.0, 894.0, 166.0, 22.0 ],
"saved_object_attributes" : { "saved_object_attributes" : {
"embed" : 1, "embed" : 1,
"legacy" : 1, "legacy" : 1,
@@ -377,7 +448,7 @@
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 1, "numoutlets" : 1,
"outlettype" : [ "bang" ], "outlettype" : [ "bang" ],
"patching_rect" : [ 980.368419170379639, 702.0, 22.0, 22.0 ], "patching_rect" : [ 989.0, 831.0, 22.0, 22.0 ],
"text" : "t b" "text" : "t b"
} }
@@ -400,7 +471,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 137.5, 440.0, 246.0, 66.0 ], "patching_rect" : [ 137.5, 440.0, 246.0, 64.0 ],
"text" : "this param is sent in its already enumerated form, so it will first be turned into a number halfway between the enumeration boundaries" "text" : "this param is sent in its already enumerated form, so it will first be turned into a number halfway between the enumeration boundaries"
} }
@@ -424,8 +495,8 @@
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 1, "numoutlets" : 1,
"outlettype" : [ "" ], "outlettype" : [ "" ],
"patching_rect" : [ 949.0, 647.0, 156.0, 22.0 ], "patching_rect" : [ 924.0, 748.0, 156.0, 22.0 ],
"text" : "meter 3 4" "text" : "meter 4 4"
} }
} }
@@ -436,7 +507,7 @@
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 1, "numoutlets" : 1,
"outlettype" : [ "" ], "outlettype" : [ "" ],
"patching_rect" : [ 824.0, 647.0, 101.0, 22.0 ], "patching_rect" : [ 799.0, 748.0, 101.0, 22.0 ],
"text" : "attenuation 200" "text" : "attenuation 200"
} }
@@ -448,8 +519,8 @@
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 1, "numoutlets" : 1,
"outlettype" : [ "" ], "outlettype" : [ "" ],
"patching_rect" : [ 662.0, 647.0, 157.0, 22.0 ], "patching_rect" : [ 637.0, 748.0, 157.0, 22.0 ],
"text" : "scale minor" "text" : "scale 1.6"
} }
} }
@@ -457,11 +528,11 @@
"box" : { "box" : {
"id" : "obj-27", "id" : "obj-27",
"maxclass" : "newobj", "maxclass" : "newobj",
"numinlets" : 3, "numinlets" : 4,
"numoutlets" : 3, "numoutlets" : 4,
"outlettype" : [ "", "", "" ], "outlettype" : [ "", "", "", "" ],
"patching_rect" : [ 423.5, 588.0, 133.0, 22.0 ], "patching_rect" : [ 423.5, 588.0, 177.0, 22.0 ],
"text" : "routepass saved debug" "text" : "routepass saved NNdata debug"
} }
} }
@@ -472,7 +543,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 504.0, 546.5, 268.0, 34.0 ], "patching_rect" : [ 504.0, 546.5, 268.0, 33.0 ],
"text" : "we can only output symbols from jweb, so this turns them into lists" "text" : "we can only output symbols from jweb, so this turns them into lists"
} }
@@ -496,7 +567,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 548.52631402015686, 80.0, 150.0, 34.0 ], "patching_rect" : [ 548.52631402015686, 80.0, 150.0, 33.0 ],
"text" : "see below for why we use separate names..." "text" : "see below for why we use separate names..."
} }
@@ -508,7 +579,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 781.0, 17.0, 150.0, 48.0 ], "patching_rect" : [ 781.0, 17.0, 150.0, 47.0 ],
"text" : "self explanatory. Warning-will overwrite whatever is saved." "text" : "self explanatory. Warning-will overwrite whatever is saved."
} }
@@ -520,7 +591,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 1261.315790414810181, 47.0, 78.0, 103.0 ], "patching_rect" : [ 1261.315790414810181, 47.0, 78.0, 100.0 ],
"text" : "You can use the `phase` control to phase offset two LFOs of the same frequency" "text" : "You can use the `phase` control to phase offset two LFOs of the same frequency"
} }
@@ -533,7 +604,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 161.5, 261.0, 197.0, 79.0 ], "patching_rect" : [ 161.5, 261.0, 197.0, 78.0 ],
"text" : "This parameter is defined in the enumerators but not the modulators. It will be enumerated and immediately output" "text" : "This parameter is defined in the enumerators but not the modulators. It will be enumerated and immediately output"
} }
@@ -558,7 +629,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 159.0, 347.0, 254.0, 52.0 ], "patching_rect" : [ 159.0, 347.0, 254.0, 51.0 ],
"text" : "This parameter is not defined by either the Modulators or Enumerators, so it will be passed directly to the output" "text" : "This parameter is not defined by either the Modulators or Enumerators, so it will be passed directly to the output"
} }
@@ -571,7 +642,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 159.0, 190.0, 197.0, 66.0 ], "patching_rect" : [ 159.0, 190.0, 197.0, 64.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 center value for that LFO"
} }
@@ -583,7 +654,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 59.0, 634.0, 254.0, 158.0 ], "patching_rect" : [ 59.0, 634.0, 254.0, 154.0 ],
"text" : "The operation runs\n\nInput > Denumeration > Modulators > Enumerators > Output\n\nA parameter from the input not established by a Modulator will be passed directly to the Enumerators\n\nLikewise, the Enumerators will pass not established parameters" "text" : "The operation runs\n\nInput > Denumeration > Modulators > Enumerators > Output\n\nA parameter from the input not established by a Modulator will be passed directly to the Enumerators\n\nLikewise, the Enumerators will pass not established parameters"
} }
@@ -631,7 +702,7 @@
"numinlets" : 2, "numinlets" : 2,
"numoutlets" : 5, "numoutlets" : 5,
"outlettype" : [ "dictionary", "", "", "", "" ], "outlettype" : [ "dictionary", "", "", "", "" ],
"patching_rect" : [ 980.368419170379639, 726.0, 97.0, 22.0 ], "patching_rect" : [ 989.0, 855.0, 97.0, 22.0 ],
"saved_object_attributes" : { "saved_object_attributes" : {
"embed" : 0, "embed" : 0,
"legacy" : 1, "legacy" : 1,
@@ -650,7 +721,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 504.0, 6.0, 150.0, 34.0 ], "patching_rect" : [ 504.0, 6.0, 150.0, 33.0 ],
"text" : "required due to the asynchronous operation" "text" : "required due to the asynchronous operation"
} }
@@ -662,7 +733,7 @@
"maxclass" : "comment", "maxclass" : "comment",
"numinlets" : 1, "numinlets" : 1,
"numoutlets" : 0, "numoutlets" : 0,
"patching_rect" : [ 773.0, 692.0, 150.0, 117.0 ], "patching_rect" : [ 786.0, 778.0, 150.0, 114.0 ],
"text" : "Storage for the matrix. Unfortunately, jsweb dictionary handling isn't great, so we can't use it like a native dict object and need to do this wild hack for usage with pattrstorage" "text" : "Storage for the matrix. Unfortunately, jsweb dictionary handling isn't great, so we can't use it like a native dict object and need to do this wild hack for usage with pattrstorage"
} }
@@ -737,6 +808,13 @@
"source" : [ "obj-12", 0 ] "source" : [ "obj-12", 0 ]
} }
}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"source" : [ "obj-13", 0 ]
}
} }
, { , {
"patchline" : { "patchline" : {
@@ -788,6 +866,20 @@
"source" : [ "obj-22", 0 ] "source" : [ "obj-22", 0 ]
} }
}
, {
"patchline" : {
"destination" : [ "obj-25", 0 ],
"source" : [ "obj-26", 1 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-31", 0 ],
"source" : [ "obj-27", 1 ]
}
} }
, { , {
"patchline" : { "patchline" : {
@@ -799,14 +891,14 @@
, { , {
"patchline" : { "patchline" : {
"destination" : [ "obj-63", 0 ], "destination" : [ "obj-63", 0 ],
"source" : [ "obj-27", 2 ] "source" : [ "obj-27", 3 ]
} }
} }
, { , {
"patchline" : { "patchline" : {
"destination" : [ "obj-66", 0 ], "destination" : [ "obj-66", 0 ],
"source" : [ "obj-27", 1 ] "source" : [ "obj-27", 2 ]
} }
} }

View File

@@ -1,181 +1,272 @@
html, * {
body { --locked-color: #5fadbf;
width: 100%; --unlocked-color: #ff5153;
height: 100%; }
margin: 0px;
border: 0;
overflow: hidden; /* Disable scrollbars */
display: block; /* No floating content on sides */
}
ul { html, body {
list-style-type: none; width: 100%;
margin: 0; height: 100%;
padding: 0; margin: 0px;
overflow: hidden; border: 0;
background-color: #333333; overflow: hidden; /* Disable scrollbars */
} display: block; /* No floating content on sides */
}
li { ul {
float: left; list-style-type: none;
} margin: 0;
padding: 0;
overflow: hidden;
background-color: #333333;
}
li {
input[type=number] { float: left;
width: 50px; }
margin: 0;
padding: 0;
}
input[type=text] {
width: 60px;
margin: 0;
padding: 0;
font-weight: bold;
}
.timeInput { input[type=number] {
width: 80px; width: 50px;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#matrix { input[type=text] {
background-color: aquamarine; width: 60px;
height: 100%; margin: 0;
width: 100%; padding: 0;
} font-weight: bold;
}
.numbox-unclicked { .timeInput {
user-select: none; width: 80px;
border: solid; margin: 0;
font-size: 12vw; padding: 0;
} }
.numbox-clicked { #matrix {
user-select: none; background-color: aquamarine;
border : solid; height: 100%;
font-size: 12vw; width: 100%;
} }
.param-input-label { .numbox-unclicked {
width: 93%; user-select: none;
font-size: 5vw; border: solid;
} font-size: 12vw;
}
.lfo-input-label { .numbox-clicked {
width: 40%; user-select: none;
font-size: 5vw; border : solid;
} font-size: 12vw;
}
/* The switch - the box around the slider */ .param-input-label {
.switch { width: 93%;
position: relative; font-size: 5vw;
display: inline-block; }
width: 30px;
height: 17px;
}
/* Hide default HTML checkbox */ .lfo-input-label {
.switch input { width: 40%;
opacity: 0; font-size: 5vw;
width: 0; }
height: 0;
}
/* The slider */ /* The switch - the box around the slider */
.slider { .switch {
position: absolute; position: relative;
cursor: pointer; display: inline-block;
top: 0; width: 30px;
left: 0; height: 17px;
right: 0; }
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before { /* Hide default HTML checkbox */
position: absolute; .switch input {
content: ""; opacity: 0;
height: 13px; width: 0;
width: 13px; height: 0;
left: 2px; }
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider { /* The slider */
background-color: #2196F3; .slider {
} position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
input:focus + .slider { .slider:before {
box-shadow: 0 0 1px #2196F3; position: absolute;
} content: "";
height: 13px;
width: 13px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider:before { input:checked + .slider {
-webkit-transform: translateX(13px); background-color: #2196F3;
-ms-transform: translateX(13px); }
transform: translateX(13px);
}
/* Rounded sliders */ input:focus + .slider {
.slider.round { box-shadow: 0 0 1px #2196F3;
border-radius: 17px; }
}
.slider.round:before { input:checked + .slider:before {
border-radius: 50%; -webkit-transform: translateX(13px);
} -ms-transform: translateX(13px);
transform: translateX(13px);
}
h5 { /* Rounded sliders */
margin: 0; .slider.round {
padding: 0; border-radius: 17px;
} }
.enum-count { .slider.round:before {
background-color: aquamarine; border-radius: 50%;
} }
.label { h5 {
background-color: aliceblue; margin: 0;
padding: 0 4px 0 4px; padding: 0;
margin: 0 2px 0 2px; }
border-color: #333333;
border-width: 1px;
}
.base-val { .enum-count {
background-color: lightgray; background-color: aquamarine;
border-color: #333333; }
border-width: 1px;
width: 50px;
margin-left: 2px;
margin-top: 1px;
}
.linked { .label {
color: red; background-color: aliceblue;
border-width: 1px; padding: 0 4px 0 4px;
width: 50px; margin: 0 2px 0 2px;
font-size: small; border-color: #333333;
margin-left: 2px; border-width: 1px;
margin-top: 5px; }
}
@keyframes pulse-animation { .base-val {
0% { background-color: lightgray;
color: black; border-color: #333333;
} border-width: 1px;
100% { width: 50px;
color: red; margin-left: 2px;
} margin-top: 1px;
} }
#pulse { .linked {
animation: pulse-animation 0.2s normal; color: red;
} border-width: 1px;
width: 50px;
font-size: small;
margin-left: 2px;
margin-top: 5px;
}
@keyframes pulse-animation {
0% {
color: black;
}
100% {
color: red;
}
}
#pulse {
animation: pulse-animation 0.2s normal;
}
/* :::::::::::::: LOCK CSS */
.locked-component {
pointer-events: none;
background-color: #333333;
color : white;
}
.container {
display: flex;
width: 100%;
justify-content: space-between;
}
/* Locked */
.lock {
margin-top: 14px;
width: 24px;
height: 21px;
border: 3px solid var(--locked-color);
border-radius: 5px;
position: relative;
cursor: pointer;
-webkit-transition: all 0.1s ease-in-out;
transition: all 0.1s ease-in-out;
}
.lock:after {
content: "";
display: block;
background: var(--locked-color);
width: 3px;
height: 7px;
position: absolute;
top: 50%;
left: 50%;
margin: -3.5px 0 0 -2px;
-webkit-transition: all 0.1s ease-in-out;
transition: all 0.1s ease-in-out;
}
.lock:before {
content: "";
display: block;
width: 10px;
height: 10px;
bottom: 100%;
position: absolute;
left: 50%;
margin-left: -8px;
border: 3px solid var(--locked-color);
border-top-right-radius: 50%;
border-top-left-radius: 50%;
border-bottom: 0;
-webkit-transition: all 0.1s ease-in-out;
transition: all 0.1s ease-in-out;
}
/* Locked Hover */
.lock:hover:before {
height: 12px;
}
/* Unlocked */
.unlocked {
transform: rotate(10deg);
}
.unlocked:before {
bottom: 130%;
left: 31%;
margin-left: -11.5px;
transform: rotate(-45deg);
}
.unlocked,
.unlocked:before {
border-color: var(--unlocked-color);
}
.unlocked:after {
background: var(--unlocked-color);
}
/* Unlocked Hover */
.unlocked:hover {
transform: rotate(3deg);
}
.unlocked:hover:before {
height: 10px;
left: 40%;
bottom: 124%;
transform: rotate(-30deg);
}

154
lfogui.js
View File

@@ -20,6 +20,11 @@ const ViewModes = Object.freeze({
ENUM: 1 ENUM: 1
}); });
const LockModes = Object.freeze({
UNLOCK: 0,
LOCK: 1
});
var modPhases = Array(MAXLFOS).fill(0); var modPhases = Array(MAXLFOS).fill(0);
var firstUpdateTime = Date.now(); var firstUpdateTime = Date.now();
@@ -28,6 +33,30 @@ const MODULATORLABELS = ["inst", "-type-", "---shape---", "-------param-------",
const ENUMERATORLABELS = ["inst", "---parameter---", "-# points-"]; const ENUMERATORLABELS = ["inst", "---parameter---", "-# points-"];
function parseLfoTimeNonMusical(lfoTime){
if (lfoTime.slice(-2) == "hz"){
return parseFloat(lfoTime.slice(0, -2));
}
else if (lfoTime.slice(-2) == "ms"){
return 1000 / parseFloat(lfoTime.slice(0, -2));
}
else if (lfoTime.slice(-1) == "s"){
return 1 / parseFloat(lfoTime.slice(0, -1));
}
else if ((lfoTime.match(/:/g) || []).length == 2){
return 1 / moment.duration(lfoTime).asSeconds();
}
else if ((lfoTime.match(/\./g) || []).length == 2){
return 0; // ignore musical timings
}
else {
return 0;
}
}
function nnFreqToHzString(num){
return `${num}hz`;
}
function MasterLfoHandler(){ function MasterLfoHandler(){
@@ -43,6 +72,14 @@ function MasterLfoHandler(){
setViewMode(ViewModes.MOD); setViewMode(ViewModes.MOD);
}; };
const [lockMode, setLockMode] = React.useState(LockModes.LOCK);
const toggleLockMode = () => {
if (lockMode === LockModes.UNLOCK)
setLockMode(LockModes.LOCK);
else
setLockMode(LockModes.UNLOCK);
};
/// MODULATOR ARRAYS /// MODULATOR ARRAYS
const [userDefinedWave, setUserDefinedWave] = React.useState(Array(50).fill(0)); const [userDefinedWave, setUserDefinedWave] = React.useState(Array(50).fill(0));
@@ -68,25 +105,26 @@ function MasterLfoHandler(){
const [initPhaseArr, setInitPhaseArr] = React.useState(Array(MAXLFOS).fill('0')); const [initPhaseArr, setInitPhaseArr] = React.useState(Array(MAXLFOS).fill('0'));
const [lastPhaseArr, setLastPhaseArr] = React.useState(Array(MAXLFOS).fill(0)); const [lastPhaseArr, setLastPhaseArr] = React.useState(Array(MAXLFOS).fill(0));
const [cachedNoiseValueArr, setCachedNoiseValueArr] = React.useState(Array(MAXLFOS).fill([0, 0])); const [cachedNoiseValueArr1, setCachedNoiseValueArr1] = React.useState(Array(MAXLFOS).fill(0));
const [cachedNoiseValueArr2, setCachedNoiseValueArr2] = React.useState(Array(MAXLFOS).fill(0));
const allModArrays = [modVisibleArr, modTypeArr, modInstanceNumArr, shapeArr, noiseTypeArr, djParamArr, freqArr, minArr, maxArr, initPhaseArr, lastPhaseArr, cachedNoiseValueArr]; const allModArrays = [modVisibleArr, modTypeArr, modInstanceNumArr, shapeArr, noiseTypeArr, djParamArr, freqArr, minArr, maxArr, initPhaseArr, lastPhaseArr, cachedNoiseValueArr1, cachedNoiseValueArr2];
const allModSetters = [setModVisibleArr, setModTypeArr, setModInstanceNumArr, setShapeArr, setNoiseTypeArr, setDjParamArr, setFreqArr, setMinArr, setMaxArr, setInitPhaseArr, lastPhaseArr, cachedNoiseValueArr]; const allModSetters = [setModVisibleArr, setModTypeArr, setModInstanceNumArr, setShapeArr, setNoiseTypeArr, setDjParamArr, setFreqArr, setMinArr, setMaxArr, setInitPhaseArr, setLastPhaseArr, setCachedNoiseValueArr1, setCachedNoiseValueArr2];
const modBlankVals = [true, 'LFO', '1', SHAPETYPES[0], MODPARAMOPTIONS[0], "Sine Int.", '1hz', '0', '1', '0', 0, [0, 0]]; const modBlankVals = [true, 'LFO', '1', SHAPETYPES[0], NOISETYPES[0], MODPARAMOPTIONS[0], '1hz', '0', '1', '0', 0, 0, 0];
/// ENUMERATOR ARRAYS /// ENUMERATOR ARRAYS
const [enumVisibleArr, setEnumVisibleArr] = React.useState(initVisArr); const [enumVisibleArr, setEnumVisibleArr] = React.useState(initVisArr);
const [enumInstanceNumArr, setEnumInstanceNumArr] = React.useState(Array(MAXLFOS).fill('1')); const [enumInstanceNumArr, setEnumInstanceNumArr] = React.useState(Array(MAXLFOS).fill('1'));
const [enumItemCounts, setEnumItemCounts] = React.useState(Array(MAXENUMPOINTS).fill('2')); const [enumItemCounts, setEnumItemCounts] = React.useState(Array(MAXENUMPOINTS).fill('2'));
const [enumDjParamArr, setEnumDjParamArr] = React.useState(Array(MAXENUMPOINTS).fill('attenuation')); const [enumDjParamArr, setEnumDjParamArr] = React.useState(Array(MAXENUMPOINTS).fill('NONE'));
let baseEnumBreakpoints = Array(MAXENUMS).fill(0).map(x => Array(MAXENUMPOINTS+ 1).fill(0)); let baseEnumBreakpoints = Array(MAXENUMS).fill(0).map(x => Array(MAXENUMPOINTS+ 1).fill(0));
for (let i = 0; i < MAXENUMS; i++){ for (let i = 0; i < MAXENUMS; i++){
for (let j=0; j < MAXENUMPOINTS + 1; j++){ for (let j=0; j < MAXENUMPOINTS + 1; j++){
baseEnumBreakpoints[i][j] = j; baseEnumBreakpoints[i][j] = j - 0.5;
} }
} }
const [enumBreakPoints, setEnumBreakPoints] = React.useState(baseEnumBreakpoints); const [enumBreakPoints, setEnumBreakPoints] = React.useState(baseEnumBreakpoints);
@@ -94,7 +132,7 @@ function MasterLfoHandler(){
const getBlankEnumBreakPointRow = () => { const getBlankEnumBreakPointRow = () => {
let arr = [] let arr = []
for (let i=0; i< MAXENUMPOINTS + 1; i++) for (let i=0; i< MAXENUMPOINTS + 1; i++)
arr.push(i) arr.push(i - 0.5)
return arr; return arr;
} }
@@ -120,14 +158,12 @@ function MasterLfoHandler(){
function handleLoad(event) { function handleLoad(event) {
window.max.getDict(event.detail, (dict) => { window.max.getDict(event.detail, (dict) => {
for (let i = 0; i<allModArrays.length; i++) { for (let i = 0; i<dict.data.modArrays.length; i++) {
allModSetters[i](dict.data.modArrays[i]); allModSetters[i](dict.data.modArrays[i]);
} }
for (let i = 0; i<allEnumArrays.length; i++) { for (let i = 0; i<allEnumArrays.length; i++) {
allEnumArrSetters[i](dict.data.enumArrays[i]); allEnumArrSetters[i](dict.data.enumArrays[i]);
} }
for (let i = 0; i<allEnumMats.length; i++) { for (let i = 0; i<allEnumMats.length; i++) {
allEnumMatSetters[i](dict.data.enumMats[i]); allEnumMatSetters[i](dict.data.enumMats[i]);
} }
@@ -205,7 +241,7 @@ function MasterLfoHandler(){
function handleTick(event) { function handleTick(event) {
let time = (Date.now() - firstUpdateTime) / 1000; let time = (Date.now() - firstUpdateTime) / 1000;
let noiseData = {lastPhaseArr, setLastPhaseArr, cachedNoiseValueArr, setCachedNoiseValueArr, noiseTypeArr}; let noiseData = {lastPhaseArr, setLastPhaseArr, cachedNoiseValueArr1, setCachedNoiseValueArr1, cachedNoiseValueArr2, setCachedNoiseValueArr2, noiseTypeArr};
operateModulators(modVisibleArr, modTypeArr, modInstanceNumArr, djParamArr, modCenterVals, freqArr, minArr, maxArr, shapeArr, initPhaseArr, noiseData, userDefinedWave, time, beatsInMeasure, ticks); operateModulators(modVisibleArr, modTypeArr, modInstanceNumArr, djParamArr, modCenterVals, freqArr, minArr, maxArr, shapeArr, initPhaseArr, noiseData, userDefinedWave, time, beatsInMeasure, ticks);
} }
@@ -221,9 +257,68 @@ function MasterLfoHandler(){
setTicks(event.detail); setTicks(event.detail);
} }
function setNN(event){
for (let i=0; i<MAXLFOS; i++){
freqArr[i] = nnFreqToHzString(event.detail[i]);
}
setFreqArr(freqArr)
for (let i=MAXLFOS; i<MAXLFOS * 2; i++){
minArr[i - MAXLFOS] = event.detail[i];
}
setMinArr(minArr);
for (let i=MAXLFOS*2; i<MAXLFOS * 3; i++){
maxArr[i - MAXLFOS*2] = event.detail[i];
}
setMaxArr(maxArr);
for (let i=MAXLFOS*3; i<MAXLFOS * 4; i++){
initPhaseArr[i - MAXLFOS*3] = parseFloat(event.detail[i]);
}
setInitPhaseArr(initPhaseArr);
for (let i=MAXLFOS*4; i<MAXLFOS * 5; i++){
let index = i - MAXLFOS*4;
let inst = modInstanceNumArr[index];
let param = djParamArr[index];
modCenterVals[inst][param] = parseFloat(event.detail[i]);
}
setModCenterVals(modCenterVals);
rerender(!render); // BAD! SHOULD NOT BE DOING THIS!
}
function dumpNN(event){
let allNNData = [];
freqArr.forEach(element => {
allNNData.push(parseLfoTimeNonMusical(element));
});
allNNData = allNNData.concat(minArr);
allNNData = allNNData.concat(maxArr);
allNNData = allNNData.concat(initPhaseArr);
let lfoMatchedCenterVals = [];
for (let i=0; i<MAXLFOS; i++){
let inst = modInstanceNumArr[i];
let param = djParamArr[i];
lfoMatchedCenterVals.push(modCenterVals[inst][param]);
if (!lfoMatchedCenterVals[i])
lfoMatchedCenterVals[i] = 0
}
allNNData = allNNData.concat(lfoMatchedCenterVals);
window.max.outlet("NNdata " + allNNData.join(" "));
}
window.addEventListener('loadDict', handleLoad); window.addEventListener('loadDict', handleLoad);
window.addEventListener('saveDict', handleSave); window.addEventListener('saveDict', handleSave);
window.addEventListener('dumpNN', dumpNN);
window.addEventListener('setNN', setNN);
window.addEventListener('tick', handleTick); window.addEventListener('tick', handleTick);
window.addEventListener('param', handleParam); window.addEventListener('param', handleParam);
window.addEventListener('enum', handleEnum); window.addEventListener('enum', handleEnum);
@@ -234,6 +329,8 @@ function MasterLfoHandler(){
return () => { return () => {
window.removeEventListener('loadDict', handleLoad); window.removeEventListener('loadDict', handleLoad);
window.removeEventListener('saveDict', handleSave); window.removeEventListener('saveDict', handleSave);
window.removeEventListener('dumpNN', dumpNN);
window.removeEventListener('setNN', setNN);
window.removeEventListener('tick', handleTick); window.removeEventListener('tick', handleTick);
window.removeEventListener('param', handleParam); window.removeEventListener('param', handleParam);
window.removeEventListener('enum', handleEnum); window.removeEventListener('enum', handleEnum);
@@ -241,7 +338,7 @@ function MasterLfoHandler(){
window.removeEventListener('userWave', handleChangeUserWave); window.removeEventListener('userWave', handleChangeUserWave);
window.removeEventListener('maxTicks', handleMaxTicks); window.removeEventListener('maxTicks', handleMaxTicks);
}; };
}, [...allModArrays, ...allEnumArrays, ...allEnumMats, modCenterVals, render, beatsInMeasure, ticks]); }, [...allModArrays, ...allEnumArrays, ...allEnumMats, userDefinedWave, modCenterVals, render, beatsInMeasure, ticks]);
function CheckLinked(inst, param, checkInstArr, checkParamArr){ function CheckLinked(inst, param, checkInstArr, checkParamArr){
@@ -262,6 +359,7 @@ function MasterLfoHandler(){
modContents.push( modContents.push(
e(LfoRow, { e(LfoRow, {
locked : lockMode,
instanceNum : modInstanceNumArr[i], instanceNum : modInstanceNumArr[i],
setInstanceNum: CreateParamChanger(modInstanceNumArr, setModInstanceNumArr, i), setInstanceNum: CreateParamChanger(modInstanceNumArr, setModInstanceNumArr, i),
@@ -311,7 +409,7 @@ function MasterLfoHandler(){
} }
} }
else { else {
log("adding lfo");
for (var j = 0; j < allModArrays.length; j++){ // no space below, easy. for (var j = 0; j < allModArrays.length; j++){ // no space below, easy.
let array = allModArrays[j]; let array = allModArrays[j];
array[id + 1] = modBlankVals[j]; array[id + 1] = modBlankVals[j];
@@ -319,6 +417,7 @@ function MasterLfoHandler(){
} }
} }
rerender(!render); rerender(!render);
} }
}, },
removeLfo: () => { removeLfo: () => {
@@ -343,7 +442,7 @@ function MasterLfoHandler(){
enumContents.push( enumContents.push(
e(EnumeratorRow, { e(EnumeratorRow, {
index: i, index: i,
locked : lockMode,
instanceNum : enumInstanceNumArr[i], instanceNum : enumInstanceNumArr[i],
setInstanceNum: CreateParamChanger(enumInstanceNumArr, setEnumInstanceNumArr, i), setInstanceNum: CreateParamChanger(enumInstanceNumArr, setEnumInstanceNumArr, i),
enumItems: enumItemCounts[i], enumItems: enumItemCounts[i],
@@ -425,8 +524,19 @@ function MasterLfoHandler(){
labels = ENUMERATORLABELS; labels = ENUMERATORLABELS;
} }
let lockClass;
if (lockMode == LockModes.LOCK){
lockClass = 'lock';
}
else {
lockClass = 'lock unlocked';
}
return e('div', null, return e('div', null,
e(Switch, {ontoggle: toggleViewMode}, null), e('div', {className: 'container'},
e(Switch, {ontoggle: toggleViewMode}, null),
e('span', {className: lockClass, onClick: toggleLockMode}, null)),
e('h5', null, title), e('h5', null, title),
e('ul', null, ...labels.map(x => ListItem(Label(x)))), e('ul', null, ...labels.map(x => ListItem(Label(x)))),
e('div', {id: 'grid'}, ...grid) e('div', {id: 'grid'}, ...grid)
@@ -442,6 +552,14 @@ if (!DEBUG){
window.dispatchEvent(new CustomEvent('saveDict', {'detail' : dictId})); window.dispatchEvent(new CustomEvent('saveDict', {'detail' : dictId}));
}); });
window.max.bindInlet("dumpNN", () => {
window.dispatchEvent(new CustomEvent('dumpNN'));
});
window.max.bindInlet("setNN", (...data) => {
window.dispatchEvent(new CustomEvent('setNN', {'detail' : data}));
});
window.max.bindInlet("param", (inst, paramName, val) => { window.max.bindInlet("param", (inst, paramName, val) => {
window.dispatchEvent(new CustomEvent('param', {'detail' : [inst, paramName, val]})); window.dispatchEvent(new CustomEvent('param', {'detail' : [inst, paramName, val]}));
@@ -459,12 +577,6 @@ if (!DEBUG){
window.dispatchEvent(new CustomEvent('userWave', {'detail' : points})); window.dispatchEvent(new CustomEvent('userWave', {'detail' : points}));
}); });
/* window.max.binInlet("userWave", (...points) => {
window.dispatchEvent(new CustomEvent('userWave', {'detail' : [points]}));
log("received user points");
}); */
setInterval(() => { setInterval(() => {
window.dispatchEvent(new CustomEvent('tick')); window.dispatchEvent(new CustomEvent('tick'));
}, 200); }, 200);

View File

@@ -34,17 +34,17 @@ function LfoRow(props){
let typeOption = null; let typeOption = null;
if (props.type == "LFO"){ if (props.type == "LFO"){
typeOption = ListItem(DropDown({onChange: props.setShape, value:props.shape, options: SHAPETYPES})); typeOption = ListItem(DropDown({locked:props.locked, onChange: props.setShape, value:props.shape, options: SHAPETYPES}));
} }
else if (props.type == "Noise"){ else if (props.type == "Noise"){
typeOption = ListItem(DropDown({onChange: props.setNoise, value:props.noise, options: NOISETYPES})); typeOption = ListItem(DropDown({locked:props.locked, onChange: props.setNoise, value:props.noise, options: NOISETYPES}));
} }
let content = e('ul', {className: 'lfo-item'}, let content = e('ul', {className: 'lfo-item'},
ListItem(DropDown({onChange: props.setInstanceNum, value:props.instanceNum, options: INSTANCEOPTIONS})), ListItem(DropDown({locked:props.locked, onChange: props.setInstanceNum, value:props.instanceNum, options: INSTANCEOPTIONS})),
ListItem(DropDown({options: TYPEOPTIONS, onChange: props.setType, value:props.type})), ListItem(DropDown({locked:props.locked, options: TYPEOPTIONS, onChange: props.setType, value:props.type})),
typeOption, typeOption,
ListItem(DropDown({onChange: props.setDjParam, value: props.djParam, options: MODPARAMOPTIONS})), ListItem(DropDown({locked:props.locked, onChange: props.setDjParam, value: props.djParam, options: MODPARAMOPTIONS})),
ListItem(e("input", {onChange:props.setFreq, value:props.freq, className:"timeInput"}, null)), ListItem(e("input", {onChange:props.setFreq, value:props.freq, className:"timeInput"}, null)),
ListItem(e(NumberBox, {onChange:props.setMin, value:props.min, step:0.1}, null)), ListItem(e(NumberBox, {onChange:props.setMin, value:props.min, step:0.1}, null)),
ListItem(e(NumberBox, {onChange:props.setMax, value:props.max, step:0.1}, null)), ListItem(e(NumberBox, {onChange:props.setMax, value:props.max, step:0.1}, null)),
@@ -52,8 +52,8 @@ function LfoRow(props){
ListItem(e(NumberBox, {onChange:props.setPhase, value:props.phase, step:0.1}, null)), ListItem(e(NumberBox, {onChange:props.setPhase, value:props.phase, step:0.1}, null)),
ListItem(e("div", {className:"base-val"}, center.toString())), ListItem(e("div", {className:"base-val"}, center.toString())),
ListItem(e("input", {type: 'range', min: 0, max: 1, step: 0.01, readonly: true, id: `slider-${props.instanceNum}-${props.djParam}`})), ListItem(e("input", {type: 'range', min: 0, max: 1, step: 0.01, readonly: true, id: `slider-${props.instanceNum}-${props.djParam}`})),
ListItem(e(Button, {text:'+', onClick: props.addLfo}, null)), ListItem(e(Button, {text:'+', onClick: props.addLfo, locked: props.locked}, null)),
ListItem(e(Button, {text:'-', onClick: props.removeLfo}, null)), ListItem(e(Button, {text:'-', onClick: props.removeLfo, locked: props.locked}, null)),
ListItem(e("div", {className:"linked"}, linkedText)), ListItem(e("div", {className:"linked"}, linkedText)),
); );
if (props.visible){ if (props.visible){
@@ -143,14 +143,15 @@ function operateNoise(center, inst, timeBaseStr, min, max, waveType, phaseArr, i
phase = (maxTicks % timeBase) / timeBase; phase = (maxTicks % timeBase) / timeBase;
if (noiseData.cachedNoiseValueArr[index][0] == 0 || noiseData.lastPhaseArr[index] > phase){ // occurs if the phase reset to 0 or at the very start if (noiseData.cachedNoiseValueArr1[index] == 0 || noiseData.lastPhaseArr[index] > phase){ // occurs if the phase reset to 0 or at the very start
noiseData.cachedNoiseValueArr[index][0] = noiseData.cachedNoiseValueArr[index][1]; noiseData.cachedNoiseValueArr1[index] = noiseData.cachedNoiseValueArr2[index];
if (noiseData.cachedNoiseValueArr[index][0] == 0) if (noiseData.cachedNoiseValueArr1[index] == 0)
noiseData.cachedNoiseValueArr[index][0] = center; noiseData.cachedNoiseValueArr2[index] = center;
noiseData.cachedNoiseValueArr[index][1] = Math.random(); noiseData.cachedNoiseValueArr1[index] = Math.random();
noiseData.setCachedNoiseValueArr(noiseData.cachedNoiseValueArr); noiseData.setCachedNoiseValueArr1(noiseData.cachedNoiseValueArr1);
noiseData.setCachedNoiseValueArr2(noiseData.cachedNoiseValueArr2);
} }
noiseData.lastPhaseArr[index] = phase; noiseData.lastPhaseArr[index] = phase;
noiseData.setLastPhaseArr(noiseData.lastPhaseArr); noiseData.setLastPhaseArr(noiseData.lastPhaseArr);
@@ -158,7 +159,7 @@ function operateNoise(center, inst, timeBaseStr, min, max, waveType, phaseArr, i
let sinePhase = (Math.sin(Math.PI + Math.PI * phase) + 1) / 2 let sinePhase = (Math.sin(Math.PI + Math.PI * phase) + 1) / 2
//let unscaled = (noiseData.cachedNoiseValueArr[index][1] - noiseData.cachedNoiseValueArr[index][0]) * sinePhase + noiseData.cachedNoiseValueArr[index][0]; //let unscaled = (noiseData.cachedNoiseValueArr[index][1] - noiseData.cachedNoiseValueArr[index][0]) * sinePhase + noiseData.cachedNoiseValueArr[index][0];
let unscaled = interpolateNoise(noiseData.noiseTypeArr[index], noiseData.cachedNoiseValueArr[index][0], noiseData.cachedNoiseValueArr[index][1], phase); let unscaled = interpolateNoise(noiseType, noiseData.cachedNoiseValueArr1[index], noiseData.cachedNoiseValueArr2[index], phase);
syncDisplay(inst, name, unscaled); syncDisplay(inst, name, unscaled);
return unscaled * amp + center + parseFloat(min); return unscaled * amp + center + parseFloat(min);