From dc2daade1b7063ceb88246c361ed3489f51e374f Mon Sep 17 00:00:00 2001 From: Eveline-97 Date: Wed, 14 May 2025 14:42:34 +0200 Subject: [PATCH] add function functionality for custom shape --- .gitignore | 1 + example.maxpat | 2249 ++++++++++++++++++++++++++++++++++++++++++++++-- lfogui.js | 45 +- modulators.js | 25 +- 4 files changed, 2255 insertions(+), 65 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/example.maxpat b/example.maxpat index 27a4888..e979f4d 100644 --- a/example.maxpat +++ b/example.maxpat @@ -4,15 +4,15 @@ "appversion" : { "major" : 8, "minor" : 6, - "revision" : 4, + "revision" : 5, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 34.0, 100.0, 1117.0, 814.0 ], + "rect" : [ 34.0, 100.0, 1444.0, 787.0 ], "bglocked" : 0, - "openinpresentation" : 0, + "openinpresentation" : 1, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", @@ -39,6 +39,1704 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "id" : "obj-165", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 446.5, 1115.0, 91.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 192.0, 126.0, 91.0, 20.0 ], + "text" : "Custom wave 4" + } + + } +, { + "box" : { + "id" : "obj-166", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 355.5, 1115.0, 91.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 16.0, 126.0, 91.0, 20.0 ], + "text" : "Custom wave 3" + } + + } +, { + "box" : { + "id" : "obj-164", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 446.5, 1093.0, 91.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 192.0, 14.0, 91.0, 20.0 ], + "text" : "Custom wave 2" + } + + } +, { + "box" : { + "id" : "obj-163", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 355.5, 1093.0, 91.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 16.0, 14.0, 91.0, 20.0 ], + "text" : "Custom wave 1" + } + + } +, { + "box" : { + "id" : "obj-156", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 144.0, 1352.0, 57.0, 22.0 ], + "text" : "s to-jweb" + } + + } +, { + "box" : { + "id" : "obj-155", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 397.0, 121.0, 55.0, 22.0 ], + "text" : "r to-jweb" + } + + } +, { + "box" : { + "id" : "obj-154", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 82.0, 1638.0, 57.0, 22.0 ], + "text" : "s to-jweb" + } + + } +, { + "box" : { + "id" : "obj-149", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "zlclear" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 6, + "revision" : 5, + "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" : { + "id" : "obj-106", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "bang", "int", "zlclear" ], + "patching_rect" : [ 50.0, 100.0, 70.0, 22.0 ], + "text" : "t b 0 zlclear" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 50.0, 198.0, 30.0, 22.0 ], + "text" : "* 10" + } + + } +, { + "box" : { + "id" : "obj-99", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "patching_rect" : [ 50.0, 163.0, 72.0, 22.0 ], + "text" : "counter 101" + } + + } +, { + "box" : { + "id" : "obj-98", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "int" ], + "patching_rect" : [ 50.0, 133.0, 47.0, 22.0 ], + "text" : "uzi 101" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-118", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 50.0, 40.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-121", + "index" : 2, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 101.0, 223.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-122", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 241.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-122", 0 ], + "source" : [ "obj-105", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-121", 0 ], + "source" : [ "obj-106", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-98", 0 ], + "source" : [ "obj-106", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 2 ], + "source" : [ "obj-106", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-106", 0 ], + "source" : [ "obj-118", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 0 ], + "source" : [ "obj-98", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-105", 0 ], + "source" : [ "obj-99", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 724.0, 1411.0, 95.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p dumpFunction" + } + + } +, { + "box" : { + "id" : "obj-150", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 724.0, 1512.0, 49.0, 22.0 ], + "text" : "round 1" + } + + } +, { + "box" : { + "id" : "obj-151", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 724.0, 1589.0, 135.0, 22.0 ], + "text" : "prepend userFunction 4" + } + + } +, { + "box" : { + "id" : "obj-152", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 724.0, 1554.0, 75.0, 22.0 ], + "text" : "zl.group 101" + } + + } +, { + "box" : { + "addpoints" : [ 0.0, 62.666666666666664, 0, 101.694915254237287, 100.0, 0, 230.363894333230689, 0.0, 0, 549.512830503443411, 0.0, 0, 861.016949152542338, 100.0, 0, 1000.0, 0.0, 0 ], + "classic_curve" : 1, + "hidden" : 1, + "id" : "obj-153", + "maxclass" : "function", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "float", "", "", "bang" ], + "outputmode" : 1, + "parameter_enable" : 0, + "patching_rect" : [ 724.0, 1449.0, 159.5, 52.0 ], + "presentation" : 1, + "presentation_rect" : [ 193.0, 172.0, 159.5, 52.0 ], + "range" : [ 0.0, 100.0 ], + "varname" : "userFunction4" + } + + } +, { + "box" : { + "id" : "obj-144", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "zlclear" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 6, + "revision" : 5, + "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" : { + "id" : "obj-106", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "bang", "int", "zlclear" ], + "patching_rect" : [ 50.0, 100.0, 70.0, 22.0 ], + "text" : "t b 0 zlclear" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 50.0, 198.0, 30.0, 22.0 ], + "text" : "* 10" + } + + } +, { + "box" : { + "id" : "obj-99", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "patching_rect" : [ 50.0, 163.0, 72.0, 22.0 ], + "text" : "counter 101" + } + + } +, { + "box" : { + "id" : "obj-98", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "int" ], + "patching_rect" : [ 50.0, 133.0, 47.0, 22.0 ], + "text" : "uzi 101" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-118", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 50.0, 40.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-121", + "index" : 2, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 101.0, 223.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-122", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 241.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-122", 0 ], + "source" : [ "obj-105", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-121", 0 ], + "source" : [ "obj-106", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-98", 0 ], + "source" : [ "obj-106", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 2 ], + "source" : [ "obj-106", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-106", 0 ], + "source" : [ "obj-118", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 0 ], + "source" : [ "obj-98", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-105", 0 ], + "source" : [ "obj-99", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 510.0, 1411.0, 95.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p dumpFunction" + } + + } +, { + "box" : { + "id" : "obj-145", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 510.0, 1512.0, 49.0, 22.0 ], + "text" : "round 1" + } + + } +, { + "box" : { + "id" : "obj-146", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 510.0, 1589.0, 135.0, 22.0 ], + "text" : "prepend userFunction 3" + } + + } +, { + "box" : { + "id" : "obj-147", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 510.0, 1554.0, 75.0, 22.0 ], + "text" : "zl.group 101" + } + + } +, { + "box" : { + "addpoints" : [ 0.0, 0.0, 0, 390.95744680851061, 0.0, 0, 390.95744680851061, 82.666666666666671, 0, 613.342617737485966, 100.0, 0, 881.355932203389784, 51.851851851851855, 0 ], + "classic_curve" : 1, + "id" : "obj-148", + "maxclass" : "function", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "float", "", "", "bang" ], + "outputmode" : 1, + "parameter_enable" : 0, + "patching_rect" : [ 510.0, 1449.0, 159.5, 52.0 ], + "presentation" : 1, + "presentation_rect" : [ 17.0, 172.0, 159.5, 52.0 ], + "range" : [ 0.0, 100.0 ], + "varname" : "userFunction3" + } + + } +, { + "box" : { + "id" : "obj-139", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "zlclear" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 6, + "revision" : 5, + "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" : { + "id" : "obj-106", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "bang", "int", "zlclear" ], + "patching_rect" : [ 50.0, 100.0, 70.0, 22.0 ], + "text" : "t b 0 zlclear" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 50.0, 198.0, 30.0, 22.0 ], + "text" : "* 10" + } + + } +, { + "box" : { + "id" : "obj-99", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "patching_rect" : [ 50.0, 163.0, 72.0, 22.0 ], + "text" : "counter 101" + } + + } +, { + "box" : { + "id" : "obj-98", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "int" ], + "patching_rect" : [ 50.0, 133.0, 47.0, 22.0 ], + "text" : "uzi 101" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-118", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 50.0, 40.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-121", + "index" : 2, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 101.0, 223.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-122", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 241.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-122", 0 ], + "source" : [ "obj-105", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-121", 0 ], + "source" : [ "obj-106", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-98", 0 ], + "source" : [ "obj-106", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 2 ], + "source" : [ "obj-106", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-106", 0 ], + "source" : [ "obj-118", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 0 ], + "source" : [ "obj-98", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-105", 0 ], + "source" : [ "obj-99", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 296.0, 1411.0, 95.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p dumpFunction" + } + + } +, { + "box" : { + "id" : "obj-140", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 296.0, 1512.0, 49.0, 22.0 ], + "text" : "round 1" + } + + } +, { + "box" : { + "id" : "obj-141", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 296.0, 1589.0, 135.0, 22.0 ], + "text" : "prepend userFunction 2" + } + + } +, { + "box" : { + "id" : "obj-142", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 296.0, 1554.0, 75.0, 22.0 ], + "text" : "zl.group 101" + } + + } +, { + "box" : { + "addpoints" : [ 0.0, 62.666666666666664, 0, 230.363894333230689, 0.0, 0, 390.95744680851061, 82.666666666666671, 0, 549.512830503443411, 0.0, 0, 613.342617737485966, 100.0, 0, 859.042553191489333, 0.0, 0, 916.534107099188191, 100.0, 0, 1000.0, 62.666666666666664, 0 ], + "classic_curve" : 1, + "id" : "obj-143", + "maxclass" : "function", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "float", "", "", "bang" ], + "outputmode" : 1, + "parameter_enable" : 0, + "patching_rect" : [ 296.0, 1449.0, 159.5, 52.0 ], + "presentation" : 1, + "presentation_rect" : [ 193.0, 60.0, 159.5, 52.0 ], + "range" : [ 0.0, 100.0 ], + "varname" : "userFunction2" + } + + } +, { + "box" : { + "id" : "obj-126", + "maxclass" : "button", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 58.0, 1377.0, 24.0, 24.0 ] + } + + } +, { + "box" : { + "id" : "obj-124", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "zlclear" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 6, + "revision" : 5, + "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" : { + "id" : "obj-106", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "bang", "int", "zlclear" ], + "patching_rect" : [ 50.0, 100.0, 70.0, 22.0 ], + "text" : "t b 0 zlclear" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 50.0, 198.0, 30.0, 22.0 ], + "text" : "* 10" + } + + } +, { + "box" : { + "id" : "obj-99", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "patching_rect" : [ 50.0, 163.0, 72.0, 22.0 ], + "text" : "counter 101" + } + + } +, { + "box" : { + "id" : "obj-98", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "int" ], + "patching_rect" : [ 50.0, 133.0, 47.0, 22.0 ], + "text" : "uzi 101" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-118", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 50.0, 40.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-121", + "index" : 2, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 101.0, 223.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-122", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 241.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-122", 0 ], + "source" : [ "obj-105", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-121", 0 ], + "source" : [ "obj-106", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-98", 0 ], + "source" : [ "obj-106", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 2 ], + "source" : [ "obj-106", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-106", 0 ], + "source" : [ "obj-118", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 0 ], + "source" : [ "obj-98", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-105", 0 ], + "source" : [ "obj-99", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 82.0, 1411.0, 95.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p dumpFunction" + } + + } +, { + "box" : { + "id" : "obj-114", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 320.0, 1309.0, 119.0, 22.0 ], + "text" : "prepend userWave 4" + } + + } +, { + "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-115", + "maxclass" : "multislider", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 320.0, 1252.0, 162.0, 52.0 ], + "peakcolor" : [ 0.498039, 0.498039, 0.498039, 1.0 ], + "presentation" : 1, + "presentation_rect" : [ 192.0, 172.0, 162.0, 52.0 ], + "setminmax" : [ 0.0, 127.0 ], + "settype" : 0, + "size" : 50, + "varname" : "userWave4" + } + + } +, { + "box" : { + "id" : "obj-116", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 320.0, 1215.0, 119.0, 22.0 ], + "text" : "prepend userWave 3" + } + + } +, { + "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, + "hidden" : 1, + "id" : "obj-117", + "maxclass" : "multislider", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 320.0, 1155.0, 162.0, 52.0 ], + "peakcolor" : [ 0.498039, 0.498039, 0.498039, 1.0 ], + "presentation" : 1, + "presentation_rect" : [ 16.0, 172.0, 162.0, 52.0 ], + "setminmax" : [ 0.0, 127.0 ], + "settype" : 0, + "size" : 50, + "varname" : "userWave3" + } + + } +, { + "box" : { + "id" : "obj-113", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 735.0, 1276.0, 45.0, 22.0 ], + "text" : "zl.rot 1" + } + + } +, { + "box" : { + "id" : "obj-107", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 787.0, 1277.0, 133.0, 20.0 ], + "text" : "send chosen type to JS" + } + + } +, { + "box" : { + "id" : "obj-104", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 517.0, 1303.0, 192.0, 20.0 ], + "text" : "hide/show wave or function in Max" + } + + } +, { + "box" : { + "id" : "obj-101", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 735.0, 1302.0, 147.0, 22.0 ], + "text" : "prepend userDefinedType" + } + + } +, { + "box" : { + "id" : "obj-93", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 844.0, 1191.0, 50.0, 22.0 ], + "text" : "pack i 4" + } + + } +, { + "box" : { + "id" : "obj-96", + "items" : [ "free", "draw", "wave", ",", "function", "wave" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 844.0, 1155.0, 106.0, 22.0 ], + "presentation" : 1, + "presentation_rect" : [ 192.0, 148.0, 106.0, 22.0 ] + } + + } +, { + "box" : { + "id" : "obj-90", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 735.0, 1191.0, 50.0, 22.0 ], + "text" : "pack i 3" + } + + } +, { + "box" : { + "id" : "obj-91", + "items" : [ "free", "draw", "wave", ",", "function", "wave" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 735.0, 1155.0, 106.0, 22.0 ], + "presentation" : 1, + "presentation_rect" : [ 16.0, 148.0, 106.0, 22.0 ] + } + + } +, { + "box" : { + "id" : "obj-85", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 626.0, 1191.0, 50.0, 22.0 ], + "text" : "pack i 2" + } + + } +, { + "box" : { + "id" : "obj-88", + "items" : [ "free", "draw", "wave", ",", "function", "wave" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 626.0, 1155.0, 106.0, 22.0 ], + "presentation" : 1, + "presentation_rect" : [ 192.0, 36.0, 106.0, 22.0 ] + } + + } +, { + "box" : { + "id" : "obj-83", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 517.0, 1191.0, 50.0, 22.0 ], + "text" : "pack i 1" + } + + } +, { + "box" : { + "id" : "obj-82", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 6, + "revision" : 5, + "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" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "int" ], + "patching_rect" : [ 50.0, 65.0, 59.0, 22.0 ], + "text" : "unpack i i" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 235.0, 217.0, 49.0, 22.0 ], + "text" : "pack s i" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 228.0, 49.0, 22.0 ], + "text" : "pack s i" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 235.0, 283.0, 167.0, 22.0 ], + "text" : "sprintf script %s userWave%d" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 283.0, 183.0, 22.0 ], + "text" : "sprintf script %s userFunction%d" + } + + } +, { + "box" : { + "id" : "obj-50", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 268.0, 154.0, 37.0, 22.0 ], + "text" : "show" + } + + } +, { + "box" : { + "id" : "obj-57", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 235.0, 154.0, 31.0, 22.0 ], + "text" : "hide" + } + + } +, { + "box" : { + "id" : "obj-44", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 83.0, 154.0, 37.0, 22.0 ], + "text" : "show" + } + + } +, { + "box" : { + "id" : "obj-42", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 154.0, 31.0, 22.0 ], + "text" : "hide" + } + + } +, { + "box" : { + "id" : "obj-31", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 50.0, 100.0, 44.0, 22.0 ], + "text" : "sel 0 1" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-79", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 23.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-81", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 331.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 1 ], + "order" : 1, + "source" : [ "obj-12", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 1 ], + "order" : 0, + "source" : [ "obj-12", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-81", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-81", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 0 ], + "order" : 1, + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-44", 0 ], + "order" : 1, + "source" : [ "obj-31", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "order" : 0, + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-57", 0 ], + "order" : 0, + "source" : [ "obj-31", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "source" : [ "obj-44", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-57", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-79", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 517.0, 1237.0, 129.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p toggle-wave-function" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 517.0, 1267.0, 67.0, 22.0 ], + "save" : [ "#N", "thispatcher", ";", "#Q", "end", ";" ], + "text" : "thispatcher" + } + + } +, { + "box" : { + "id" : "obj-3", + "items" : [ "free", "draw", "wave", ",", "function", "wave" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 517.0, 1155.0, 106.0, 22.0 ], + "presentation" : 1, + "presentation_rect" : [ 16.0, 36.0, 106.0, 22.0 ] + } + + } +, { + "box" : { + "id" : "obj-123", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 82.0, 1512.0, 49.0, 22.0 ], + "text" : "round 1" + } + + } +, { + "box" : { + "id" : "obj-120", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 82.0, 1589.0, 135.0, 22.0 ], + "text" : "prepend userFunction 1" + } + + } +, { + "box" : { + "id" : "obj-119", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 82.0, 1554.0, 75.0, 22.0 ], + "text" : "zl.group 101" + } + + } +, { + "box" : { + "id" : "obj-92", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 189.0, 1425.0, 93.0, 20.0 ], + "text" : "outputmode list!" + } + + } +, { + "box" : { + "id" : "obj-55", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 411.0, 935.0, 251.0, 47.0 ], + "text" : "on opening on new computer, nothing is loaded. start with template dictionary with basic buttons etc available" + } + + } +, { + "box" : { + "addpoints" : [ 0.0, 62.666666666666664, 0, 230.363894333230689, 0.0, 0, 390.95744680851061, 82.666666666666671, 0, 549.512830503443411, 0.0, 0, 613.342617737485966, 100.0, 0, 859.042553191489333, 0.0, 0, 916.534107099188191, 100.0, 0, 1000.0, 62.666666666666664, 0 ], + "classic_curve" : 1, + "hidden" : 1, + "id" : "obj-7", + "maxclass" : "function", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "float", "", "", "bang" ], + "outputmode" : 1, + "parameter_enable" : 0, + "patching_rect" : [ 82.0, 1449.0, 159.5, 52.0 ], + "presentation" : 1, + "presentation_rect" : [ 17.0, 60.0, 159.5, 52.0 ], + "range" : [ 0.0, 100.0 ], + "varname" : "userFunction1" + } + + } +, { "box" : { "id" : "obj-62", "linecount" : 2, @@ -46,7 +1744,6 @@ "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 1160.0, 140.0, 95.0, 33.0 ], - "presentation_linecount" : 2, "text" : "Lock/unlock for NN usage" } @@ -69,7 +1766,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 391.0, 817.0, 150.0, 20.0 ], + "patching_rect" : [ 411.0, 834.0, 251.0, 20.0 ], "text" : "TODO:" } @@ -82,7 +1779,9 @@ "numoutlets" : 5, "outlettype" : [ "preset", "int", "preset", "int", "" ], "patching_rect" : [ 1044.5, 12.0, 100.0, 40.0 ], - "pattrstorage" : "myStorage" + "pattrstorage" : "myStorage", + "presentation" : 1, + "presentation_rect" : [ 469.0, 178.0, 100.0, 40.0 ] } } @@ -113,7 +1812,7 @@ "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "", "", "" ], - "patching_rect" : [ 893.0, 883.0, 61.0, 22.0 ], + "patching_rect" : [ 819.0, 748.0, 61.0, 22.0 ], "restore" : [ { "data" : { "enumArrays" : [ [ 0, 0, 1, 1, 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", "NONE", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation", "attenuation" ] ], @@ -136,11 +1835,11 @@ , { "box" : { "id" : "obj-5", - "linecount" : 3, + "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 390.0, 899.0, 150.0, 47.0 ], + "patching_rect" : [ 411.0, 900.0, 252.0, 33.0 ], "text" : "make automatic saving, make automatic load on changing snapshot" } @@ -152,7 +1851,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 263.551399827003479, 582.5, 150.0, 33.0 ], + "patching_rect" : [ 189.0, 1101.0, 150.0, 33.0 ], "text" : "user definted LFO shape, up to 4 of them" } @@ -164,7 +1863,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 108.411214113235474, 710.266354560852051, 119.0, 22.0 ], + "patching_rect" : [ 144.0, 1309.0, 119.0, 22.0 ], "text" : "prepend userWave 2" } @@ -179,28 +1878,31 @@ "candicane7" : [ 0.878431, 0.243137, 0.145098, 1.0 ], "candicane8" : [ 0.027451, 0.447059, 0.501961, 1.0 ], "contdata" : 1, + "hidden" : 1, "id" : "obj-61", "maxclass" : "multislider", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "" ], "parameter_enable" : 0, - "patching_rect" : [ 118.691587865352631, 635.5, 162.0, 52.0 ], + "patching_rect" : [ 144.0, 1252.0, 162.0, 52.0 ], "peakcolor" : [ 0.498039, 0.498039, 0.498039, 1.0 ], + "presentation" : 1, + "presentation_rect" : [ 192.0, 60.0, 162.0, 52.0 ], "setminmax" : [ 0.0, 127.0 ], "settype" : 0, - "size" : 50 + "size" : 50, + "varname" : "userWave2" } } , { "box" : { "id" : "obj-29", - "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 391.0, 861.0, 150.0, 33.0 ], + "patching_rect" : [ 411.0, 878.0, 251.0, 20.0 ], "text" : "add function object support" } @@ -211,7 +1913,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 391.0, 843.0, 150.0, 20.0 ], + "patching_rect" : [ 411.0, 860.0, 251.0, 20.0 ], "text" : "add random walk" } @@ -222,7 +1924,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 313.0, 43.0, 124.0, 22.0 ], + "patching_rect" : [ 493.0, 59.0, 124.0, 22.0 ], "text" : "s djster-param-values" } @@ -251,7 +1953,7 @@ "appversion" : { "major" : 8, "minor" : 6, - "revision" : 4, + "revision" : 5, "architecture" : "x64", "modernui" : 1 } @@ -406,7 +2108,7 @@ ] } , - "patching_rect" : [ 558.0, 27.5, 66.0, 22.0 ], + "patching_rect" : [ 619.0, 59.0, 66.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -426,7 +2128,7 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "parameter_enable" : 0, - "patching_rect" : [ 98.0, 472.0, 24.0, 24.0 ] + "patching_rect" : [ 144.0, 1110.0, 24.0, 24.0 ] } } @@ -437,7 +2139,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 289.0, 125.0, 56.0, 22.0 ], + "patching_rect" : [ 457.5, 121.0, 56.0, 22.0 ], "text" : "dumpNN" } @@ -449,7 +2151,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 44.0, 528.5, 49.0, 22.0 ], + "patching_rect" : [ 82.0, 1111.0, 49.0, 22.0 ], "text" : "r reload" } @@ -461,7 +2163,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 131.5, 588.0, 119.0, 22.0 ], + "patching_rect" : [ 144.0, 1215.0, 119.0, 22.0 ], "text" : "prepend userWave 1" } @@ -482,11 +2184,14 @@ "numoutlets" : 2, "outlettype" : [ "", "" ], "parameter_enable" : 0, - "patching_rect" : [ 142.0, 513.5, 162.0, 52.0 ], + "patching_rect" : [ 144.0, 1155.0, 162.0, 52.0 ], "peakcolor" : [ 0.498039, 0.498039, 0.498039, 1.0 ], + "presentation" : 1, + "presentation_rect" : [ 16.0, 60.0, 162.0, 52.0 ], "setminmax" : [ 0.0, 127.0 ], "settype" : 0, - "size" : 50 + "size" : 50, + "varname" : "userWave1" } } @@ -497,7 +2202,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 27.0, 377.0, 115.0, 22.0 ], + "patching_rect" : [ 22.0, 298.0, 115.0, 22.0 ], "text" : "param 4 meter \"3 4\"" } @@ -510,7 +2215,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 546.0, 735.0, 89.0, 35.0 ], + "patching_rect" : [ 654.333333333333371, 692.0, 89.0, 35.0 ], "text" : "harmoniclarity 0.503142" } @@ -523,7 +2228,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 451.0, 735.0, 85.0, 35.0 ], + "patching_rect" : [ 573.666666666666629, 692.0, 85.0, 35.0 ], "text" : "event_length param" } @@ -536,7 +2241,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 345.0, 737.0, 84.0, 35.0 ], + "patching_rect" : [ 490.0, 692.0, 84.0, 35.0 ], "text" : "metriclarity 41.750827" } @@ -548,7 +2253,7 @@ "numinlets" : 4, "numoutlets" : 4, "outlettype" : [ "", "", "", "" ], - "patching_rect" : [ 370.0, 693.0, 273.0, 22.0 ], + "patching_rect" : [ 555.0, 659.0, 273.0, 22.0 ], "text" : "routepass metriclarity event_length harmoniclarity" } @@ -598,7 +2303,7 @@ "numinlets" : 5, "numoutlets" : 5, "outlettype" : [ "", "", "", "", "" ], - "patching_rect" : [ 558.0, 661.0, 81.0, 23.0 ], + "patching_rect" : [ 555.0, 625.0, 81.0, 23.0 ], "text" : "route 1 2 3 4" } @@ -610,7 +2315,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "bang" ], - "patching_rect" : [ 313.0, 15.0, 55.0, 22.0 ], + "patching_rect" : [ 493.0, 31.0, 55.0, 22.0 ], "text" : "del 1000" } @@ -633,7 +2338,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 1064.75, 54.0, 51.0, 22.0 ], + "patching_rect" : [ 1065.0, 59.0, 51.0, 22.0 ], "text" : "s reload" } @@ -654,7 +2359,7 @@ "numinlets" : 2, "numoutlets" : 5, "outlettype" : [ "dictionary", "", "", "", "" ], - "patching_rect" : [ 914.0, 911.5, 166.0, 22.0 ], + "patching_rect" : [ 840.0, 777.0, 166.0, 22.0 ], "saved_attribute_attributes" : { "valueof" : { "parameter_invisible" : 1, @@ -685,7 +2390,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], - "patching_rect" : [ 989.0, 831.0, 22.0, 22.0 ], + "patching_rect" : [ 840.0, 659.0, 22.0, 22.0 ], "text" : "t b" } @@ -696,7 +2401,7 @@ "maxclass" : "dict.view", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 1107.0, 573.0, 263.0, 384.0 ] + "patching_rect" : [ 1015.0, 571.0, 263.0, 384.0 ] } } @@ -708,7 +2413,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 137.0, 377.0, 246.0, 64.0 ], + "patching_rect" : [ 29.0, 353.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" } @@ -720,7 +2425,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 35.0, 287.0, 115.0, 22.0 ], + "patching_rect" : [ 34.0, 257.0, 115.0, 22.0 ], "text" : "param 4 meter \"4 4\"" } @@ -732,7 +2437,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 924.0, 748.0, 156.0, 22.0 ], + "patching_rect" : [ 598.0, 736.0, 156.0, 22.0 ], "text" : "meter 3 4" } @@ -744,7 +2449,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 799.0, 748.0, 101.0, 22.0 ], + "patching_rect" : [ 504.0, 772.0, 101.0, 22.0 ], "text" : "attenuation 200" } @@ -756,7 +2461,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 640.0, 748.0, 157.0, 22.0 ], + "patching_rect" : [ 432.5, 736.0, 157.0, 22.0 ], "text" : "attenuation 0.783634" } @@ -768,7 +2473,7 @@ "numinlets" : 4, "numoutlets" : 4, "outlettype" : [ "", "", "", "" ], - "patching_rect" : [ 432.0, 581.5, 177.0, 22.0 ], + "patching_rect" : [ 397.0, 589.0, 177.0, 22.0 ], "text" : "routepass saved NNdata debug" } @@ -792,7 +2497,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 423.5, 552.0, 71.0, 22.0 ], + "patching_rect" : [ 397.0, 557.5, 71.0, 22.0 ], "text" : "fromsymbol" } @@ -842,7 +2547,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 59.813083648681641, 797.0, 254.0, 154.0 ], + "patching_rect" : [ 689.315790414810181, 942.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" } @@ -866,7 +2571,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 27.0, 238.0, 139.0, 22.0 ], + "patching_rect" : [ 22.0, 226.0, 139.0, 22.0 ], "text" : "param 3 attenuation 200" } @@ -890,7 +2595,7 @@ "numinlets" : 2, "numoutlets" : 5, "outlettype" : [ "dictionary", "", "", "", "" ], - "patching_rect" : [ 989.0, 855.0, 97.0, 22.0 ], + "patching_rect" : [ 840.0, 683.0, 97.0, 22.0 ], "saved_object_attributes" : { "embed" : 0, "legacy" : 1, @@ -921,7 +2626,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 741.315790414810181, 877.0, 150.0, 114.0 ], + "patching_rect" : [ 836.0, 819.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" } @@ -933,7 +2638,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], - "patching_rect" : [ 217.0, 6.0, 58.0, 22.0 ], + "patching_rect" : [ 397.0, 22.0, 58.0, 22.0 ], "text" : "loadbang" } @@ -945,7 +2650,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 217.0, 69.0, 106.0, 22.0 ], + "patching_rect" : [ 397.0, 85.0, 106.0, 22.0 ], "text" : "readfile lfogui.html" } @@ -958,6 +2663,8 @@ "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 397.0, 180.0, 838.631580829620361, 368.0 ], + "presentation" : 1, + "presentation_rect" : [ 16.0, 247.0, 838.631580829620361, 368.0 ], "rendermode" : 0, "url" : "file://lfogui.html" } @@ -970,6 +2677,91 @@ "source" : [ "obj-10", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-156", 0 ], + "source" : [ "obj-101", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-101", 0 ], + "source" : [ "obj-113", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-156", 0 ], + "source" : [ "obj-114", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-114", 0 ], + "source" : [ "obj-115", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-156", 0 ], + "source" : [ "obj-116", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-116", 0 ], + "source" : [ "obj-117", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-120", 0 ], + "source" : [ "obj-119", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-154", 0 ], + "source" : [ "obj-120", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-119", 0 ], + "source" : [ "obj-123", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-119", 0 ], + "midpoints" : [ 167.5, 1434.0, 69.0, 1434.0, 69.0, 1541.0, 91.5, 1541.0 ], + "source" : [ "obj-124", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-124", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-126", 0 ] + } + } , { "patchline" : { @@ -977,6 +2769,121 @@ "source" : [ "obj-13", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-142", 0 ], + "midpoints" : [ 381.5, 1434.0, 283.0, 1434.0, 283.0, 1541.0, 305.5, 1541.0 ], + "source" : [ "obj-139", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-143", 0 ], + "source" : [ "obj-139", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-142", 0 ], + "source" : [ "obj-140", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-154", 0 ], + "source" : [ "obj-141", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-141", 0 ], + "source" : [ "obj-142", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-139", 0 ], + "source" : [ "obj-143", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-140", 0 ], + "source" : [ "obj-143", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-147", 0 ], + "midpoints" : [ 595.5, 1434.0, 497.0, 1434.0, 497.0, 1541.0, 519.5, 1541.0 ], + "source" : [ "obj-144", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-148", 0 ], + "source" : [ "obj-144", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-147", 0 ], + "source" : [ "obj-145", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-154", 0 ], + "source" : [ "obj-146", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-146", 0 ], + "source" : [ "obj-147", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-144", 0 ], + "source" : [ "obj-148", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-145", 0 ], + "source" : [ "obj-148", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-152", 0 ], + "midpoints" : [ 809.5, 1434.0, 711.0, 1434.0, 711.0, 1541.0, 733.5, 1541.0 ], + "source" : [ "obj-149", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-153", 0 ], + "source" : [ "obj-149", 0 ] + } + } , { "patchline" : { @@ -984,6 +2891,48 @@ "source" : [ "obj-15", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-152", 0 ], + "source" : [ "obj-150", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-154", 0 ], + "source" : [ "obj-151", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-151", 0 ], + "source" : [ "obj-152", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-149", 0 ], + "source" : [ "obj-153", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-150", 0 ], + "source" : [ "obj-153", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-155", 0 ] + } + } , { "patchline" : { @@ -1049,6 +2998,13 @@ "source" : [ "obj-27", 3 ] } + } +, { + "patchline" : { + "destination" : [ "obj-83", 0 ], + "source" : [ "obj-3", 0 ] + } + } , { "patchline" : { @@ -1127,7 +3083,7 @@ } , { "patchline" : { - "destination" : [ "obj-2", 0 ], + "destination" : [ "obj-156", 0 ], "source" : [ "obj-48", 0 ] } @@ -1170,11 +3126,70 @@ "source" : [ "obj-53", 1 ] } + } +, { + "patchline" : { + "destination" : [ "obj-115", 0 ], + "order" : 6, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-117", 0 ], + "order" : 7, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "order" : 11, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-139", 0 ], + "midpoints" : [ 91.5, 1362.0, 129.0, 1362.0, 129.0, 1398.0, 305.5, 1398.0 ], + "order" : 8, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-144", 0 ], + "midpoints" : [ 91.5, 1362.0, 129.0, 1362.0, 129.0, 1398.0, 519.5, 1398.0 ], + "order" : 5, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-149", 0 ], + "midpoints" : [ 91.5, 1362.0, 129.0, 1362.0, 129.0, 1398.0, 733.5, 1398.0 ], + "order" : 2, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "order" : 4, + "source" : [ "obj-54", 0 ] + } + } , { "patchline" : { "destination" : [ "obj-33", 0 ], - "order" : 0, + "order" : 10, "source" : [ "obj-54", 0 ] } @@ -1182,6 +3197,22 @@ , { "patchline" : { "destination" : [ "obj-61", 0 ], + "order" : 9, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-88", 0 ], + "order" : 3, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-91", 0 ], "order" : 1, "source" : [ "obj-54", 0 ] } @@ -1189,7 +3220,15 @@ } , { "patchline" : { - "destination" : [ "obj-2", 0 ], + "destination" : [ "obj-96", 0 ], + "order" : 0, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-156", 0 ], "source" : [ "obj-60", 0 ] } @@ -1228,6 +3267,20 @@ "source" : [ "obj-63", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-123", 0 ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-7", 3 ] + } + } , { "patchline" : { @@ -1256,6 +3309,45 @@ "source" : [ "obj-8", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-82", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-113", 0 ], + "order" : 0, + "source" : [ "obj-83", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-82", 0 ], + "order" : 1, + "source" : [ "obj-83", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-113", 0 ], + "order" : 0, + "source" : [ "obj-85", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-82", 0 ], + "order" : 1, + "source" : [ "obj-85", 0 ] + } + } , { "patchline" : { @@ -1263,6 +3355,59 @@ "source" : [ "obj-86", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-85", 0 ], + "source" : [ "obj-88", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-113", 0 ], + "order" : 0, + "source" : [ "obj-90", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-82", 0 ], + "order" : 1, + "source" : [ "obj-90", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-90", 0 ], + "source" : [ "obj-91", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-113", 0 ], + "order" : 0, + "source" : [ "obj-93", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-82", 0 ], + "order" : 1, + "source" : [ "obj-93", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-93", 0 ], + "source" : [ "obj-96", 0 ] + } + } ], "parameters" : { diff --git a/lfogui.js b/lfogui.js index b33c6fb..87172c9 100644 --- a/lfogui.js +++ b/lfogui.js @@ -12,6 +12,7 @@ let lfos = []; const MAXLFOS = 20; const MAXENUMS = 20; const MAXENUMPOINTS = 10; +const MAXUSERDEFINED = 4; @@ -81,11 +82,18 @@ function MasterLfoHandler(){ /// MODULATOR ARRAYS let userDefinedWavesBase = []; + let userDefinedFunctionsBase = []; + let userDefinedTypesBase = [0, 0, 0, 0]; //0 = wave, 1 = function - for (let i=0; i<4; i++){ + for (let i=0; i { @@ -339,9 +363,12 @@ function MasterLfoHandler(){ window.removeEventListener('enum', handleEnum); window.removeEventListener('timesig', handleTimeSig); window.removeEventListener('userWave', handleChangeUserWave); + //add + window.removeEventListener('userFunction', handleChangeUserFunction); + window.removeEventListener('userDefinedType', handleChangeUserDefinedType); window.removeEventListener('maxTicks', handleMaxTicks); }; - }, [...allModArrays, ...allEnumArrays, ...allEnumMats, userDefinedWaves, modCenterVals, render, beatsInMeasure, ticks]); + }, [...allModArrays, ...allEnumArrays, ...allEnumMats, userDefinedWaves, userDefinedFunctions, userDefinedTypes, modCenterVals, render, beatsInMeasure, ticks]); function CheckLinked(inst, param, checkInstArr, checkParamArr){ @@ -564,7 +591,6 @@ if (!DEBUG){ }); window.max.bindInlet("param", (inst, paramName, val) => { - window.dispatchEvent(new CustomEvent('param', {'detail' : [inst, paramName, val]})); }); @@ -580,6 +606,17 @@ if (!DEBUG){ let data = {points, index}; window.dispatchEvent(new CustomEvent('userWave', {'detail' : data})); }); + //add + window.max.bindInlet("userFunction", (index, ...points) => { + //list of 101 points between 0-100 + let data = {points, index}; + window.dispatchEvent(new CustomEvent('userFunction', {'detail': data})); + }); + + window.max.bindInlet("userDefinedType", (index, type) => { + let data = {index, type}; + window.dispatchEvent(new CustomEvent('userDefinedType', {'detail': data})); + }) setInterval(() => { window.dispatchEvent(new CustomEvent('tick')); diff --git a/modulators.js b/modulators.js index ebcb44a..bf53a6f 100644 --- a/modulators.js +++ b/modulators.js @@ -57,12 +57,17 @@ function LfoRow(props){ ListItem(e("div", {className:"linked"}, linkedText)), ); if (props.visible){ - return content + return content; }; } function indexUserWave(phase, index, userDefinedWaves){ - return parseFloat(userDefinedWaves[index][Math.floor(phase * 50)]) / 127 + return parseFloat(userDefinedWaves[index][Math.floor(phase * 50)]) / 127; +} + +//add +function indexUserFunction(phase, index, userDefinedFunctions){ + return parseFloat(userDefinedFunctions[index][Math.floor(phase * 110)]) / 127; } function indexWave(type, phase, userDefinedWaves){ @@ -77,18 +82,19 @@ function indexWave(type, phase, userDefinedWaves){ return phase > 0.5? (1-phase) * 2 : phase * 2; case "Square": return +(phase > 0.5); + //TODO in Max, user chooses whether to use freedraw (wave, 0) or function (1) case "Custom_1": - return indexUserWave(phase, 1, userDefinedWaves); + return indexUserDefinedTypes[0] == 0 ? indexUserWave(phase, 1, userDefinedWaves) : indexUserFunction(phase, 1, userDefinedFunctions); case "Custom_2": - return indexUserWave(phase, 2, userDefinedWaves); + return indexUserDefinedTypes[1] == 0 ? indexUserWave(phase, 2, userDefinedWaves) : indexUserFunction(phase, 2, userDefinedFunctions); case "Custom_3": - return indexUserWave(phase, 3, userDefinedWaves); + return indexUserDefinedTypes[2] == 0 ? indexUserWave(phase, 3, userDefinedWaves) : indexUserFunction(phase, 3, userDefinedFunctions); case "Custom_4": - return indexUserWave(phase, 4, userDefinedWaves); + return indexUserDefinedTypes[3] == 0 ? indexUserWave(phase, 4, userDefinedWaves) : indexUserFunction(phase, 4, userDefinedFunctions); } } -function operateModulators(visibleArr, typeArr, instanceNumArr, paramNames, centers, freqs, mins, maxs, waveTypes, phaseArr, noiseData, userDefinedWaves, currTime, beatsInMeasure, ticks){ +function operateModulators(visibleArr, typeArr, instanceNumArr, paramNames, centers, freqs, mins, maxs, waveTypes, phaseArr, noiseData, userDefinedWaves, userDefinedFunctions, userDefinedTypes, currTime, beatsInMeasure, ticks){ for (let i=0; i