From 366060721033d41f185c088ab5384547dedd9bb1 Mon Sep 17 00:00:00 2001 From: Graham Wakefield Date: Sun, 15 Jun 2025 14:06:52 -0400 Subject: [PATCH] midi parsing fix --- code/oopsy.midi.parse.gendsp | 457 ++++------ examples/midi-as-signal.maxpat | 1513 ++++++++++++++++++++++++++++++++ examples/voice1.gendsp | 577 ++++++++++++ 3 files changed, 2262 insertions(+), 285 deletions(-) create mode 100644 examples/midi-as-signal.maxpat create mode 100644 examples/voice1.gendsp diff --git a/code/oopsy.midi.parse.gendsp b/code/oopsy.midi.parse.gendsp index abf6111..41002d4 100644 --- a/code/oopsy.midi.parse.gendsp +++ b/code/oopsy.midi.parse.gendsp @@ -2,42 +2,16 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", "rect" : [ 116.0, 129.0, 1530.0, 765.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-44", @@ -435,42 +409,16 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", "rect" : [ 84.0, 103.0, 750.0, 439.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-8", @@ -1000,7 +948,8 @@ } } - ] + ], + "originid" : "pat-389" } , "patching_rect" : [ 1136.0, 291.0, 115.0, 22.0 ], @@ -1018,43 +967,29 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", - "rect" : [ 963.0, 79.0, 493.0, 447.0 ], - "bglocked" : 0, - "openinpresentation" : 0, - "default_fontsize" : 12.0, - "default_fontface" : 0, - "default_fontname" : "Arial", - "gridonopen" : 1, + "rect" : [ 134.0, 172.0, 493.0, 447.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" : [ { + "box" : { + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 182.0, 144.0, 65.0, 22.0 ], + "text" : "and" + } + + } +, { "box" : { "id" : "obj-17", "linecount" : 4, @@ -1261,7 +1196,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 219.5, 60.0, 86.0, 74.0 ], + "patching_rect" : [ 242.5, 60.0, 86.0, 74.0 ], "text" : "every 2nd data byte is a complete polypressure \nmessage" } @@ -1309,7 +1244,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 182.0, 33.0, 83.0, 22.0 ], + "patching_rect" : [ 228.0, 33.0, 83.0, 22.0 ], "text" : "in 3 bytecount" } @@ -1365,10 +1300,26 @@ "source" : [ "obj-1", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-39", 1 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 1 ], + "order" : 0, + "source" : [ "obj-11", 0 ] + } + } , { "patchline" : { "destination" : [ "obj-31", 0 ], + "order" : 1, "source" : [ "obj-11", 0 ] } @@ -1464,7 +1415,7 @@ } , { "patchline" : { - "destination" : [ "obj-39", 1 ], + "destination" : [ "obj-10", 0 ], "source" : [ "obj-32", 0 ] } @@ -1511,7 +1462,8 @@ } } - ] + ], + "originid" : "pat-391" } , "patching_rect" : [ 334.0, 291.0, 113.0, 22.0 ], @@ -1529,42 +1481,16 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", "rect" : [ 967.0, 291.0, 335.0, 377.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-26", @@ -1724,7 +1650,8 @@ } } - ] + ], + "originid" : "pat-393" } , "patching_rect" : [ 649.0, 291.0, 150.0, 22.0 ], @@ -1742,43 +1669,29 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", "rect" : [ 122.0, 174.0, 458.0, 520.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-5", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 303.0, 126.0, 53.0, 22.0 ], + "text" : "and" + } + + } +, { "box" : { "id" : "obj-15", "maxclass" : "newobj", @@ -1926,7 +1839,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 340.0, 55.0, 86.0, 60.0 ], + "patching_rect" : [ 356.0, 56.0, 86.0, 60.0 ], "text" : "every 2nd data byte is a complete \nmessage" } @@ -1974,7 +1887,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 302.5, 29.0, 83.0, 22.0 ], + "patching_rect" : [ 337.0, 29.0, 83.0, 22.0 ], "text" : "in 3 bytecount" } @@ -2025,6 +1938,15 @@ , { "patchline" : { "destination" : [ "obj-31", 0 ], + "order" : 1, + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 1 ], + "order" : 0, "source" : [ "obj-11", 0 ] } @@ -2087,7 +2009,7 @@ } , { "patchline" : { - "destination" : [ "obj-39", 1 ], + "destination" : [ "obj-5", 0 ], "source" : [ "obj-32", 0 ] } @@ -2116,6 +2038,13 @@ "source" : [ "obj-42", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-39", 1 ], + "source" : [ "obj-5", 0 ] + } + } , { "patchline" : { @@ -2131,7 +2060,8 @@ } } - ] + ], + "originid" : "pat-395" } , "patching_rect" : [ 489.0, 291.0, 93.0, 22.0 ], @@ -2149,43 +2079,29 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", - "rect" : [ 108.0, 78.0, 456.0, 537.0 ], - "bglocked" : 0, - "openinpresentation" : 0, - "default_fontsize" : 12.0, - "default_fontface" : 0, - "default_fontname" : "Arial", - "gridonopen" : 1, + "rect" : [ 134.0, 172.0, 456.0, 537.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" : [ { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 303.0, 114.0, 52.0, 22.0 ], + "text" : "and" + } + + } +, { "box" : { "id" : "obj-150", "linecount" : 9, @@ -2333,7 +2249,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 340.0, 55.0, 86.0, 60.0 ], + "patching_rect" : [ 362.0, 52.0, 86.0, 60.0 ], "text" : "every 2nd data byte is a complete \nmessage" } @@ -2381,7 +2297,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 302.5, 29.0, 83.0, 22.0 ], + "patching_rect" : [ 336.0, 29.0, 83.0, 22.0 ], "text" : "in 3 bytecount" } @@ -2428,10 +2344,19 @@ "source" : [ "obj-1", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-3", 1 ], + "order" : 0, + "source" : [ "obj-11", 0 ] + } + } , { "patchline" : { "destination" : [ "obj-31", 0 ], + "order" : 1, "source" : [ "obj-11", 0 ] } @@ -2463,6 +2388,13 @@ "source" : [ "obj-23", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-39", 1 ], + "source" : [ "obj-3", 0 ] + } + } , { "patchline" : { @@ -2473,7 +2405,7 @@ } , { "patchline" : { - "destination" : [ "obj-39", 1 ], + "destination" : [ "obj-3", 0 ], "source" : [ "obj-32", 0 ] } @@ -2533,7 +2465,8 @@ } } - ] + ], + "originid" : "pat-397" } , "patching_rect" : [ 182.0, 291.0, 78.0, 22.0 ], @@ -2551,42 +2484,16 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", "rect" : [ 714.0, 111.0, 524.0, 329.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-11", @@ -2888,7 +2795,8 @@ } } - ] + ], + "originid" : "pat-399" } , "patching_rect" : [ 970.5, 291.0, 97.0, 22.0 ], @@ -2906,43 +2814,29 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", "rect" : [ 698.0, 284.0, 812.0, 544.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-6", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 299.0, 136.0, 74.0, 22.0 ], + "text" : "and" + } + + } +, { "box" : { "id" : "obj-28", "linecount" : 2, @@ -3196,7 +3090,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 336.0, 75.0, 86.0, 60.0 ], + "patching_rect" : [ 381.0, 72.0, 86.0, 60.0 ], "text" : "every 2nd data byte is a complete \nmessage" } @@ -3244,7 +3138,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 298.5, 36.0, 83.0, 22.0 ], + "patching_rect" : [ 354.0, 40.0, 83.0, 22.0 ], "text" : "in 3 bytecount" } @@ -3316,6 +3210,15 @@ , { "patchline" : { "destination" : [ "obj-31", 0 ], + "order" : 1, + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 1 ], + "order" : 0, "source" : [ "obj-11", 0 ] } @@ -3412,7 +3315,7 @@ } , { "patchline" : { - "destination" : [ "obj-39", 1 ], + "destination" : [ "obj-6", 0 ], "source" : [ "obj-32", 0 ] } @@ -3459,6 +3362,13 @@ "source" : [ "obj-42", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-39", 1 ], + "source" : [ "obj-6", 0 ] + } + } , { "patchline" : { @@ -3481,7 +3391,8 @@ } } - ] + ], + "originid" : "pat-401" } , "patching_rect" : [ 27.0, 291.0, 89.0, 22.0 ], @@ -3499,42 +3410,16 @@ "patcher" : { "fileversion" : 1, "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, + "major" : 9, + "minor" : 0, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", - "rect" : [ 723.0, 78.0, 731.0, 537.0 ], - "bglocked" : 0, - "openinpresentation" : 0, - "default_fontsize" : 12.0, - "default_fontface" : 0, - "default_fontname" : "Arial", - "gridonopen" : 1, + "rect" : [ 134.0, 172.0, 731.0, 537.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" : [ { "box" : { "id" : "obj-8", @@ -4330,7 +4215,8 @@ } } - ] + ], + "originid" : "pat-403" } , "patching_rect" : [ 27.0, 181.0, 171.0, 22.0 ], @@ -4790,7 +4676,8 @@ } } - ] + ], + "originid" : "pat-387" } } diff --git a/examples/midi-as-signal.maxpat b/examples/midi-as-signal.maxpat new file mode 100644 index 0000000..77355d1 --- /dev/null +++ b/examples/midi-as-signal.maxpat @@ -0,0 +1,1513 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 9, + "minor" : 0, + "revision" : 4, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 59.0, 119.0, 673.0, 394.0 ], + "gridsize" : [ 15.0, 15.0 ], + "boxes" : [ { + "box" : { + "id" : "obj-2", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 354.0, 117.0, 150.0, 47.0 ], + "text" : "An example of emulating the oopsy midi signal from within Max" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 9, + "minor" : 0, + "revision" : 4, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ -304.0, -993.0, 1000.0, 789.0 ], + "gridsize" : [ 15.0, 15.0 ], + "boxes" : [ { + "box" : { + "id" : "obj-15", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 380.0, 162.0, 94.0, 20.0 ], + "text" : "# active voices" + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 322.0, 162.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 49.0, 45.0, 42.0, 22.0 ], + "text" : "reload" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 357.0, 44.0, 86.0, 20.0 ], + "text" : "MIDI as signal" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-3", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 116.0, 166.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "signal", "signal", "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 9, + "minor" : 0, + "revision" : 4, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 1432.0, -805.0, 651.0, 424.0 ], + "gridsize" : [ 15.0, 15.0 ], + "boxes" : [ { + "box" : { + "id" : "obj-51", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 98.0, 117.0, 91.0, 33.0 ], + "text" : "only trigger on note-on events" + } + + } +, { + "box" : { + "id" : "obj-50", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 98.0, 193.0, 150.0, 33.0 ], + "text" : "align trigger timing to other parameters" + } + + } +, { + "box" : { + "id" : "obj-47", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 190.0, 44.0, 22.0 ], + "text" : "history" + } + + } +, { + "box" : { + "id" : "obj-46", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 117.0, 29.5, 22.0 ], + "text" : "and" + } + + } +, { + "box" : { + "id" : "obj-45", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 25, + "outlettype" : [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ], + "patching_rect" : [ 50.0, 43.0, 271.0, 22.0 ], + "text" : "oopsy.midi.parse" + } + + } +, { + "box" : { + "id" : "obj-11", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 369.0, 132.0, 76.0, 22.0 ], + "text" : "* samplerate" + } + + } +, { + "box" : { + "id" : "obj-23", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 74.0, 377.0, 68.0, 22.0 ], + "text" : "out 1 audio" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 362.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 318.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 273.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 229.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-17", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 184.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 139.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 95.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 369.0, 190.0, 76.0, 22.0 ], + "text" : "history slope" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 267.0, 190.0, 68.0, 22.0 ], + "text" : "history freq" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 374.0, 339.0, 64.0, 22.0 ], + "text" : "out 3 busy" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 50.0, 255.0, 43.0, 22.0 ], + "text" : "voice1" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 74.0, 352.0, 107.0, 22.0 ], + "text" : "go.sigmoid.softclip" + } + + } +, { + "box" : { + "id" : "obj-78", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 74.0, 328.0, 33.0, 22.0 ], + "text" : "* 0.3" + } + + } +, { + "box" : { + "id" : "obj-38", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 369.0, 156.0, 25.0, 22.0 ], + "text" : "!/ 1" + } + + } +, { + "box" : { + "id" : "obj-35", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 267.0, 117.0, 32.0, 22.0 ], + "text" : "mtof" + } + + } +, { + "box" : { + "id" : "obj-33", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 369.0, 108.0, 193.0, 22.0 ], + "text" : "param max_duration 0.1 @min 0.1" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 17.0, 53.0, 22.0 ], + "text" : "in 3 midi" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-18", 0 ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "midpoints" : [ 128.5, 315.5, 83.5, 315.5 ], + "source" : [ "obj-16", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 116.5, 299.5, 383.5, 299.5 ], + "source" : [ "obj-16", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-17", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "midpoints" : [ 217.5, 315.5, 83.5, 315.5 ], + "source" : [ "obj-17", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 205.5, 299.5, 383.5, 299.5 ], + "source" : [ "obj-17", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-17", 0 ], + "source" : [ "obj-18", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "midpoints" : [ 172.5, 315.5, 83.5, 315.5 ], + "source" : [ "obj-18", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 160.5, 299.5, 383.5, 299.5 ], + "source" : [ "obj-18", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "midpoints" : [ 395.5, 315.5, 83.5, 315.5 ], + "source" : [ "obj-19", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "source" : [ "obj-19", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-19", 0 ], + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "midpoints" : [ 351.5, 315.5, 83.5, 315.5 ], + "source" : [ "obj-20", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 339.5, 299.5, 383.5, 299.5 ], + "source" : [ "obj-20", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-20", 0 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "midpoints" : [ 306.5, 315.5, 83.5, 315.5 ], + "source" : [ "obj-21", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 294.5, 299.5, 383.5, 299.5 ], + "source" : [ "obj-21", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-21", 0 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "midpoints" : [ 262.5, 315.5, 83.5, 315.5 ], + "source" : [ "obj-22", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 250.5, 299.5, 383.5, 299.5 ], + "source" : [ "obj-22", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-35", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-38", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "source" : [ "obj-45", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-46", 1 ], + "source" : [ "obj-45", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-46", 0 ], + "source" : [ "obj-45", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "source" : [ "obj-46", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "source" : [ "obj-47", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "source" : [ "obj-6", 2 ] + } + + } +, { + "patchline" : { + "color" : [ 0.847058823529412, 0.847058823529412, 0.847058823529412, 1.0 ], + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 71.5, 299.5, 383.5, 299.5 ], + "source" : [ "obj-6", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-78", 0 ] + } + + } + ], + "originid" : "pat-351" + } +, + "patching_rect" : [ 116.0, 110.0, 225.0, 22.0 ], + "saved_object_attributes" : { + "exportname" : "oopsy_2ddev" + } +, + "text" : "gen~", + "varname" : "oopsy_2ddev" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-1", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 322.0, 37.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "attr" : "max_duration", + "id" : "obj-7", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "parameter_enable" : 0, + "patching_rect" : [ 116.0, 45.0, 150.0, 22.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-2", 2 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "source" : [ "obj-2", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-7", 0 ] + } + + } + ], + "originid" : "pat-349" + } +, + "patching_rect" : [ 189.0, 167.0, 74.0, 22.0 ], + "saved_object_attributes" : { + "globalpatchername" : "" + } +, + "text" : "p oopsy-dev" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 9, + "minor" : 0, + "revision" : 4, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 870.0, -908.0, 1000.0, 780.0 ], + "gridsize" : [ 15.0, 15.0 ], + "boxes" : [ { + "box" : { + "id" : "obj-43", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 269.0, 400.122070000000008, 243.0, 20.0 ], + "text" : "midi encoded into audio signal oopsy-style" + } + + } +, { + "box" : { + "id" : "obj-27", + "maxclass" : "live.scope~", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 249.0, 428.122070000000008, 529.0, 74.0 ], + "samples" : 1000.0 + } + + } +, { + "box" : { + "id" : "obj-41", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 460.0, 100.0, 178.0, 33.0 ], + "text" : "buffer size to store midi bytes (max bytes per vector)" + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-38", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 282.0, 339.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "id" : "obj-35", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 361.0, 170.0, 29.5, 22.0 ], + "text" : "- 1" + } + + } +, { + "box" : { + "id" : "obj-34", + "maxclass" : "button", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 361.0, 83.0, 24.0, 24.0 ] + } + + } +, { + "box" : { + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 397.0, 146.0, 91.0, 22.0 ], + "text" : "prepend samps" + } + + } +, { + "box" : { + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 361.0, 111.0, 90.0, 22.0 ], + "text" : "loadmess 2048" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "bang", "int" ], + "patching_rect" : [ 188.0, 181.0, 105.0, 22.0 ], + "text" : "t b i" + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 456.0, 202.0, 65.0, 22.0 ], + "text" : "buftime 40" + } + + } +, { + "box" : { + "buffername" : "midiin_stream", + "id" : "obj-19", + "maxclass" : "waveform~", + "numinlets" : 5, + "numoutlets" : 6, + "outlettype" : [ "float", "float", "float", "float", "list", "" ], + "patching_rect" : [ 456.0, 231.0, 343.0, 93.0 ] + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 220.0, 261.0, 127.0, 22.0 ], + "text" : "peek~ midiin_stream" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 274.0, 223.0, 39.0, 22.0 ], + "text" : "/ 256." + } + + } +, { + "box" : { + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "patching_rect" : [ 188.0, 223.0, 79.0, 22.0 ], + "text" : "counter 2048" + } + + } +, { + "box" : { + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 397.0, 170.0, 205.0, 22.0 ], + "text" : "buffer~ midiin_stream @samps 2048" + } + + } +, { + "box" : { + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "signal", "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 9, + "minor" : 0, + "revision" : 4, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 1843.0, -805.0, 600.0, 450.0 ], + "gridsize" : [ 15.0, 15.0 ], + "boxes" : [ { + "box" : { + "id" : "obj-29", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 130.0, 328.0, 94.0, 33.0 ], + "text" : "else send -1 as \"no data\" flag" + } + + } +, { + "box" : { + "id" : "obj-28", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 206.0, 289.0, 94.0, 20.0 ], + "text" : "get value" + } + + } +, { + "box" : { + "id" : "obj-27", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 178.0, 214.0, 94.0, 20.0 ], + "text" : "get next sample" + } + + } +, { + "box" : { + "id" : "obj-26", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 109.0, 160.0, 150.0, 20.0 ], + "text" : "is there new data?" + } + + } +, { + "box" : { + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 67.0, 405.0, 35.0, 22.0 ], + "text" : "out 1" + } + + } +, { + "box" : { + "id" : "obj-23", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 109.0, 328.0, 19.0, 22.0 ], + "text" : "-1" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 88.0, 288.0, 113.0, 22.0 ], + "text" : "peek midiin_stream" + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 67.0, 352.0, 61.0, 22.0 ], + "text" : "switch" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 67.0, 72.0, 113.0, 22.0 ], + "text" : "param midiin_index" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 131.0, 44.0, 22.0 ], + "text" : "history" + } + + } +, { + "box" : { + "id" : "obj-17", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 67.0, 159.0, 42.0, 22.0 ], + "text" : "!=" + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 155.0, 189.0, 117.0, 22.0 ], + "text" : "buffer midiin_stream" + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 125.0, 213.0, 49.0, 22.0 ], + "text" : "counter" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 125.0, 258.0, 63.0, 22.0 ], + "text" : "out 2 read" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "order" : 0, + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 0 ], + "midpoints" : [ 134.5, 245.0, 279.64453125, 245.0, 279.64453125, 121.12890625, 99.5, 121.12890625 ], + "order" : 1, + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "midpoints" : [ 134.5, 245.75390625, 97.5, 245.75390625 ], + "order" : 2, + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 2 ], + "source" : [ "obj-15", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "order" : 0, + "source" : [ "obj-17", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 0 ], + "order" : 1, + "source" : [ "obj-17", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-17", 1 ], + "source" : [ "obj-18", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-17", 0 ], + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 1 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 2 ], + "source" : [ "obj-23", 0 ] + } + + } + ], + "originid" : "pat-377" + } +, + "patching_rect" : [ 188.0, 339.0, 36.0, 22.0 ], + "text" : "gen~" + } + + } +, { + "box" : { + "attr" : "midiin_index", + "displaymode" : 1, + "id" : "obj-25", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "parameter_enable" : 0, + "patching_rect" : [ 188.0, 309.0, 150.0, 22.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-1", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 188.0, 23.0, 30.0, 30.0 ], + "varname" : "u005011140" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-2", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 188.0, 428.122070000000008, 30.0, 30.0 ], + "varname" : "u335011142" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 0 ], + "order" : 0, + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "order" : 1, + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 1 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-19", 0 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-22", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "order" : 0, + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "order" : 1, + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-34", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 4 ], + "source" : [ "obj-35", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "order" : 1, + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-27", 0 ], + "order" : 0, + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "source" : [ "obj-7", 1 ] + } + + } + ], + "originid" : "pat-375" + } +, + "patching_rect" : [ 189.0, 131.0, 96.0, 22.0 ], + "saved_object_attributes" : { + "globalpatchername" : "" + } +, + "text" : "p MIDI-as-signal" + } + + } +, { + "box" : { + "id" : "obj-23", + "local" : 1, + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 189.0, 216.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 189.0, 92.0, 40.0, 22.0 ], + "text" : "midiin" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 1 ], + "order" : 0, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 0 ], + "order" : 1, + "source" : [ "obj-6", 0 ] + } + + } + ], + "originid" : "pat-345", + "dependency_cache" : [ { + "name" : "go.sigmoid.softclip.gendsp", + "bootpath" : "~/Documents/Max 9/Packages/GeneratingSoundAndOrganizingTime/patchers", + "patcherrelativepath" : "../../GeneratingSoundAndOrganizingTime/patchers", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.midi.parse.gendsp", + "bootpath" : "~/Documents/Max 9/Packages/oopsy_prerelease/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "voice1.gendsp", + "bootpath" : "~/Documents/Max 9/Packages/oopsy_prerelease/examples", + "patcherrelativepath" : ".", + "type" : "gDSP", + "implicit" : 1 + } + ], + "autosave" : 0 + } + +} diff --git a/examples/voice1.gendsp b/examples/voice1.gendsp new file mode 100644 index 0000000..fe995b5 --- /dev/null +++ b/examples/voice1.gendsp @@ -0,0 +1,577 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 9, + "minor" : 0, + "revision" : 4, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 59.0, 106.0, 418.0, 304.0 ], + "gridsize" : [ 15.0, 15.0 ], + "boxes" : [ { + "box" : { + "id" : "obj-33", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 47.0, 87.0, 22.0 ], + "text" : "scale -1 1 1 10" + } + + } +, { + "box" : { + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 23.0, 37.0, 22.0 ], + "text" : "noise" + } + + } +, { + "box" : { + "id" : "obj-28", + "linecount" : 5, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 264.75, 22.0, 77.0, 74.0 ], + "text" : "random variation to make things more interesting" + } + + } +, { + "box" : { + "id" : "obj-30", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 345.75, 46.0, 40.0, 22.0 ], + "text" : "* 0.01" + } + + } +, { + "box" : { + "id" : "obj-31", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 345.75, 22.0, 39.0, 22.0 ], + "text" : "noise" + } + + } +, { + "box" : { + "id" : "obj-17", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 26.0, 125.0, 64.0, 33.0 ], + "text" : "voice handling" + } + + } +, { + "box" : { + "id" : "obj-10", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 236.25, 181.0, 101.0, 20.0 ], + "text" : "window shape" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 133.0, 137.0, 22.0 ], + "text" : "accum @resetmode pre" + } + + } +, { + "box" : { + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 26.0, 213.5, 26.0, 22.0 ], + "text" : "> 0" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 26.0, 244.5, 64.0, 22.0 ], + "text" : "out 2 busy" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 26.0, 29.0, 44.0, 22.0 ], + "text" : "history" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 212.5, 41.0, 22.0 ], + "text" : "pow 3" + } + + } +, { + "box" : { + "id" : "obj-27", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 366.75, 237.5, 49.0, 20.0 ], + "text" : "AM" + } + + } +, { + "box" : { + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 70.0, 45.0, 22.0 ], + "text" : "* slope" + } + + } +, { + "box" : { + "id" : "obj-25", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 345.75, 70.0, 40.0, 22.0 ], + "text" : "+ freq" + } + + } +, { + "box" : { + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 167.25, 261.5, 68.0, 22.0 ], + "text" : "out 3 audio" + } + + } +, { + "box" : { + "id" : "obj-23", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 237.5, 197.5, 22.0 ], + "text" : "*" + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 371.75, 212.5, 49.0, 20.0 ], + "text" : "carrier" + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 345.75, 212.5, 24.0, 22.0 ], + "text" : "sin" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 345.75, 188.5, 45.0, 22.0 ], + "text" : "* twopi" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 345.75, 109.0, 34.0, 22.0 ], + "text" : "latch" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 345.75, 133.0, 51.0, 22.0 ], + "text" : "phasor" + } + + } +, { + "box" : { + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 109.0, 75.0, 22.0 ], + "text" : "latch @init 1" + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 26.0, 101.0, 61.0, 22.0 ], + "text" : "out 1 next" + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 29.0, 48.0, 22.0 ], + "text" : "in 1 trig" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 26.0, 77.0, 83.0, 22.0 ], + "text" : "gate 2" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 26.0, 53.0, 62.0, 22.0 ], + "text" : "switch 1 2" + } + + } +, { + "box" : { + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 181.0, 68.0, 22.0 ], + "text" : "triangle 0.1" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 214.375, 157.0, 101.0, 20.0 ], + "text" : "window ramp" + } + + } +, { + "box" : { + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.25, 157.0, 47.0, 22.0 ], + "text" : "clip 0 1" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 0 ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 1 ], + "midpoints" : [ 99.5, 104.0, 232.75, 104.0 ], + "order" : 3, + "source" : [ "obj-13", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 1 ], + "midpoints" : [ 99.5, 104.0, 370.25, 104.0 ], + "order" : 1, + "source" : [ "obj-13", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-19", 1 ], + "midpoints" : [ 99.5, 104.0, 387.25, 104.0 ], + "order" : 0, + "source" : [ "obj-13", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 1 ], + "midpoints" : [ 99.5, 104.75, 294.75, 104.75 ], + "order" : 2, + "source" : [ "obj-13", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-19", 0 ], + "source" : [ "obj-18", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 1 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 0 ], + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-30", 0 ], + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "order" : 0, + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "midpoints" : [ 176.75, 208.25, 35.5, 208.25 ], + "order" : 1, + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "midpoints" : [ 35.5, 240.5, 20.5, 240.5, 20.5, 22.0, 35.5, 22.0 ], + "order" : 1, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "order" : 0, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-9", 0 ] + } + + } + ], + "originid" : "pat-379", + "autosave" : 0 + } + +}