Compare commits
10 Commits
af98d457cd
...
1d8610fa5f
Author | SHA1 | Date | |
---|---|---|---|
1d8610fa5f | |||
ebd09dfd26 | |||
13cddd8f03 | |||
1f3972fc6f | |||
b860254884 | |||
a4842b4865 | |||
315a8df1a0 | |||
f9a8c05955 | |||
8381daf468 | |||
e50e4c1e0c |
12
common.js
12
common.js
@ -1,3 +1,9 @@
|
||||
function isNumeric(str) {
|
||||
if (typeof str != "string") return false // we only process strings!
|
||||
return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
|
||||
!isNaN(parseFloat(str)) // ...and ensure strings of whitespace fail
|
||||
}
|
||||
|
||||
function DropDown(props) {
|
||||
return e('select', {type: "number", onChange: props.onChange, value: props.value},
|
||||
...props.options.map((item) => Option(item)));
|
||||
@ -33,12 +39,12 @@ function Switch(props){
|
||||
e('span', {className: 'slider round'}, null))
|
||||
}
|
||||
|
||||
function CreateParamChanger(arr, setArr, index, cb=() => {}){
|
||||
function CreateParamChanger(arr, setArr, index, postCB=() => {}, preCB=(val) => val){
|
||||
return (event) => {
|
||||
let newArr = arr.slice();
|
||||
newArr[index] = event.target.value;
|
||||
newArr[index] = preCB(event.target.value);
|
||||
setArr(newArr);
|
||||
cb();
|
||||
postCB();
|
||||
log(`${index} ${event.target.value}`);
|
||||
}
|
||||
}
|
||||
|
16
enums.js
16
enums.js
@ -17,19 +17,33 @@ function EnumeratorItems(index, enumBreakPoints, setEnumBreakPoints, enumNames,
|
||||
}
|
||||
|
||||
function EnumeratorRow(props){
|
||||
let linkedText = props.linked ? "<- mods" : "";
|
||||
|
||||
let content = e('ul', {className: 'lfo-item', id: `${props.djParam}-enum-row`},
|
||||
ListItem(DropDown({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, {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)),
|
||||
ListItem(e(Button, {text:'+', onClick: props.addEnum}, null)),
|
||||
ListItem(e(Button, {text:'-', onClick: props.removeEnum}, null))
|
||||
ListItem(e(Button, {text:'-', onClick: props.removeEnum}, null)),
|
||||
ListItem(e("div", {className:"linked"}, linkedText))
|
||||
);
|
||||
if (props.visible){
|
||||
return content;
|
||||
};
|
||||
}
|
||||
|
||||
function denumerate(inval, count, keys, vals){
|
||||
let output = inval;
|
||||
for (let i=0; i < count; i++){
|
||||
log(vals[i]);
|
||||
if (inval == vals[i]){
|
||||
output = (parseFloat(keys[i]) + parseFloat(keys[i+1])) / 2; // linear interpolate
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
function enumerate(name, inval, count, keys, vals){
|
||||
let output = "OUT OF RANGE";
|
||||
|
2680
example-with-dj.maxpat
Normal file
2680
example-with-dj.maxpat
Normal file
File diff suppressed because it is too large
Load Diff
600
example.maxpat
600
example.maxpat
@ -10,7 +10,7 @@
|
||||
}
|
||||
,
|
||||
"classnamespace" : "box",
|
||||
"rect" : [ 299.0, 99.0, 1220.0, 715.0 ],
|
||||
"rect" : [ 533.0, 91.0, 1344.0, 869.0 ],
|
||||
"bglocked" : 0,
|
||||
"openinpresentation" : 0,
|
||||
"default_fontsize" : 12.0,
|
||||
@ -39,26 +39,375 @@
|
||||
"subpatcher_template" : "",
|
||||
"assistshowspatchername" : 0,
|
||||
"boxes" : [ {
|
||||
"box" : {
|
||||
"id" : "obj-53",
|
||||
"maxclass" : "button",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "bang" ],
|
||||
"parameter_enable" : 0,
|
||||
"patching_rect" : [ 737.0, 43.0, 24.0, 24.0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-1",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 684.0, 146.0, 94.0, 22.0 ],
|
||||
"text" : "prepend timesig"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-52",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 545.0, 135.0, 89.0, 22.0 ],
|
||||
"text" : "prepend tempo"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-49",
|
||||
"linecount" : 2,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 868.0, 96.0, 150.0, 33.0 ],
|
||||
"text" : "ADD SUPPORT FOR MUSICAL TIMINGS"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-37",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "bang" ],
|
||||
"patching_rect" : [ 325.0, 17.0, 55.0, 22.0 ],
|
||||
"text" : "del 1000"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-36",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 0,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 485.0, 40.0, 49.0, 22.0 ],
|
||||
"text" : "r reload"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-34",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 357.0, 762.0, 51.0, 22.0 ],
|
||||
"text" : "s reload"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-32",
|
||||
"maxclass" : "preset",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 5,
|
||||
"outlettype" : [ "preset", "int", "preset", "int", "" ],
|
||||
"patching_rect" : [ 347.0, 707.0, 100.0, 40.0 ],
|
||||
"pattrstorage" : "storage"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-28",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 523.0, 747.0, 116.0, 22.0 ],
|
||||
"saved_object_attributes" : {
|
||||
"client_rect" : [ 1071, 252, 1680, 568 ],
|
||||
"parameter_enable" : 0,
|
||||
"parameter_mappable" : 0,
|
||||
"storage_rect" : [ 780, 524, 1380, 824 ]
|
||||
}
|
||||
,
|
||||
"text" : "pattrstorage storage",
|
||||
"varname" : "storage"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-26",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 3,
|
||||
"outlettype" : [ "", "", "" ],
|
||||
"patching_rect" : [ 643.0, 770.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 ], [ "3", 2, 2, "2", "2", "2", "2", "2", "2", "2" ], [ "meter", "NONE", "NONE", "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 ] ], [ [ "3 4", "4 4", "7 8", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "meter", "eventfulness", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "0.1hz", "1hz", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "0.5", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ], [ "2.5", "0", "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" ] ]
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
"saved_object_attributes" : {
|
||||
"parameter_enable" : 0,
|
||||
"parameter_mappable" : 0
|
||||
}
|
||||
,
|
||||
"text" : "pattr",
|
||||
"varname" : "u560003760"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"data" : {
|
||||
"data" : {
|
||||
"enumArrays" : [ [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "3", 2, 2, "2", "2", "2", "2", "2", "2", "2" ], [ "meter", "NONE", "NONE", "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 ] ], [ [ "3 4", "4 4", "7 8", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "meter", "eventfulness", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "0.1hz", "1hz", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "0.5", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0" ], [ "2.5", "0", "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" ] ]
|
||||
}
|
||||
|
||||
}
|
||||
,
|
||||
"id" : "obj-25",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 4,
|
||||
"outlettype" : [ "dictionary", "", "", "" ],
|
||||
"patching_rect" : [ 773.0, 808.0, 166.0, 22.0 ],
|
||||
"saved_object_attributes" : {
|
||||
"embed" : 1,
|
||||
"parameter_enable" : 0,
|
||||
"parameter_mappable" : 0
|
||||
}
|
||||
,
|
||||
"text" : "dict localStorage2 @embed 1",
|
||||
"varname" : "dict"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-13",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 971.0, 590.0, 32.0, 22.0 ],
|
||||
"text" : "print"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-47",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 9,
|
||||
"outlettype" : [ "int", "int", "float", "float", "float", "", "int", "float", "" ],
|
||||
"patching_rect" : [ 744.815790414810181, 107.0, 103.0, 22.0 ],
|
||||
"text" : "transport"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-43",
|
||||
"linecount" : 4,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 1045.5, 528.0, 150.0, 60.0 ],
|
||||
"text" : "range should be user controllable - adds to user defined center point. Remove amp."
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-40",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "bang" ],
|
||||
"patching_rect" : [ 1041.0, 687.0, 22.0, 22.0 ],
|
||||
"text" : "t b"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-38",
|
||||
"maxclass" : "dict.view",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 1009.631580829620361, 742.0, 231.0, 134.0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"bubble" : 1,
|
||||
"id" : "obj-30",
|
||||
"linecount" : 4,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 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"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-22",
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 22.0, 444.0, 105.0, 22.0 ],
|
||||
"text" : "param meter \"3 4\""
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-41",
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 949.0, 647.0, 156.0, 22.0 ],
|
||||
"text" : "attenuation 200"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-39",
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 824.0, 647.0, 101.0, 22.0 ],
|
||||
"text" : "scale pentatonic"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-35",
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 662.0, 647.0, 157.0, 22.0 ],
|
||||
"text" : "harmoniclarity 33.124751"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-33",
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 569.0, 647.0, 87.0, 22.0 ],
|
||||
"text" : "meter 4 4"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-31",
|
||||
"linecount" : 2,
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 493.0, 444.0, 161.0, 35.0 ],
|
||||
"text" : "\"harmoniclarity 0.1955362124045653\""
|
||||
"patching_rect" : [ 485.0, 647.0, 80.0, 35.0 ],
|
||||
"text" : "stream 0.207125"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-29",
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 347.0, 647.0, 133.0, 22.0 ],
|
||||
"text" : "metriclarity 20"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-27",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 9,
|
||||
"numoutlets" : 9,
|
||||
"outlettype" : [ "", "", "", "", "", "", "", "", "" ],
|
||||
"patching_rect" : [ 423.5, 588.0, 441.0, 22.0 ],
|
||||
"text" : "routepass metriclarity stream meter harmoniclarity scale attenuation saved debug"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-17",
|
||||
"linecount" : 2,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 518.0, 541.0, 268.0, 33.0 ],
|
||||
"text" : "we can only output symbols from jweb, so this turns them into lists"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-10",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 423.5, 552.0, 71.0, 22.0 ],
|
||||
"text" : "fromsymbol"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-19",
|
||||
"linecount" : 2,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 541.52631402015686, 69.0, 150.0, 20.0 ],
|
||||
"text" : "self explanatory"
|
||||
"patching_rect" : [ 548.52631402015686, 80.0, 150.0, 33.0 ],
|
||||
"text" : "see below for why we use separate names..."
|
||||
}
|
||||
|
||||
}
|
||||
@ -69,7 +418,7 @@
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 817.0, 45.0, 150.0, 47.0 ],
|
||||
"patching_rect" : [ 796.0, 27.5, 150.0, 47.0 ],
|
||||
"text" : "self explanatory. Warning-will overwrite whatever is saved."
|
||||
}
|
||||
|
||||
@ -81,20 +430,20 @@
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 1039.0, 50.0, 150.0, 60.0 ],
|
||||
"patching_rect" : [ 1045.5, 69.0, 152.0, 60.0 ],
|
||||
"text" : "You can use the `phase` control to phase offset two LFOs of the same frequency"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"bubble" : 1,
|
||||
"id" : "obj-7",
|
||||
"linecount" : 3,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 109.0, 285.0, 197.0, 47.0 ],
|
||||
"presentation_linecount" : 3,
|
||||
"patching_rect" : [ 153.0, 274.0, 197.0, 51.0 ],
|
||||
"text" : "This parameter is defined in the enumerators but not the modulators"
|
||||
}
|
||||
|
||||
@ -106,43 +455,33 @@
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 146.0, 334.0, 94.0, 22.0 ],
|
||||
"patching_rect" : [ 59.0, 256.0, 94.0, 22.0 ],
|
||||
"text" : "param scale 1.6"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-25",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "bang" ],
|
||||
"patching_rect" : [ 454.0, 27.5, 48.0, 22.0 ],
|
||||
"text" : "del 200"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"bubble" : 1,
|
||||
"id" : "obj-24",
|
||||
"linecount" : 3,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 89.0, 358.0, 254.0, 47.0 ],
|
||||
"patching_rect" : [ 133.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"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"bubble" : 1,
|
||||
"id" : "obj-23",
|
||||
"linecount" : 3,
|
||||
"linecount" : 4,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 115.0, 201.0, 197.0, 47.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 low value for that LFO"
|
||||
}
|
||||
|
||||
@ -150,12 +489,12 @@
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-21",
|
||||
"linecount" : 10,
|
||||
"linecount" : 11,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 89.0, 463.0, 254.0, 141.0 ],
|
||||
"text" : "The operation runs\n\nInput > 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"
|
||||
"patching_rect" : [ 45.0, 564.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"
|
||||
}
|
||||
|
||||
}
|
||||
@ -166,8 +505,8 @@
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 135.0, 259.0, 121.0, 22.0 ],
|
||||
"text" : "param metriclarity 40"
|
||||
"patching_rect" : [ 48.0, 181.0, 121.0, 22.0 ],
|
||||
"text" : "param metriclarity 20"
|
||||
}
|
||||
|
||||
}
|
||||
@ -178,7 +517,7 @@
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 115.0, 409.0, 129.0, 22.0 ],
|
||||
"patching_rect" : [ 28.0, 331.0, 129.0, 22.0 ],
|
||||
"text" : "param attenuation 200"
|
||||
}
|
||||
|
||||
@ -190,35 +529,26 @@
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 438.52631402015686, 69.0, 101.0, 22.0 ],
|
||||
"text" : "load localStorage"
|
||||
"patching_rect" : [ 438.52631402015686, 69.0, 108.0, 22.0 ],
|
||||
"text" : "load localStorage2"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"data" : {
|
||||
"data" : {
|
||||
"enumArrays" : [ [ 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "2", 2, 2, 2, "2", "2", "2", "2", "2", "2" ], [ "event_length", "meter", "stream", "scale", "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" ], [ "3 4", "7 8", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "0", "1", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "pentatonic", "major", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "param", "param", "param", "param" ], [ "param", "param", "param", "param", "param", "param", "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 ], [ "Sine", "SawUp", "SawDown", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "metriclarity", "stream", "meter", "harmoniclarity", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation" ], [ "0.6", "0.3", "0.1", "0.6", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "30", "2", "2", "1", "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" ] ]
|
||||
}
|
||||
|
||||
}
|
||||
,
|
||||
"id" : "obj-4",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 4,
|
||||
"outlettype" : [ "dictionary", "", "", "" ],
|
||||
"patching_rect" : [ 22.0, 102.0, 159.0, 22.0 ],
|
||||
"patching_rect" : [ 1041.0, 711.0, 97.0, 22.0 ],
|
||||
"saved_object_attributes" : {
|
||||
"embed" : 1,
|
||||
"embed" : 0,
|
||||
"parameter_enable" : 0,
|
||||
"parameter_mappable" : 0
|
||||
}
|
||||
,
|
||||
"text" : "dict localStorage @embed 1"
|
||||
"text" : "dict localStorage"
|
||||
}
|
||||
|
||||
}
|
||||
@ -233,28 +563,16 @@
|
||||
"text" : "required due to the asynchronous operation"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-3",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "bang" ],
|
||||
"patching_rect" : [ 374.157894849777222, 27.5, 55.0, 22.0 ],
|
||||
"text" : "del 1000"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-45",
|
||||
"linecount" : 5,
|
||||
"linecount" : 8,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 31.0, 18.0, 150.0, 74.0 ],
|
||||
"text" : "Storage for the matrix. Unfortunately, jsweb dictionary handling isn't great, so we can't use it like a native dict object"
|
||||
"patching_rect" : [ 773.0, 692.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"
|
||||
}
|
||||
|
||||
}
|
||||
@ -301,7 +619,7 @@
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 438.52631402015686, 115.0, 643.105266809463501, 318.0 ],
|
||||
"patching_rect" : [ 402.0, 174.0, 788.631580829620361, 367.0 ],
|
||||
"rendermode" : 0,
|
||||
"url" : "file://lfogui.html"
|
||||
}
|
||||
@ -309,6 +627,20 @@
|
||||
}
|
||||
],
|
||||
"lines" : [ {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-2", 0 ],
|
||||
"source" : [ "obj-1", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-27", 0 ],
|
||||
"source" : [ "obj-10", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-2", 0 ],
|
||||
"source" : [ "obj-12", 0 ]
|
||||
@ -338,7 +670,7 @@
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-28", 1 ],
|
||||
"destination" : [ "obj-10", 0 ],
|
||||
"source" : [ "obj-2", 0 ]
|
||||
}
|
||||
|
||||
@ -353,16 +685,101 @@
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-3", 0 ],
|
||||
"destination" : [ "obj-37", 0 ],
|
||||
"order" : 0,
|
||||
"source" : [ "obj-20", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-2", 0 ],
|
||||
"source" : [ "obj-22", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-25", 0 ],
|
||||
"source" : [ "obj-26", 1 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-13", 0 ],
|
||||
"source" : [ "obj-27", 7 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-29", 1 ],
|
||||
"source" : [ "obj-27", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-31", 1 ],
|
||||
"source" : [ "obj-27", 1 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-33", 1 ],
|
||||
"source" : [ "obj-27", 2 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-35", 1 ],
|
||||
"source" : [ "obj-27", 3 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-39", 1 ],
|
||||
"source" : [ "obj-27", 4 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-40", 0 ],
|
||||
"source" : [ "obj-27", 6 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-41", 1 ],
|
||||
"source" : [ "obj-27", 5 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-34", 0 ],
|
||||
"source" : [ "obj-32", 1 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-16", 0 ],
|
||||
"source" : [ "obj-36", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-15", 0 ],
|
||||
"source" : [ "obj-25", 0 ]
|
||||
"order" : 2,
|
||||
"source" : [ "obj-37", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
@ -370,15 +787,52 @@
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-16", 0 ],
|
||||
"order" : 1,
|
||||
"source" : [ "obj-3", 0 ]
|
||||
"source" : [ "obj-37", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-47", 0 ],
|
||||
"order" : 0,
|
||||
"source" : [ "obj-37", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-25", 0 ],
|
||||
"order" : 1,
|
||||
"source" : [ "obj-4", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-38", 0 ],
|
||||
"order" : 0,
|
||||
"source" : [ "obj-3", 0 ]
|
||||
"source" : [ "obj-4", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-4", 0 ],
|
||||
"source" : [ "obj-40", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-1", 0 ],
|
||||
"source" : [ "obj-47", 5 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-52", 0 ],
|
||||
"source" : [ "obj-47", 4 ]
|
||||
}
|
||||
|
||||
}
|
||||
@ -388,6 +842,20 @@
|
||||
"source" : [ "obj-5", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-2", 0 ],
|
||||
"source" : [ "obj-52", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-47", 0 ],
|
||||
"source" : [ "obj-53", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
|
26
lfogui.html
26
lfogui.html
@ -44,6 +44,12 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.timeInput {
|
||||
width: 80px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#matrix {
|
||||
background-color: aquamarine;
|
||||
height: 100%;
|
||||
@ -152,6 +158,25 @@
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.base-val {
|
||||
background-color: lightgray;
|
||||
border-color: #333333;
|
||||
border-width: 1px;
|
||||
width: 50px;
|
||||
margin-left: 2px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.linked {
|
||||
color: red;
|
||||
border-width: 1px;
|
||||
width: 50px;
|
||||
font-size: small;
|
||||
margin-left: 2px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
|
||||
@keyframes pulse-animation {
|
||||
0% {
|
||||
color: black;
|
||||
@ -175,6 +200,7 @@
|
||||
|
||||
<script src="./react.js"></script>
|
||||
<script src="./react-dom.js"></script>
|
||||
<script src="./moment.js"></script>
|
||||
<script src="./common.js"></script>
|
||||
<script src="./enums.js"></script>
|
||||
<script src="./modulators.js"></script>
|
||||
|
78
lfogui.js
78
lfogui.js
@ -4,7 +4,7 @@ var log;
|
||||
if (DEBUG)
|
||||
log = console.log;
|
||||
else
|
||||
log = window.max.outlet;
|
||||
log = (msg) => {window.max.outlet("debug " + msg)};
|
||||
|
||||
const e = React.createElement;
|
||||
|
||||
@ -24,10 +24,12 @@ const ViewModes = Object.freeze({
|
||||
var modPhases = Array(MAXLFOS).fill(0);
|
||||
var firstUpdateTime = Date.now();
|
||||
|
||||
const MODULATORLABELS = ["-type-", "---shape---", "-------param-------", "--freq--", "--amp--", "--phase--"];
|
||||
const MODULATORLABELS = ["-type-", "---shape---", "-------param-------", "--timebase--", "-min-", "-max", "-phase-", "center"];
|
||||
const ENUMERATORLABELS = ["---parameter---", "-# points-"];
|
||||
|
||||
|
||||
|
||||
|
||||
function MasterLfoHandler(){
|
||||
|
||||
let initVisArr = Array(MAXLFOS).fill(false);
|
||||
@ -47,16 +49,23 @@ function MasterLfoHandler(){
|
||||
|
||||
const [modCenterVals, setModCenterVals] = React.useState({});
|
||||
|
||||
const [bpm, setBpm] = React.useState(100);
|
||||
const [beatsInMeasure, setBeatsInMeasure] = React.useState(4);
|
||||
|
||||
const [shapeArr, setShapeArr] = React.useState(Array(MAXLFOS).fill('Sine'));
|
||||
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'));
|
||||
const [freqArr, setFreqArr] = React.useState(Array(MAXLFOS).fill('1hz'));
|
||||
|
||||
// const [ampArr, setAmpArr] = React.useState(Array(MAXLFOS).fill('1'));
|
||||
const [minArr, setMinArr] = React.useState(Array(MAXLFOS).fill('0'));
|
||||
const [maxArr, setMaxArr] = React.useState(Array(MAXLFOS).fill('1'));
|
||||
|
||||
const [phaseArr, setPhaseArr] = React.useState(Array(MAXLFOS).fill('0'));
|
||||
|
||||
const allModArrays = [modVisibleArr, shapeArr, djParamArr, freqArr, ampArr, phaseArr];
|
||||
const allModSetters = [setModVisibleArr, setShapeArr, setDjParamArr, setFreqArr, setAmpArr, setPhaseArr];
|
||||
const modBlankVals = [true, SHAPETYPES[0], MODPARAMOPTIONS[0], '1', '1', '0'];
|
||||
const allModArrays = [modVisibleArr, shapeArr, djParamArr, freqArr, minArr, maxArr, phaseArr];
|
||||
const allModSetters = [setModVisibleArr, setShapeArr, setDjParamArr, setFreqArr, setMinArr, setMaxArr, setPhaseArr];
|
||||
const modBlankVals = [true, SHAPETYPES[0], MODPARAMOPTIONS[0], '1', '0', '1', '0'];
|
||||
|
||||
|
||||
/// ENUMERATOR ARRAYS
|
||||
@ -114,10 +123,6 @@ function MasterLfoHandler(){
|
||||
allEnumMatSetters[i](dict.data.enumMats[i]);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function handleSave(event) {
|
||||
@ -127,6 +132,7 @@ function MasterLfoHandler(){
|
||||
'enumMats' : allEnumMats
|
||||
}
|
||||
window.max.setDict(event.detail, {"data" : data});
|
||||
window.max.outlet("saved");
|
||||
}
|
||||
|
||||
|
||||
@ -157,6 +163,12 @@ function MasterLfoHandler(){
|
||||
|
||||
let name = event.detail[0];
|
||||
let val = event.detail[1];
|
||||
// CHECK FOR INDEX OF THIS NAME IN ENUM MATRIX, AND IF IT IS THERE DENUMERATE
|
||||
let index = enumDjParamArr.indexOf(name);
|
||||
if (index != -1){
|
||||
val = denumerate(val, enumItemCounts[index], enumBreakPoints[index], enumNames[index]);
|
||||
}
|
||||
|
||||
|
||||
// if none of the LFOs use this param, then we send it straight to the enum
|
||||
let i = 0;
|
||||
@ -172,14 +184,22 @@ function MasterLfoHandler(){
|
||||
|
||||
modCenterVals[name] = val;
|
||||
setModCenterVals(modCenterVals);
|
||||
|
||||
rerender(!render); // BAD! SHOULD NOT BE DOING THIS!
|
||||
|
||||
|
||||
}
|
||||
|
||||
function handleTick(event) {
|
||||
let time = (Date.now() - firstUpdateTime) / 1000;
|
||||
operateModulators(modVisibleArr, djParamArr, modCenterVals, freqArr, ampArr, shapeArr, phaseArr, time);
|
||||
operateModulators(modVisibleArr, djParamArr, modCenterVals, freqArr, minArr, maxArr, shapeArr, phaseArr, time, bpm, beatsInMeasure);
|
||||
}
|
||||
|
||||
function handleBpm(event) {
|
||||
setBpm(event.detail);
|
||||
}
|
||||
|
||||
function handleTimeSig(event) {
|
||||
setBeatsInMeasure(parseFloat(event.detail[0]) * parseFloat(event.detail[1])/ 4);
|
||||
}
|
||||
|
||||
|
||||
@ -188,6 +208,8 @@ function MasterLfoHandler(){
|
||||
window.addEventListener('tick', handleTick);
|
||||
window.addEventListener('param', handleParam);
|
||||
window.addEventListener('enum', handleEnum);
|
||||
window.addEventListener('tempo', handleBpm);
|
||||
window.addEventListener('timesig', handleTimeSig);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('loadDict', handleLoad);
|
||||
@ -195,8 +217,10 @@ function MasterLfoHandler(){
|
||||
window.removeEventListener('tick', handleTick);
|
||||
window.removeEventListener('param', handleParam);
|
||||
window.removeEventListener('enum', handleEnum);
|
||||
window.removeEventListener('tempo', handleBpm);
|
||||
window.removeEventListener('timesig', handleTimeSig);
|
||||
};
|
||||
}, [...allModArrays, ...allEnumArrays, ...allEnumMats, modCenterVals]);
|
||||
}, [...allModArrays, ...allEnumArrays, ...allEnumMats, modCenterVals, render, bpm, beatsInMeasure]);
|
||||
|
||||
|
||||
|
||||
@ -204,24 +228,35 @@ function MasterLfoHandler(){
|
||||
///////
|
||||
// Generate Modulators
|
||||
///////
|
||||
|
||||
let modContents = []
|
||||
for (var i = 0; i<MAXLFOS; i++){
|
||||
let id = i;
|
||||
|
||||
modContents.push(
|
||||
|
||||
e(LfoRow, {
|
||||
shape: shapeArr[i],
|
||||
setShape: CreateParamChanger(shapeArr, setShapeArr, i),
|
||||
djParam: djParamArr[i],
|
||||
setDjParam: CreateParamChanger(djParamArr, setDjParamArr, i),
|
||||
centerVals: modCenterVals,
|
||||
|
||||
freq: freqArr[i],
|
||||
setFreq: CreateParamChanger(freqArr, setFreqArr, i),
|
||||
amp: ampArr[i],
|
||||
setAmp: CreateParamChanger(ampArr, setAmpArr, i),
|
||||
|
||||
//amp: ampArr[i],
|
||||
//setAmp: CreateParamChanger(ampArr, setAmpArr, i),
|
||||
|
||||
min: minArr[i],
|
||||
setMin : CreateParamChanger(minArr, setMinArr, i),
|
||||
max: maxArr[i],
|
||||
setMax: CreateParamChanger(maxArr, setMaxArr, i),
|
||||
|
||||
phase: phaseArr[i],
|
||||
setPhase: CreateParamChanger(phaseArr, setPhaseArr, i),
|
||||
visible: modVisibleArr[i],
|
||||
|
||||
linked: enumDjParamArr.includes(djParamArr[i]),
|
||||
addLfo: () => {
|
||||
if (id < MAXLFOS - 1){
|
||||
if (modVisibleArr[id + 1]){
|
||||
@ -279,6 +314,7 @@ function MasterLfoHandler(){
|
||||
visible: enumVisibleArr[i],
|
||||
djParam: enumDjParamArr[i],
|
||||
setDjParam: CreateParamChanger(enumDjParamArr, setEnumDjParamArr, i),
|
||||
linked: djParamArr.includes(enumDjParamArr[i]),
|
||||
addEnum: () => {
|
||||
if (id < MAXLFOS - 1){
|
||||
if (enumVisibleArr[id + 1]){ // if we need to open up space
|
||||
@ -369,6 +405,14 @@ if (!DEBUG){
|
||||
window.dispatchEvent(new CustomEvent('param', {'detail' : [paramName, val]}));
|
||||
});
|
||||
|
||||
window.max.bindInlet("tempo", (val) => {
|
||||
window.dispatchEvent(new CustomEvent('tempo', {'detail' : val}));
|
||||
});
|
||||
|
||||
window.max.bindInlet("timesig", (top, bottom) => {
|
||||
window.dispatchEvent(new CustomEvent('timesig', {'detail' : [top, bottom]}));
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
window.dispatchEvent(new CustomEvent('tick'));
|
||||
}, 200);
|
||||
|
@ -3,6 +3,7 @@
|
||||
/////////////////////////
|
||||
|
||||
var SHAPETYPES = ["Sine", "SawUp", "SawDown", "Tri", "Square"];
|
||||
|
||||
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"];
|
||||
@ -14,16 +15,26 @@ function ControlType(){
|
||||
|
||||
|
||||
function LfoRow(props){
|
||||
|
||||
let linkedText = props.linked ? "-> enums" : "";
|
||||
let center = props.centerVals[props.djParam];
|
||||
if (!center)
|
||||
center = 0;
|
||||
|
||||
let content = e('ul', {className: 'lfo-item'},
|
||||
ListItem(ControlType()),
|
||||
ListItem(DropDown({onChange: props.setShape, value:props.shape, options: SHAPETYPES})),
|
||||
ListItem(DropDown({onChange: props.setDjParam, value: props.djParam, options: MODPARAMOPTIONS})),
|
||||
ListItem(e(NumberBox, {onChange:props.setFreq, value:props.freq, step: 0.1}, null)),
|
||||
ListItem(e(NumberBox, {onChange:props.setAmp, value:props.amp, step:0.1}, 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.setMax, value:props.max, step:0.1}, null)),
|
||||
//ListItem(e(NumberBox, {onChange:props.setAmp, value:props.amp, 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("input", {type: 'range', min: 0, max: 1, step: 0.01, readonly: true, id: `slider-${props.djParam}`})),
|
||||
ListItem(e(Button, {text:'+', onClick: props.addLfo}, null)),
|
||||
ListItem(e(Button, {text:'-', onClick: props.removeLfo}, null))
|
||||
ListItem(e(Button, {text:'-', onClick: props.removeLfo}, null)),
|
||||
ListItem(e("div", {className:"linked"}, linkedText)),
|
||||
);
|
||||
if (props.visible){
|
||||
return content
|
||||
@ -45,7 +56,7 @@ function indexWave(type, phase){
|
||||
}
|
||||
}
|
||||
|
||||
function operateModulators(visibleArr, paramNames, centers, freqs, amps, waveTypes, phaseArr, time){
|
||||
function operateModulators(visibleArr, paramNames, centers, freqs, mins, maxs, waveTypes, phaseArr, currTime, bpm, beatsInMeasure){
|
||||
for (let i=0; i<paramNames.length; i++){
|
||||
if (visibleArr[i]){
|
||||
let name = paramNames[i];
|
||||
@ -53,21 +64,53 @@ function operateModulators(visibleArr, paramNames, centers, freqs, amps, waveTyp
|
||||
if (centers.hasOwnProperty(name)){
|
||||
center = centers[name];
|
||||
}
|
||||
let output = operateModulator(center, freqs[i], amps[i], waveTypes[i], phaseArr, i, name, time);
|
||||
let output = operateModulator(center, freqs[i], mins[i], maxs[i], waveTypes[i], phaseArr, i, name, currTime, bpm, beatsInMeasure);
|
||||
if (name !== "NONE")
|
||||
window.dispatchEvent(new CustomEvent('enum', {'detail' : [name, output]}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function operateModulator(center, freq, amp, waveType, phaseArr, phaseI, name, time){
|
||||
|
||||
let phase = (time * freq + parseFloat(phaseArr[phaseI])) % 1.00;
|
||||
function operateModulator(center, freq, min, max, waveType, phaseArr, phaseI, name, currTime, bpm, beatsInMeasure){
|
||||
let amp = parseFloat(max) - parseFloat(min);
|
||||
freq = parseLfoTime(freq, bpm, beatsInMeasure);
|
||||
let phase = (currTime * freq + parseFloat(phaseArr[phaseI])) % 1.00;
|
||||
let unscaled = indexWave(waveType, phase);
|
||||
let el = document.getElementById(`slider-${name}`);
|
||||
|
||||
if (el)
|
||||
el.value = unscaled;
|
||||
|
||||
return unscaled * amp + center;
|
||||
return unscaled * amp + center + parseFloat(min);
|
||||
}
|
||||
|
||||
|
||||
function parseLfoTime(lfoTime, bpm, beatsInMeasure){
|
||||
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 musicalTimingToFreq(...lfoTime.split('.'), bpm, beatsInMeasure)
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function musicalTimingToFreq(bars, beats, ticks, bpm, beatsInMeasure){
|
||||
let totalTicks = (parseFloat(bars) * parseFloat(beatsInMeasure) + beats) * 480 + parseFloat(ticks);
|
||||
let tpm = bpm * 480;
|
||||
let cyclesPerMinute = tpm / totalTicks;
|
||||
let hz = cyclesPerMinute / 60;
|
||||
return hz;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user