diff --git a/example.maxpat b/example.maxpat index c6ff640..6f94d3c 100644 --- a/example.maxpat +++ b/example.maxpat @@ -10,7 +10,7 @@ } , "classnamespace" : "box", - "rect" : [ -1510.0, 147.0, 1170.0, 725.0 ], + "rect" : [ 34.0, 100.0, 1046.0, 725.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -39,13 +39,348 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "id" : "obj-59", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 263.551399827003479, 582.5, 150.0, 33.0 ], + "presentation_linecount" : 2, + "text" : "user definted LFO shape, up to 4 of em" + } + + } +, { + "box" : { + "id" : "obj-60", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 108.411214113235474, 710.266354560852051, 119.0, 22.0 ], + "text" : "prepend userWave 2" + } + + } +, { + "box" : { + "candicane2" : [ 0.145098, 0.203922, 0.356863, 1.0 ], + "candicane3" : [ 0.290196, 0.411765, 0.713726, 1.0 ], + "candicane4" : [ 0.439216, 0.619608, 0.070588, 1.0 ], + "candicane5" : [ 0.584314, 0.827451, 0.431373, 1.0 ], + "candicane6" : [ 0.733333, 0.035294, 0.788235, 1.0 ], + "candicane7" : [ 0.878431, 0.243137, 0.145098, 1.0 ], + "candicane8" : [ 0.027451, 0.447059, 0.501961, 1.0 ], + "contdata" : 1, + "id" : "obj-61", + "maxclass" : "multislider", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 118.691587865352631, 635.5, 162.0, 52.0 ], + "peakcolor" : [ 0.498039, 0.498039, 0.498039, 1.0 ], + "setminmax" : [ 0.0, 127.0 ], + "settype" : 0, + "size" : 50 + } + + } +, { "box" : { "id" : "obj-7", + "linecount" : 4, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 643.0, 631.0, 50.0, 22.0 ] + "patching_rect" : [ 479.0, 863.0, 50.0, 62.0 ], + "text" : "debug 0 Custom_1" + } + + } +, { + "box" : { + "id" : "obj-57", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 143.0, 148.0, 150.0, 33.0 ], + "text" : "check default enum break values" + } + + } +, { + "box" : { + "id" : "obj-55", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 45.0, 126.0, 150.0, 20.0 ], + "text" : "use 4 custom waves" + } + + } +, { + "box" : { + "id" : "obj-46", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 45.0, 80.5, 150.0, 33.0 ], + "text" : "check Max 9 dictionary integration" + } + + } +, { + "box" : { + "id" : "obj-29", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 45.0, 40.0, 150.0, 33.0 ], + "text" : "add function object support" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 45.0, 14.0, 150.0, 20.0 ], + "text" : "add random walk" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 925.0, 559.0, 50.0, 22.0 ], + "text" : "saved" + } + + } +, { + "box" : { + "id" : "obj-52", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 436.0, 57.0, 124.0, 22.0 ], + "text" : "s djster-param-values" + } + + } +, { + "box" : { + "id" : "obj-49", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 22.0, 159.0, 109.0, 22.0 ], + "text" : "r djster-param-vals" + } + + } +, { + "box" : { + "id" : "obj-47", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 6, + "revision" : 4, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 59.0, 119.0, 640.0, 480.0 ], + "bglocked" : 0, + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 1, + "gridsize" : [ 15.0, 15.0 ], + "gridsnaponopen" : 1, + "objectsnaponopen" : 1, + "statusbarvisible" : 2, + "toolbarvisible" : 1, + "lefttoolbarpinned" : 0, + "toptoolbarpinned" : 0, + "righttoolbarpinned" : 0, + "bottomtoolbarpinned" : 0, + "toolbars_unpinned_last_save" : 0, + "tallnewobj" : 0, + "boxanimatetime" : 200, + "enablehscroll" : 1, + "enablevscroll" : 1, + "devicewidth" : 0.0, + "description" : "", + "digest" : "", + "tags" : "", + "style" : "", + "subpatcher_template" : "", + "assistshowspatchername" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 80.815790414810181, 100.0, 210.0, 23.0 ], + "text" : "metro @interval 40 ticks @active 1" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 154.315790414810181, 163.0, 80.0, 22.0 ], + "text" : "prepend ticks" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 163.0, 94.0, 22.0 ], + "text" : "prepend timesig" + } + + } +, { + "box" : { + "id" : "obj-47", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 9, + "outlettype" : [ "int", "int", "float", "float", "float", "", "int", "float", "" ], + "patching_rect" : [ 80.815790414810181, 127.0, 103.0, 22.0 ], + "text" : "transport" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-28", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 80.815795999999978, 40.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-46", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 96.157898000000046, 245.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-46", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "source" : [ "obj-28", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-46", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-47", 5 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-47", 7 ] + } + + } + ] + } +, + "patching_rect" : [ 707.0, 125.0, 66.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p transport" + } + + } +, { + "box" : { + "id" : "obj-43", + "maxclass" : "button", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 98.0, 472.0, 24.0, 24.0 ] } } @@ -174,26 +509,6 @@ "text" : "prepend setNN" } - } -, { - "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" : [ 903, 252, 1512, 568 ], - "parameter_enable" : 0, - "parameter_mappable" : 0, - "storage_rect" : [ 780, 524, 1380, 824 ] - } -, - "text" : "pattrstorage asdf", - "varname" : "asdf" - } - } , { "box" : { @@ -207,7 +522,7 @@ "data" : { "enumArrays" : [ [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "1", "1", "4", "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", "meter", "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" ], [ "4 4", "3 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" ] ] ], - "modArrays" : [ [ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "Noise", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO" ], [ "1", "3", "4", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "SawDown", "Custom", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "Sine Int.", "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.", "Sine Int.", "Sine Int." ], [ "metriclarity", "attenuation", "meter", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "2s", "0.3hz", "1.3.0", "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" ], [ "3", "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.298999999999978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0.492543640556194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ] + "modArrays" : [ [ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "Noise", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO" ], [ "1", "3", "4", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "SawDown", "Custom", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "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.", "Sine Int.", "Sine Int." ], [ "metriclarity", "attenuation", "meter", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "2s", "0.3hz", "1.3.0", "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" ], [ "3", "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.800999999999988, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0.160992613021285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0.982628830832296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ] } } @@ -241,48 +556,10 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 363.0, 124.0, 56.0, 22.0 ], + "patching_rect" : [ 289.0, 125.0, 56.0, 22.0 ], "text" : "dumpNN" } - } -, { - "box" : { - "fontname" : "Arial", - "fontsize" : 13.0, - "id" : "obj-29", - "maxclass" : "newobj", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "bang" ], - "patching_rect" : [ 465.0, 141.0, 210.0, 23.0 ], - "text" : "metro @interval 40 ticks @active 1" - } - - } -, { - "box" : { - "id" : "obj-28", - "maxclass" : "button", - "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "bang" ], - "parameter_enable" : 0, - "patching_rect" : [ 826.0, 79.0, 24.0, 24.0 ] - } - - } -, { - "box" : { - "id" : "obj-3", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 817.0, 147.0, 80.0, 22.0 ], - "text" : "prepend ticks" - } - } , { "box" : { @@ -295,17 +572,6 @@ "text" : "r reload" } - } -, { - "box" : { - "id" : "obj-50", - "maxclass" : "comment", - "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 233.5, 589.0, 150.0, 20.0 ], - "text" : "user definted LFO shape" - } - } , { "box" : { @@ -314,8 +580,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 118.0, 606.5, 109.0, 22.0 ], - "text" : "prepend userWave" + "patching_rect" : [ 131.5, 588.0, 119.0, 22.0 ], + "text" : "prepend userWave 1" } } @@ -335,7 +601,7 @@ "numoutlets" : 2, "outlettype" : [ "", "" ], "parameter_enable" : 0, - "patching_rect" : [ 118.0, 528.5, 162.0, 52.0 ], + "patching_rect" : [ 142.0, 513.5, 162.0, 52.0 ], "peakcolor" : [ 0.498039, 0.498039, 0.498039, 1.0 ], "setminmax" : [ 0.0, 127.0 ], "settype" : 0, @@ -350,7 +616,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 27.0, 410.0, 115.0, 22.0 ], + "patching_rect" : [ 27.0, 377.0, 115.0, 22.0 ], "text" : "param 4 meter \"3 4\"" } @@ -390,7 +656,7 @@ "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 345.0, 737.0, 84.0, 35.0 ], - "text" : "metriclarity 2.770749" + "text" : "metriclarity 0.657874" } } @@ -455,18 +721,6 @@ "text" : "route 1 2 3 4" } - } -, { - "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" : { @@ -475,7 +729,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "bang" ], - "patching_rect" : [ 333.0, 40.0, 55.0, 22.0 ], + "patching_rect" : [ 313.0, 15.0, 55.0, 22.0 ], "text" : "del 1000" } @@ -487,7 +741,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 485.0, 40.0, 49.0, 22.0 ], + "patching_rect" : [ 351.0, 86.0, 49.0, 22.0 ], "text" : "r reload" } @@ -510,8 +764,7 @@ "numinlets" : 1, "numoutlets" : 5, "outlettype" : [ "preset", "int", "preset", "int", "" ], - "patching_rect" : [ 934.0, 27.0, 100.0, 40.0 ], - "pattrstorage" : "asdf" + "patching_rect" : [ 934.0, 27.0, 100.0, 40.0 ] } } @@ -521,7 +774,7 @@ "data" : { "enumArrays" : [ [ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "1", "1", "4", "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", "meter", "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" ], [ "4 4", "3 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" ] ] ], - "modArrays" : [ [ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "Noise", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO" ], [ "1", "3", "4", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "SawDown", "Custom", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "Sine Int.", "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.", "Sine Int.", "Sine Int." ], [ "metriclarity", "attenuation", "meter", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "2s", "0.3hz", "1.3.0", "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" ], [ "3", "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.298999999999978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0.492543640556194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ] + "modArrays" : [ [ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ "Noise", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO", "LFO" ], [ "1", "3", "4", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1" ], [ "SawDown", "Custom", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine", "Sine" ], [ "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.", "Sine Int.", "Sine Int." ], [ "metriclarity", "attenuation", "meter", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE" ], [ "2s", "0.3hz", "1.3.0", "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" ], [ "3", "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.800999999999988, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0.160992613021285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0.982628830832296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ] } } @@ -543,18 +796,6 @@ "varname" : "dict" } - } -, { - "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" : { @@ -598,7 +839,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 21.0, 381.0, 115.0, 22.0 ], + "patching_rect" : [ 35.0, 287.0, 115.0, 22.0 ], "text" : "param 4 meter \"4 4\"" } @@ -618,12 +859,13 @@ , { "box" : { "id" : "obj-39", + "linecount" : 2, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 799.0, 748.0, 101.0, 22.0 ], - "text" : "attenuation 1" + "patching_rect" : [ 799.0, 748.0, 101.0, 35.0 ], + "text" : "attenuation 0.204724" } } @@ -646,7 +888,7 @@ "numinlets" : 4, "numoutlets" : 4, "outlettype" : [ "", "", "", "" ], - "patching_rect" : [ 432.0, 594.0, 177.0, 22.0 ], + "patching_rect" : [ 432.0, 581.5, 177.0, 22.0 ], "text" : "routepass saved NNdata debug" } @@ -682,7 +924,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 548.52631402015686, 80.0, 150.0, 33.0 ], + "patching_rect" : [ 497.0, 107.0, 150.0, 33.0 ], "text" : "see below for why we use separate names..." } @@ -719,7 +961,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 114.0, 279.0, 254.0, 51.0 ], + "patching_rect" : [ 143.0, 278.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" } @@ -744,7 +986,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 59.0, 634.0, 254.0, 154.0 ], + "patching_rect" : [ 59.813083648681641, 797.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" } @@ -768,7 +1010,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 37.0, 253.0, 139.0, 22.0 ], + "patching_rect" : [ 27.0, 238.0, 139.0, 22.0 ], "text" : "param 3 attenuation 200" } @@ -780,7 +1022,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 438.52631402015686, 69.0, 108.0, 22.0 ], + "patching_rect" : [ 370.0, 125.0, 108.0, 22.0 ], "text" : "load localStorage2" } @@ -811,7 +1053,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 309.0, 6.0, 150.0, 33.0 ], + "patching_rect" : [ 384.0, 6.0, 150.0, 33.0 ], "text" : "required due to the asynchronous operation" } @@ -847,7 +1089,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 700.894735336303711, 69.0, 104.0, 22.0 ], + "patching_rect" : [ 485.0, 90.0, 104.0, 22.0 ], "text" : "save localStorage" } @@ -879,13 +1121,6 @@ } ], "lines" : [ { - "patchline" : { - "destination" : [ "obj-2", 0 ], - "source" : [ "obj-1", 0 ] - } - - } -, { "patchline" : { "destination" : [ "obj-27", 0 ], "source" : [ "obj-10", 0 ] @@ -963,6 +1198,14 @@ "source" : [ "obj-26", 1 ] } + } +, { + "patchline" : { + "destination" : [ "obj-3", 1 ], + "order" : 1, + "source" : [ "obj-27", 0 ] + } + } , { "patchline" : { @@ -974,6 +1217,7 @@ , { "patchline" : { "destination" : [ "obj-40", 0 ], + "order" : 0, "source" : [ "obj-27", 0 ] } @@ -991,27 +1235,6 @@ "source" : [ "obj-27", 2 ] } - } -, { - "patchline" : { - "destination" : [ "obj-47", 0 ], - "source" : [ "obj-28", 0 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-47", 0 ], - "source" : [ "obj-29", 0 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-2", 0 ], - "source" : [ "obj-3", 0 ] - } - } , { "patchline" : { @@ -1040,27 +1263,11 @@ "source" : [ "obj-36", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-15", 0 ], - "order" : 2, - "source" : [ "obj-37", 0 ] - } - } , { "patchline" : { "destination" : [ "obj-16", 0 ], - "order" : 1, - "source" : [ "obj-37", 0 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-22", 0 ], - "order" : 4, + "order" : 2, "source" : [ "obj-37", 0 ] } @@ -1075,8 +1282,8 @@ } , { "patchline" : { - "destination" : [ "obj-8", 0 ], - "order" : 3, + "destination" : [ "obj-52", 0 ], + "order" : 1, "source" : [ "obj-37", 0 ] } @@ -1103,6 +1310,13 @@ "source" : [ "obj-40", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "source" : [ "obj-43", 0 ] + } + } , { "patchline" : { @@ -1113,15 +1327,8 @@ } , { "patchline" : { - "destination" : [ "obj-1", 0 ], - "source" : [ "obj-47", 5 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-3", 0 ], - "source" : [ "obj-47", 7 ] + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-47", 0 ] } } @@ -1131,6 +1338,38 @@ "source" : [ "obj-48", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-15", 0 ], + "order" : 0, + "source" : [ "obj-49", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "order" : 1, + "source" : [ "obj-49", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "order" : 3, + "source" : [ "obj-49", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-86", 0 ], + "order" : 2, + "source" : [ "obj-49", 0 ] + } + } , { "patchline" : { @@ -1142,9 +1381,32 @@ , { "patchline" : { "destination" : [ "obj-33", 0 ], + "order" : 0, "source" : [ "obj-54", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-61", 0 ], + "order" : 1, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-60", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-60", 0 ], + "source" : [ "obj-61", 0 ] + } + } , { "patchline" : { diff --git a/lfogui.js b/lfogui.js index f7619d8..b33c6fb 100644 --- a/lfogui.js +++ b/lfogui.js @@ -60,7 +60,6 @@ function nnFreqToHzString(num){ function MasterLfoHandler(){ - let initVisArr = Array(MAXLFOS).fill(false); initVisArr[0] = true; @@ -81,9 +80,12 @@ function MasterLfoHandler(){ }; /// MODULATOR ARRAYS - - const [userDefinedWave, setUserDefinedWave] = React.useState(Array(50).fill(0)); - + let userDefinedWavesBase = []; + + for (let i=0; i<4; i++){ + userDefinedWavesBase.push(Array(50).fill(0)); + } + const [userDefinedWaves, setUserDefinedWaves] = React.useState(userDefinedWavesBase); const [modVisibleArr, setModVisibleArr] = React.useState(initVisArr); const [modTypeArr, setModTypeArr] = React.useState(Array(MAXLFOS).fill('LFO')); const [modInstanceNumArr, setModInstanceNumArr] = React.useState(Array(MAXLFOS).fill('1')); @@ -242,7 +244,7 @@ function MasterLfoHandler(){ function handleTick(event) { let time = (Date.now() - firstUpdateTime) / 1000; 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, userDefinedWaves, time, beatsInMeasure, ticks); } function handleTimeSig(event) { @@ -250,7 +252,8 @@ function MasterLfoHandler(){ } function handleChangeUserWave(event){ - setUserDefinedWave(event.detail); + userDefinedWaves[event.detail.index] = event.detail.points; + setUserDefinedWaves(userDefinedWaves); } function handleMaxTicks(event){ @@ -338,7 +341,7 @@ function MasterLfoHandler(){ window.removeEventListener('userWave', handleChangeUserWave); window.removeEventListener('maxTicks', handleMaxTicks); }; - }, [...allModArrays, ...allEnumArrays, ...allEnumMats, userDefinedWave, modCenterVals, render, beatsInMeasure, ticks]); + }, [...allModArrays, ...allEnumArrays, ...allEnumMats, userDefinedWaves, modCenterVals, render, beatsInMeasure, ticks]); function CheckLinked(inst, param, checkInstArr, checkParamArr){ @@ -573,8 +576,9 @@ if (!DEBUG){ window.dispatchEvent(new CustomEvent('maxTicks', {'detail' : val})); }); - window.max.bindInlet("userWave", (...points) => { - window.dispatchEvent(new CustomEvent('userWave', {'detail' : points})); + window.max.bindInlet("userWave", (index, ...points) => { + let data = {points, index}; + window.dispatchEvent(new CustomEvent('userWave', {'detail' : data})); }); setInterval(() => { @@ -584,4 +588,4 @@ if (!DEBUG){ const root = ReactDOM.createRoot(document.getElementById('lfo-container')); -root.render(e(MasterLfoHandler, null, null)); \ No newline at end of file +root.render(e(MasterLfoHandler, null, null)); diff --git a/modulators.js b/modulators.js index 48dd096..ebcb44a 100644 --- a/modulators.js +++ b/modulators.js @@ -4,7 +4,7 @@ var TYPEOPTIONS = ["LFO", "Noise"]; -var SHAPETYPES = ["Sine", "SawUp", "SawDown", "Tri", "Square", "Custom"]; +var SHAPETYPES = ["Sine", "SawUp", "SawDown", "Tri", "Square", "Custom_1", "Custom_2", "Custom_3", "Custom_4"]; var NOISETYPES = ["Rand", "Line Int.", "Sine Int."] var INSTANCEOPTIONS = ["1", "2", "3", "4"]; @@ -61,7 +61,11 @@ function LfoRow(props){ }; } -function indexWave(type, phase, userDefinedWave){ +function indexUserWave(phase, index, userDefinedWaves){ + return parseFloat(userDefinedWaves[index][Math.floor(phase * 50)]) / 127 +} + +function indexWave(type, phase, userDefinedWaves){ switch (type){ case "Sine": return (Math.sin(phase * Math.PI * 2) / 2) + 0.5; @@ -73,12 +77,18 @@ function indexWave(type, phase, userDefinedWave){ return phase > 0.5? (1-phase) * 2 : phase * 2; case "Square": return +(phase > 0.5); - case "Custom": - return parseFloat(userDefinedWave[Math.floor(phase * 50)]) / 127 + case "Custom_1": + return indexUserWave(phase, 1, userDefinedWaves); + case "Custom_2": + return indexUserWave(phase, 2, userDefinedWaves); + case "Custom_3": + return indexUserWave(phase, 3, userDefinedWaves); + case "Custom_4": + return indexUserWave(phase, 4, userDefinedWaves); } } -function operateModulators(visibleArr, typeArr, instanceNumArr, paramNames, centers, freqs, mins, maxs, waveTypes, phaseArr, noiseData, userDefinedWave, currTime, beatsInMeasure, ticks){ +function operateModulators(visibleArr, typeArr, instanceNumArr, paramNames, centers, freqs, mins, maxs, waveTypes, phaseArr, noiseData, userDefinedWaves, currTime, beatsInMeasure, ticks){ for (let i=0; i