setting viewMode directly from Max

This commit is contained in:
Kieran 2025-07-21 16:14:12 +02:00
parent fe68764e7d
commit 51767ff058
2 changed files with 52 additions and 266 deletions

View File

@ -2,42 +2,19 @@
"patcher" : { "patcher" : {
"fileversion" : 1, "fileversion" : 1,
"appversion" : { "appversion" : {
"major" : 8, "major" : 9,
"minor" : 6, "minor" : 0,
"revision" : 5, "revision" : 5,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
} }
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 47.0, 165.0, 884.0, 704.0 ], "rect" : [ 53.0, 190.0, 1417.0, 704.0 ],
"bglocked" : 1, "bglocked" : 1,
"openinpresentation" : 1, "openinpresentation" : 1,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 1,
"gridsize" : [ 15.0, 15.0 ], "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" : 15, "toolbars_unpinned_last_save" : 15,
"tallnewobj" : 0,
"boxanimatetime" : 200,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ { "boxes" : [ {
"box" : { "box" : {
"id" : "obj-5", "id" : "obj-5",
@ -76,11 +53,11 @@
"box" : { "box" : {
"id" : "obj-46", "id" : "obj-46",
"maxclass" : "newobj", "maxclass" : "newobj",
"numinlets" : 3, "numinlets" : 4,
"numoutlets" : 3, "numoutlets" : 4,
"outlettype" : [ "", "", "" ], "outlettype" : [ "", "", "", "" ],
"patching_rect" : [ 207.5, 93.827167987823486, 135.0, 22.0 ], "patching_rect" : [ 207.5, 93.827167987823486, 193.0, 22.0 ],
"text" : "routepass param reload" "text" : "routepass param reload viewMode"
} }
} }
@ -432,8 +409,8 @@
"patcher" : { "patcher" : {
"fileversion" : 1, "fileversion" : 1,
"appversion" : { "appversion" : {
"major" : 8, "major" : 9,
"minor" : 6, "minor" : 0,
"revision" : 5, "revision" : 5,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
@ -441,33 +418,7 @@
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 59.0, 119.0, 640.0, 480.0 ], "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 ], "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" : [ { "boxes" : [ {
"box" : { "box" : {
"id" : "obj-106", "id" : "obj-106",
@ -603,17 +554,11 @@
} }
} }
] ],
"originid" : "pat-180"
} }
, ,
"patching_rect" : [ 724.0, 1441.0, 95.0, 22.0 ], "patching_rect" : [ 724.0, 1441.0, 95.0, 22.0 ],
"saved_object_attributes" : {
"description" : "",
"digest" : "",
"globalpatchername" : "",
"tags" : ""
}
,
"text" : "p dumpFunction" "text" : "p dumpFunction"
} }
@ -686,8 +631,8 @@
"patcher" : { "patcher" : {
"fileversion" : 1, "fileversion" : 1,
"appversion" : { "appversion" : {
"major" : 8, "major" : 9,
"minor" : 6, "minor" : 0,
"revision" : 5, "revision" : 5,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
@ -695,33 +640,7 @@
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 59.0, 119.0, 640.0, 480.0 ], "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 ], "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" : [ { "boxes" : [ {
"box" : { "box" : {
"id" : "obj-106", "id" : "obj-106",
@ -857,17 +776,11 @@
} }
} }
] ],
"originid" : "pat-182"
} }
, ,
"patching_rect" : [ 510.0, 1441.0, 95.0, 22.0 ], "patching_rect" : [ 510.0, 1441.0, 95.0, 22.0 ],
"saved_object_attributes" : {
"description" : "",
"digest" : "",
"globalpatchername" : "",
"tags" : ""
}
,
"text" : "p dumpFunction" "text" : "p dumpFunction"
} }
@ -939,8 +852,8 @@
"patcher" : { "patcher" : {
"fileversion" : 1, "fileversion" : 1,
"appversion" : { "appversion" : {
"major" : 8, "major" : 9,
"minor" : 6, "minor" : 0,
"revision" : 5, "revision" : 5,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
@ -948,33 +861,7 @@
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 59.0, 119.0, 640.0, 480.0 ], "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 ], "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" : [ { "boxes" : [ {
"box" : { "box" : {
"id" : "obj-106", "id" : "obj-106",
@ -1110,17 +997,11 @@
} }
} }
] ],
"originid" : "pat-184"
} }
, ,
"patching_rect" : [ 296.0, 1441.0, 95.0, 22.0 ], "patching_rect" : [ 296.0, 1441.0, 95.0, 22.0 ],
"saved_object_attributes" : {
"description" : "",
"digest" : "",
"globalpatchername" : "",
"tags" : ""
}
,
"text" : "p dumpFunction" "text" : "p dumpFunction"
} }
@ -1205,8 +1086,8 @@
"patcher" : { "patcher" : {
"fileversion" : 1, "fileversion" : 1,
"appversion" : { "appversion" : {
"major" : 8, "major" : 9,
"minor" : 6, "minor" : 0,
"revision" : 5, "revision" : 5,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
@ -1214,33 +1095,7 @@
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 59.0, 119.0, 640.0, 480.0 ], "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 ], "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" : [ { "boxes" : [ {
"box" : { "box" : {
"id" : "obj-106", "id" : "obj-106",
@ -1376,17 +1231,11 @@
} }
} }
] ],
"originid" : "pat-186"
} }
, ,
"patching_rect" : [ 82.0, 1441.0, 95.0, 22.0 ], "patching_rect" : [ 82.0, 1441.0, 95.0, 22.0 ],
"saved_object_attributes" : {
"description" : "",
"digest" : "",
"globalpatchername" : "",
"tags" : ""
}
,
"text" : "p dumpFunction" "text" : "p dumpFunction"
} }
@ -1656,8 +1505,8 @@
"patcher" : { "patcher" : {
"fileversion" : 1, "fileversion" : 1,
"appversion" : { "appversion" : {
"major" : 8, "major" : 9,
"minor" : 6, "minor" : 0,
"revision" : 5, "revision" : 5,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
@ -1665,33 +1514,7 @@
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 59.0, 119.0, 640.0, 480.0 ], "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 ], "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" : [ { "boxes" : [ {
"box" : { "box" : {
"id" : "obj-12", "id" : "obj-12",
@ -1956,17 +1779,11 @@
} }
} }
] ],
"originid" : "pat-188"
} }
, ,
"patching_rect" : [ 517.0, 1267.0, 129.0, 22.0 ], "patching_rect" : [ 517.0, 1267.0, 129.0, 22.0 ],
"saved_object_attributes" : {
"description" : "",
"digest" : "",
"globalpatchername" : "",
"tags" : ""
}
,
"text" : "p toggle-wave-function" "text" : "p toggle-wave-function"
} }
@ -2168,8 +1985,8 @@
"patcher" : { "patcher" : {
"fileversion" : 1, "fileversion" : 1,
"appversion" : { "appversion" : {
"major" : 8, "major" : 9,
"minor" : 6, "minor" : 0,
"revision" : 5, "revision" : 5,
"architecture" : "x64", "architecture" : "x64",
"modernui" : 1 "modernui" : 1
@ -2177,33 +1994,7 @@
, ,
"classnamespace" : "box", "classnamespace" : "box",
"rect" : [ 59.0, 119.0, 640.0, 480.0 ], "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 ], "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" : [ { "boxes" : [ {
"box" : { "box" : {
"fontname" : "Arial", "fontname" : "Arial",
@ -2322,17 +2113,11 @@
} }
} }
] ],
"originid" : "pat-190"
} }
, ,
"patching_rect" : [ 619.0, 89.0, 66.0, 22.0 ], "patching_rect" : [ 619.0, 89.0, 66.0, 22.0 ],
"saved_object_attributes" : {
"description" : "",
"digest" : "",
"globalpatchername" : "",
"tags" : ""
}
,
"text" : "p transport" "text" : "p transport"
} }
@ -2348,18 +2133,6 @@
"patching_rect" : [ 144.0, 1123.0, 24.0, 24.0 ] "patching_rect" : [ 144.0, 1123.0, 24.0, 24.0 ]
} }
}
, {
"box" : {
"id" : "obj-13",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 469.0, 170.0, 56.0, 22.0 ],
"text" : "dumpNN"
}
} }
, { , {
"box" : { "box" : {
@ -2589,6 +2362,7 @@
} }
, { , {
"box" : { "box" : {
"disablefind" : 0,
"id" : "obj-2", "id" : "obj-2",
"maxclass" : "jweb", "maxclass" : "jweb",
"numinlets" : 1, "numinlets" : 1,
@ -2754,13 +2528,6 @@
"source" : [ "obj-126", 0 ] "source" : [ "obj-126", 0 ]
} }
}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"source" : [ "obj-13", 0 ]
}
} }
, { , {
"patchline" : { "patchline" : {
@ -3154,6 +2921,13 @@
"source" : [ "obj-46", 1 ] "source" : [ "obj-46", 1 ]
} }
}
, {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"source" : [ "obj-46", 2 ]
}
} }
, { , {
"patchline" : { "patchline" : {
@ -3548,6 +3322,7 @@
} }
], ],
"originid" : "pat-178",
"parameters" : { "parameters" : {
"obj-25" : [ "dict", "dict", 0 ], "obj-25" : [ "dict", "dict", 0 ],
"parameterbanks" : { "parameterbanks" : {

View File

@ -282,6 +282,11 @@ function MasterLfoHandler() {
setTicks(event.detail); setTicks(event.detail);
} }
function handleChangeViewMode(event){
setEnabled(true);
setViewMode(event.detail);
}
function setNN(event) { function setNN(event) {
for (let i = 0; i < MAXLFOS; i++) { for (let i = 0; i < MAXLFOS; i++) {
@ -352,6 +357,7 @@ function MasterLfoHandler() {
window.addEventListener('userFunction', handleChangeUserFunction); window.addEventListener('userFunction', handleChangeUserFunction);
window.addEventListener('userDefinedType', handleChangeUserDefinedType); window.addEventListener('userDefinedType', handleChangeUserDefinedType);
window.addEventListener('maxTicks', handleMaxTicks); window.addEventListener('maxTicks', handleMaxTicks);
window.addEventListener('viewMode', handleChangeViewMode);
return () => { return () => {
window.removeEventListener('loadDict', handleLoad); window.removeEventListener('loadDict', handleLoad);
@ -366,6 +372,7 @@ function MasterLfoHandler() {
window.removeEventListener('userFunction', handleChangeUserFunction); window.removeEventListener('userFunction', handleChangeUserFunction);
window.removeEventListener('userDefinedType', handleChangeUserDefinedType); window.removeEventListener('userDefinedType', handleChangeUserDefinedType);
window.removeEventListener('maxTicks', handleMaxTicks); window.removeEventListener('maxTicks', handleMaxTicks);
window.removeEventListener('viewMode', handleChangeViewMode);
}; };
}, [...allModArrays, ...allEnumArrays, ...allEnumMats, userDefinedWaves, userDefinedFunctions, userDefinedTypes, modCenterVals, render, beatsInMeasure, ticks]); }, [...allModArrays, ...allEnumArrays, ...allEnumMats, userDefinedWaves, userDefinedFunctions, userDefinedTypes, modCenterVals, render, beatsInMeasure, ticks]);
@ -628,6 +635,10 @@ if (!DEBUG) {
window.dispatchEvent(new CustomEvent('userWave', { 'detail': data })); window.dispatchEvent(new CustomEvent('userWave', { 'detail': data }));
}); });
window.max.bindInlet("viewMode", (mode) => {
window.dispatchEvent(new CustomEvent('viewMode', { 'detail': parseInt(mode) }));
});
window.max.bindInlet("userFunction", (index, ...points) => { window.max.bindInlet("userFunction", (index, ...points) => {
//list of 101 points between 0-100 //list of 101 points between 0-100
let data = { points, index }; let data = { points, index };