diff --git a/.gitignore b/.gitignore index 17012a9..3af64a4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,8 @@ build/ source/build* notes/ examples/*.cpp -examples/*.h \ No newline at end of file +examples/*.h +help/*.cpp +help/*.h +templates/*.cpp +templates/*.h \ No newline at end of file diff --git a/README.md b/README.md index e6df19f..4c00e61 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Each Daisy binary can hold several gen~ patcher "apps", which can be switched be ## How gen~ features map to Daisy -Mostly this works by adding an appropriate name to the `in`, `out`, and `param` objects. +Mostly this works by adding an appropriate name to the `in`, `out`, and `param` objects, but many features will also auto-map without special naming. ### Audio @@ -20,7 +20,7 @@ Hardware voltages are mapped to gen~ -1..1 ### CV/Gate/Knobs/Switches etc. -- `param cv1`, `param gate2`, `param knob1`, `param key2` etc. will give you the CV and gate inputs, hardware knobs, keys, etc. Use `@min` and `@max` to remap the normalized ranges. Use `@min` and `@max` to remap normalized ranges as desired. +- `param cv1`, `param gate2`, `param knob1`, `param key2`, `param knob_delay`, `param switch_enable` etc. will give you the CV and gate inputs, hardware knobs, keys, etc. Use `@min` and `@max` to remap the normalized ranges. Use `@min` and `@max` to remap normalized ranges as desired. - Oopsy will try to auto-map any other `param` objects to any unused Knob/CV inputs. - `out cv1`, `out gate2`, etc. will send the signal to corresponding CV or Gate outputs if the device has them. `` just needs to be an output channel number that isn't being used for anything else. - CV/gate inputs and outputs are sampled at block rate, which on the default configuration of the Daisy is every 48 samples = 1ms. Trigger/gates shorter than 1-2ms might be missed. diff --git a/code/oopsy.ctrl.smooth2.gendsp b/code/oopsy.ctrl.smooth2.gendsp new file mode 100644 index 0000000..e26e7f3 --- /dev/null +++ b/code/oopsy.ctrl.smooth2.gendsp @@ -0,0 +1,269 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 84.0, 103.0, 466.0, 288.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-15", + "linecount" : 8, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 254.0, 61.0, 150.0, 114.0 ], + "text" : "A 2-pole lowpass filter at 10Hz seems to effectively silence noise from hardware input ADCs.\n\nBut a 10Hz filter might be too slow to respond, if so, try the smooth3 option." + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 118.0, 193.0, 46.0, 23.0 ], + "text" : "mix" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 118.0, 153.0, 45.0, 23.0 ], + "text" : "history" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 118.0, 239.0, 37.0, 23.0 ], + "text" : "out 1" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 44.0, 193.0, 46.0, 23.0 ], + "text" : "mix" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 127.5, 53.0, 109.0, 23.0 ], + "text" : "* twopi/samplerate" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 44.0, 153.0, 45.0, 23.0 ], + "text" : "history" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 127.5, 84.0, 26.0, 23.0 ], + "text" : "sin" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 57.5, 84.0, 28.0, 23.0 ], + "text" : "in 1" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 127.5, 23.0, 22.0, 23.0 ], + "text" : "10" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-6", 1 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 2 ], + "midpoints" : [ 137.0, 121.5, 80.5, 121.5 ], + "order" : 1, + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 2 ], + "midpoints" : [ 137.0, 122.5, 154.5, 122.5 ], + "order" : 0, + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "midpoints" : [ 53.5, 222.0, 31.5, 222.0, 31.5, 141.0, 53.5, 141.0 ], + "order" : 1, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 1 ], + "order" : 0, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "order" : 0, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 127.5, 222.0, 105.5, 222.0, 105.5, 141.0, 127.5, 141.0 ], + "order" : 1, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "source" : [ "obj-9", 0 ] + } + + } + ] + } + +} diff --git a/code/oopsy.ctrl.smooth3.gendsp b/code/oopsy.ctrl.smooth3.gendsp new file mode 100644 index 0000000..9cb3de8 --- /dev/null +++ b/code/oopsy.ctrl.smooth3.gendsp @@ -0,0 +1,331 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 84.0, 103.0, 466.0, 288.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-15", + "linecount" : 13, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 276.0, 35.0, 150.0, 181.0 ], + "text" : "A 3-pole lowpass filter at 30Hz seems to effectively silence any noise from hardware input ADCs.\n\nMost of the time this level of aggressive smoothing is probably unnecessary, but for some applications that are very sensitive (e.g. setting long delay line lengths) it might be needed." + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-11", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 190.5, 193.0, 46.0, 23.0 ], + "text" : "mix" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 190.5, 153.0, 45.0, 23.0 ], + "text" : "history" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 118.0, 193.0, 46.0, 23.0 ], + "text" : "mix" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 118.0, 153.0, 45.0, 23.0 ], + "text" : "history" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 190.5, 240.0, 37.0, 23.0 ], + "text" : "out 1" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 44.0, 193.0, 46.0, 23.0 ], + "text" : "mix" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 127.5, 53.0, 109.0, 23.0 ], + "text" : "* twopi/samplerate" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 44.0, 153.0, 45.0, 23.0 ], + "text" : "history" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 127.5, 84.0, 26.0, 23.0 ], + "text" : "sin" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 57.5, 84.0, 28.0, 23.0 ], + "text" : "in 1" + } + + } +, { + "box" : { + "fontname" : "Lato", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 127.5, 23.0, 22.0, 23.0 ], + "text" : "30" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-6", 1 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "midpoints" : [ 200.0, 222.0, 178.0, 222.0, 178.0, 141.0, 200.0, 141.0 ], + "order" : 1, + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "order" : 0, + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 2 ], + "midpoints" : [ 137.0, 123.5, 227.0, 123.5 ], + "order" : 0, + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 2 ], + "midpoints" : [ 137.0, 121.5, 80.5, 121.5 ], + "order" : 2, + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 2 ], + "midpoints" : [ 137.0, 122.5, 154.5, 122.5 ], + "order" : 1, + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "midpoints" : [ 53.5, 222.0, 31.5, 222.0, 31.5, 141.0, 53.5, 141.0 ], + "order" : 1, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 1 ], + "order" : 0, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 1 ], + "order" : 0, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "midpoints" : [ 127.5, 222.0, 105.5, 222.0, 105.5, 141.0, 127.5, 141.0 ], + "order" : 1, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "source" : [ "obj-9", 0 ] + } + + } + ], + "autosave" : 0 + } + +} diff --git a/code/oopsy.cv2hz.gendsp b/code/oopsy.cv2hz.gendsp new file mode 100644 index 0000000..49d76ce --- /dev/null +++ b/code/oopsy.cv2hz.gendsp @@ -0,0 +1,236 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 742.0, 324.0, 764.0, 299.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-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 536.0, 20.0, 71.0, 22.0 ], + "text" : "in 2 register" + } + + } +, { + "box" : { + "id" : "obj-33", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 551.0, 50.0, 187.0, 33.0 ], + "text" : "add integer here to shift register (default 3v = C4 MIDI 60" + } + + } +, { + "box" : { + "id" : "obj-29", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 489.0, 121.0, 150.0, 20.0 ], + "text" : "chroma rotate A->C (3/12)" + } + + } +, { + "box" : { + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 444.0, 121.0, 42.0, 22.0 ], + "text" : "+ 0.25" + } + + } +, { + "box" : { + "id" : "obj-25", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 421.0, 121.0, 19.0, 22.0 ], + "text" : "2" + } + + } +, { + "box" : { + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 421.0, 150.0, 42.0, 22.0 ], + "text" : "pow" + } + + } +, { + "box" : { + "id" : "obj-27", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 421.0, 179.0, 40.0, 22.0 ], + "text" : "* 27.5" + } + + } +, { + "box" : { + "id" : "obj-15", + "linecount" : 14, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 23.0, 20.0, 354.0, 194.0 ], + "text" : "CV to Hz is somewhat arbitrary, with a variety of conventions in wide use. \n\nOne widespread convention is that adding one volt will increase pitch by one octave (every 2^1/12 volt is a semitone), which is implemented here. The base tuning of an integer voltage is mostly a \"C\", which is also implemented here, but see https://learningmodular.com/matching-octaves-in-your-modular to see how much the register can vary in hardware; 0v, 1v, 2v and 3v are all widespread tunings for MIDI note 60 (C4) for example.\n\nYou can shift the register simply by adding an integer to the input CV. Here we chose 3v == C4/MIDI 60 as a default." + } + + } +, { + "box" : { + "id" : "obj-41", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 444.0, 72.0, 29.5, 22.0 ], + "text" : "+" + } + + } +, { + "box" : { + "id" : "obj-40", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 489.0, 179.0, 150.0, 20.0 ], + "text" : "frequency of MIDI A0" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 444.0, 20.0, 75.0, 22.0 ], + "text" : "in 1 pitch_cv" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 421.0, 252.0, 53.0, 22.0 ], + "text" : "out 1 Hz" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-41", 1 ], + "midpoints" : [ 545.5, 54.0, 464.0, 54.0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 1 ], + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-27", 0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-27", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "source" : [ "obj-41", 0 ] + } + + } + ] + } + +} diff --git a/code/oopsy.gate.min.gendsp b/code/oopsy.gate.min.gendsp new file mode 100644 index 0000000..1e34dd8 --- /dev/null +++ b/code/oopsy.gate.min.gendsp @@ -0,0 +1,285 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 84.0, 103.0, 658.0, 409.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" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 108.25, 267.0, 70.0, 22.0 ], + "text" : "mstosamps" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 108.25, 291.0, 89.0, 22.0 ], + "text" : "max vectorsize" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 108.25, 243.0, 62.0, 22.0 ], + "text" : "param ms" + } + + } +, { + "box" : { + "id" : "obj-1", + "linecount" : 10, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 376.25, 130.0, 230.0, 141.0 ], + "text" : "This subpatcher will extend any short click or gate (positive non-zero values) at least one signal vector's worth.\n\nThis may be necessary to ensure that any very short gates are not 'missed' by the GPIO output handling of the hardware (or indeed by any other hardware unable to register very short gates). " + } + + } +, { + "box" : { + "id" : "obj-41", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 112.25, 319.0, 196.0, 60.0 ], + "text" : "keep gate high until 1+ control vectors have passed. On Daisy with the default blockrate of 1kHz this implies 1ms." + } + + } +, { + "box" : { + "id" : "obj-40", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 108.25, 195.0, 229.0, 20.0 ], + "text" : "Reset sample counter on rising edge" + } + + } +, { + "box" : { + "id" : "obj-37", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 108.25, 133.5, 229.0, 20.0 ], + "text" : "Detect rising edge" + } + + } +, { + "box" : { + "id" : "obj-36", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 108.25, 102.0, 229.0, 20.0 ], + "text" : "Basic daisy gate logic (gate high if > 0)" + } + + } +, { + "box" : { + "id" : "obj-34", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 333.0, 29.5, 22.0 ], + "text" : "<=" + } + + } +, { + "box" : { + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 195.0, 33.0, 22.0 ], + "text" : "+= 1" + } + + } +, { + "box" : { + "id" : "obj-31", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 160.5, 26.0, 22.0 ], + "text" : "> 0" + } + + } +, { + "box" : { + "id" : "obj-30", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 133.5, 48.0, 22.0 ], + "text" : "change" + } + + } +, { + "box" : { + "id" : "obj-27", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 100.0, 26.0, 22.0 ], + "text" : "> 0" + } + + } +, { + "box" : { + "id" : "obj-43", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 40.0, 28.0, 22.0 ], + "text" : "in 1" + } + + } +, { + "box" : { + "id" : "obj-44", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.25, 357.0, 35.0, 22.0 ], + "text" : "out 1" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-30", 0 ], + "source" : [ "obj-27", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-44", 0 ], + "source" : [ "obj-34", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 1 ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-27", 0 ], + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "source" : [ "obj-5", 0 ] + } + + } + ], + "autosave" : 0 + } + +} diff --git a/code/gen2daisy.midiformat.gendsp b/code/oopsy.midi.format.gendsp similarity index 100% rename from code/gen2daisy.midiformat.gendsp rename to code/oopsy.midi.format.gendsp diff --git a/code/gen2daisy.midiparse.gendsp b/code/oopsy.midi.parse.gendsp similarity index 100% rename from code/gen2daisy.midiparse.gendsp rename to code/oopsy.midi.parse.gendsp diff --git a/code/oopsy.suggestions.gendsp b/code/oopsy.suggestions.gendsp new file mode 100644 index 0000000..ed1bcef --- /dev/null +++ b/code/oopsy.suggestions.gendsp @@ -0,0 +1,106 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 84.0, 103.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-3", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 235.0, 404.0, 60.0 ], + "presentation_linecount" : 4, + "text" : "Similarly, output gates that are shorter than 1ms may be missed, because of control-rate sampling. This subpatcher ensures even a single-sample click will be extended to the minimum gate duration for the hardware (1ms by default):" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 297.0, 89.0, 22.0 ], + "text" : "oopsy.gate.min" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 170.0, 166.5, 108.0, 22.0 ], + "text" : "oopsy.ctrl.smooth3" + } + + } +, { + "box" : { + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 166.5, 108.0, 22.0 ], + "text" : "oopsy.ctrl.smooth2" + } + + } +, { + "box" : { + "id" : "obj-22", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 100.0, 404.0, 60.0 ], + "text" : "Note that CV/knob inputs update at block-rate, which is by default 1ms for Daisy. You may want to add some filtering or smoothing to CVs, depending on how they are being used in the patch. Here are some options:" + } + + } + ], + "lines" : [ ] + } + +} diff --git a/examples/midi_io.maxpat b/examples/midi_io.maxpat index 7454750..9e29a5b 100644 --- a/examples/midi_io.maxpat +++ b/examples/midi_io.maxpat @@ -39,6 +39,25 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-13", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 25.0, 88.0, 128.0, 128.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "id" : "obj-6", "lastchannelcount" : 0, @@ -73,29 +92,6 @@ "patching_rect" : [ 29.333333333333343, 532.0, 45.0, 45.0 ] } - } -, { - "box" : { - "id" : "obj-18", - "maxclass" : "button", - "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "bang" ], - "parameter_enable" : 0, - "patching_rect" : [ 590.0, 446.0, 74.0, 74.0 ] - } - - } -, { - "box" : { - "id" : "obj-14", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 590.0, 537.0, 41.0, 22.0 ], - "text" : "oopsy" - } - } , { "box" : { @@ -3034,7 +3030,7 @@ "numoutlets" : 25, "outlettype" : [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ], "patching_rect" : [ 55.0, 185.0, 271.0, 22.0 ], - "text" : "gen2daisy.midiparse" + "text" : "oopsy.midi.parse" } } @@ -3426,7 +3422,7 @@ "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 508.0, 185.0, 166.0, 22.0 ], - "text" : "gen2daisy.midiformat" + "text" : "oopsy.midi.format" } } @@ -3558,7 +3554,7 @@ "exportname" : "midi_io" } , - "text" : "gen~ @title midi_io", + "text" : "gen~", "textcolor" : [ 0.996078431372549, 0.996078431372549, 0.996078431372549, 1.0 ], "varname" : "midi_io" } @@ -3613,13 +3609,6 @@ "source" : [ "obj-17", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-14", 0 ], - "source" : [ "obj-18", 0 ] - } - } , { "patchline" : { @@ -3697,6 +3686,8 @@ } ], "parameters" : { + "obj-13::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-13::obj-36" : [ "live.menu[1]", "live.menu", 0 ], "obj-6" : [ "live.gain~", "live.gain~", 0 ], "parameterbanks" : { @@ -3706,14 +3697,14 @@ } , "dependency_cache" : [ { - "name" : "gen2daisy.midiparse.gendsp", + "name" : "oopsy.midi.format.gendsp", "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", "implicit" : 1 } , { - "name" : "gen2daisy.midiformat.gendsp", + "name" : "oopsy.midi.parse.gendsp", "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", diff --git a/examples/lrmsmslr.maxpat b/examples/midside.maxpat similarity index 74% rename from examples/lrmsmslr.maxpat rename to examples/midside.maxpat index 9c8e96d..c91d084 100644 --- a/examples/lrmsmslr.maxpat +++ b/examples/midside.maxpat @@ -10,7 +10,7 @@ } , "classnamespace" : "box", - "rect" : [ 59.0, 78.0, 396.0, 613.0 ], + "rect" : [ 59.0, 78.0, 586.0, 640.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -40,25 +40,20 @@ "assistshowspatchername" : 0, "boxes" : [ { "box" : { - "id" : "obj-6", - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 49.0, 219.0, 68.0, 22.0 ], - "text" : "exportcode" - } - - } -, { - "box" : { - "id" : "obj-7", - "linecount" : 3, - "maxclass" : "comment", + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 162.0, 272.0, 150.0, 47.0 ], - "text" : "Inspired by the Worng Electronics device of the same name." + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 298.0, 26.0, 128.0, 128.0 ], + "viewvisibility" : 1 } } @@ -106,7 +101,7 @@ } , "classnamespace" : "dsp.gen", - "rect" : [ 397.0, 78.0, 634.0, 454.0 ], + "rect" : [ 761.0, 119.0, 634.0, 454.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -135,13 +130,25 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "id" : "obj-14", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 334.0, 183.0, 150.0, 47.0 ], + "text" : "A really basic patch for mid-side stereo conversion" + } + + } +, { "box" : { "id" : "obj-11", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 247.5, 241.0, 45.0, 22.0 ], - "text" : "out 4" + "patching_rect" : [ 221.0, 249.0, 47.0, 22.0 ], + "text" : "out 4 R" } } @@ -151,8 +158,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 200.0, 241.0, 45.0, 22.0 ], - "text" : "out 3" + "patching_rect" : [ 168.0, 249.0, 45.0, 22.0 ], + "text" : "out 3 L" } } @@ -163,7 +170,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 247.5, 175.0, 39.5, 22.0 ], + "patching_rect" : [ 221.0, 183.0, 39.5, 22.0 ], "text" : "-" } @@ -175,7 +182,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 200.0, 175.0, 32.0, 22.0 ], + "patching_rect" : [ 168.0, 183.0, 32.0, 22.0 ], "text" : "/ 2" } @@ -186,8 +193,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 110.5, 241.0, 45.0, 22.0 ], - "text" : "out 2" + "patching_rect" : [ 84.0, 249.0, 47.0, 22.0 ], + "text" : "out 2 S" } } @@ -197,8 +204,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 63.0, 241.0, 45.0, 22.0 ], - "text" : "out 1" + "patching_rect" : [ 31.0, 249.0, 49.0, 22.0 ], + "text" : "out 1 M" } } @@ -209,7 +216,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 110.5, 175.0, 39.5, 22.0 ], + "patching_rect" : [ 84.0, 183.0, 39.5, 22.0 ], "text" : "-" } @@ -221,7 +228,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 63.0, 175.0, 32.0, 22.0 ], + "patching_rect" : [ 31.0, 183.0, 32.0, 22.0 ], "text" : "/ 2" } @@ -233,8 +240,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 258.0, 117.0, 38.0, 22.0 ], - "text" : "in 4" + "patching_rect" : [ 241.5, 125.0, 39.0, 22.0 ], + "text" : "in 4 S" } } @@ -245,8 +252,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 200.0, 117.0, 38.0, 22.0 ], - "text" : "in 3" + "patching_rect" : [ 168.0, 125.0, 41.0, 22.0 ], + "text" : "in 3 M" } } @@ -257,8 +264,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 121.0, 117.0, 38.0, 22.0 ], - "text" : "in 2" + "patching_rect" : [ 104.5, 125.0, 40.0, 22.0 ], + "text" : "in 2 R" } } @@ -269,8 +276,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 63.0, 117.0, 38.0, 22.0 ], - "text" : "in 1" + "patching_rect" : [ 31.0, 125.0, 38.0, 22.0 ], + "text" : "in 1 L" } } @@ -370,15 +377,14 @@ ] } , - "patching_rect" : [ 24.0, 272.0, 118.0, 22.0 ], + "patching_rect" : [ 24.0, 272.0, 50.5, 22.0 ], "saved_object_attributes" : { "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/examples/", - "exportname" : "lrmsmslr", - "exportnotifier" : "1203_ged_export" + "exportname" : "midside" } , - "text" : "gen~ @title lrmsmslr", - "varname" : "lrmsmslr" + "text" : "gen~", + "varname" : "midside" } } @@ -387,11 +393,12 @@ "fontname" : "Arial Bold Italic", "fontsize" : 24.0, "id" : "obj-3", + "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 24.0, 26.0, 261.0, 33.0 ], - "text" : "Mid-Side converter" + "patching_rect" : [ 24.0, 26.0, 261.0, 60.0 ], + "text" : "Mid-Side Stereo Conversion" } } @@ -426,25 +433,52 @@ "source" : [ "obj-4", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-1", 0 ], - "source" : [ "obj-6", 0 ] - } - } ], "parameters" : { "obj-4" : [ "live.gain~", "live.gain~", 0 ], + "obj-9::obj-32" : [ "live.text[4]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], "parameterbanks" : { + } +, + "parameter_overrides" : { + "obj-9::obj-32" : { + "parameter_longname" : "live.text[4]" + } +, + "obj-9::obj-36" : { + "parameter_longname" : "live.menu[1]" + } + } , "inherited_shortname" : 1 } , - "dependency_cache" : [ ], + "dependency_cache" : [ { + "name" : "oopsy.maxpat", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "patcherrelativepath" : "../patchers", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } + ], "autosave" : 0 } diff --git a/examples/reverb.maxpat b/examples/reverb.maxpat index 3fd5ebf..7437c19 100644 --- a/examples/reverb.maxpat +++ b/examples/reverb.maxpat @@ -4,13 +4,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 5, + "revision" : 8, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 59.0, 78.0, 431.0, 612.0 ], + "rect" : [ 926.0, 78.0, 576.0, 594.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -40,25 +40,32 @@ "assistshowspatchername" : 0, "boxes" : [ { "box" : { - "id" : "obj-6", - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 63.0, 224.0, 68.0, 22.0 ], - "text" : "exportcode" + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 191.5, 106.0, 128.0, 128.0 ], + "viewvisibility" : 1 } } , { "box" : { "id" : "obj-7", - "linecount" : 2, + "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 148.0, 272.0, 215.0, 33.0 ], - "text" : "Based on the Dattoro reverb gen~ example inclouded with Max" + "patching_rect" : [ 191.5, 508.0, 337.0, 62.0 ], + "text" : "Adapted from the Dattoro reverb gen~ example included with Max, which is based on Jon Dattorro's Effect Design Part 1: Reverberator and Other Filters, located here: https://ccrma.stanford.edu/~dattorro/EffectDesignPart1.pdf" } } @@ -100,13 +107,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 5, + "revision" : 8, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", - "rect" : [ 397.0, 78.0, 586.0, 703.0 ], + "rect" : [ 739.0, 102.0, 868.0, 840.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -165,8 +172,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 369.0, 585.0, 65.0, 22.0 ], - "text" : "param wet" + "patching_rect" : [ 482.0, 451.666655999999989, 94.0, 22.0 ], + "text" : "param ctrl1_wet" } } @@ -311,7 +318,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 5, + "revision" : 8, "architecture" : "x64", "modernui" : 1 } @@ -1982,7 +1989,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 228.5, 441.666655999999989, 98.0, 22.0 ], + "patching_rect" : [ 372.5, 451.666655999999989, 98.0, 22.0 ], "text" : "param decay 0.5" } @@ -2035,7 +2042,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 5, + "revision" : 8, "architecture" : "x64", "modernui" : 1 } @@ -2965,14 +2972,13 @@ ] } , - "patching_rect" : [ 24.0, 272.0, 107.0, 22.0 ], + "patching_rect" : [ 24.0, 272.0, 36.0, 22.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/examples/", - "exportname" : "reverb", - "exportnotifier" : "1208_ged_export" + "exportfolder" : "C:/Users/shensley/Documents/Max 8/Packages/oopsy/examples/", + "exportname" : "reverb" } , - "text" : "gen~ @title reverb", + "text" : "gen~", "varname" : "reverb" } @@ -2985,7 +2991,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 24.0, 26.0, 261.0, 33.0 ], + "patching_rect" : [ 24.0, 26.0, 261.0, 34.0 ], "text" : "Reverb" } @@ -3021,17 +3027,12 @@ "source" : [ "obj-4", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-1", 0 ], - "source" : [ "obj-6", 0 ] - } - } ], "parameters" : { "obj-4" : [ "live.gain~", "live.gain~", 0 ], + "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], "parameterbanks" : { } @@ -3039,7 +3040,28 @@ "inherited_shortname" : 1 } , - "dependency_cache" : [ ], + "dependency_cache" : [ { + "name" : "oopsy.maxpat", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "patcherrelativepath" : "../patchers", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } + ], "autosave" : 0 } diff --git a/examples/simple.maxpat b/examples/simple.maxpat index 169869e..30617ba 100644 --- a/examples/simple.maxpat +++ b/examples/simple.maxpat @@ -10,7 +10,7 @@ } , "classnamespace" : "box", - "rect" : [ 1837.0, 80.0, 640.0, 480.0 ], + "rect" : [ 1006.0, 80.0, 640.0, 480.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -40,24 +40,20 @@ "assistshowspatchername" : 0, "boxes" : [ { "box" : { - "id" : "obj-5", - "maxclass" : "comment", + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 125.0, 152.0, 186.0, 20.0 ], - "text" : "Audio must be enabled for export" - } - - } -, { - "box" : { - "id" : "obj-3", - "maxclass" : "message", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 125.0, 193.0, 68.0, 22.0 ], - "text" : "exportcode" + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 108.5, 111.0, 128.0, 128.0 ], + "viewvisibility" : 1 } } @@ -79,7 +75,7 @@ } , "classnamespace" : "dsp.gen", - "rect" : [ 2843.0, 312.0, 600.0, 450.0 ], + "rect" : [ 1046.0, 312.0, 600.0, 450.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -341,27 +337,51 @@ ] } , - "patching_rect" : [ 125.0, 233.0, 108.0, 22.0 ], + "patching_rect" : [ 24.0, 261.0, 39.0, 22.0 ], "saved_object_attributes" : { "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/examples/", "exportname" : "simple" } , - "text" : "gen~ @title simple", + "text" : "gen~", "varname" : "simple" } } ], - "lines" : [ { - "patchline" : { - "destination" : [ "obj-1", 0 ], - "source" : [ "obj-3", 0 ] - } + "lines" : [ ], + "parameters" : { + "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], + "parameterbanks" : { } +, + "inherited_shortname" : 1 + } +, + "dependency_cache" : [ { + "name" : "oopsy.maxpat", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "patcherrelativepath" : "../patchers", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } ], - "dependency_cache" : [ ], "autosave" : 0 } diff --git a/examples/daisy_patch.maxpat b/help/oopsy.maxhelp similarity index 56% rename from examples/daisy_patch.maxpat rename to help/oopsy.maxhelp index f6793aa..f99577f 100644 --- a/examples/daisy_patch.maxpat +++ b/help/oopsy.maxhelp @@ -10,7 +10,7 @@ } , "classnamespace" : "box", - "rect" : [ 692.0, 240.0, 640.0, 480.0 ], + "rect" : [ 429.0, 121.0, 640.0, 480.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -40,23 +40,67 @@ "assistshowspatchername" : 0, "boxes" : [ { "box" : { - "id" : "obj-2", + "id" : "obj-11", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 375.0, 118.0, 153.0, 60.0 ], - "text" : "Send a bang to [oopsy], or just save the patcher, to trigger code generation and upload." + "patching_rect" : [ 315.0, 271.0, 261.0, 60.0 ], + "text" : "If the max patch has more than one gen~ object, all will be combined into a \"multi-app\" binary for the Daisy. Use the device encoder or switches to select the apps. " } } , { "box" : { - "id" : "obj-13", - "maxclass" : "newobj", + "id" : "obj-10", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 315.0, 229.0, 259.0, 33.0 ], + "text" : "If the device is plugged in via USB and ready to flash, oopsy will also try to flash it." + } + + } +, { + "box" : { + "bubble" : 1, + "id" : "obj-7", + "linecount" : 4, + "maxclass" : "comment", "numinlets" : 1, - "numoutlets" : 3, - "outlettype" : [ "signal", "signal", "signal" ], + "numoutlets" : 0, + "patching_rect" : [ 300.0, 155.0, 275.0, 64.0 ], + "text" : "Drop in an 'oopsy_builder' bpatcher in any Max patch with gen~ objects. Select the target from the drop down and bang (or save the patch) to compile!" + } + + } +, { + "box" : { + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 163.0, 155.0, 128.0, 128.0 ], + "viewvisibility" : 1 + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "signal" ], "patcher" : { "fileversion" : 1, "appversion" : { @@ -97,13 +141,26 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 78.0, 192.0, 37.0, 22.0 ], + "text" : "noise" + } + + } +, { "box" : { "id" : "obj-9", "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 395.0, 266.0, 57.0, 22.0 ], - "text" : "out 3 cv1" + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 62.0, 227.0, 29.5, 22.0 ], + "text" : "*" } } @@ -112,9 +169,10 @@ "id" : "obj-8", "maxclass" : "newobj", "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 352.0, 339.0, 69.0, 22.0 ], - "text" : "out 2 gate1" + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 165.0, 192.0, 36.0, 22.0 ], + "text" : "cycle" } } @@ -125,56 +183,55 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 73.0, 316.0, 65.0, 22.0 ], - "text" : "param cv2" + "patching_rect" : [ 62.0, 149.0, 62.0, 22.0 ], + "text" : "param ctrl" } } , { "box" : { - "id" : "obj-5", + "id" : "obj-6", "maxclass" : "newobj", "numinlets" : 0, - "numoutlets" : 2, - "outlettype" : [ "", "" ], - "patching_rect" : [ 315.0, 138.0, 102.0, 22.0 ], - "text" : "data foodat 100 2" + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 165.0, 149.0, 188.0, 22.0 ], + "text" : "param ctrl2 @min 200 @max 800" } } , { "box" : { - "id" : "obj-1", + "id" : "obj-5", "maxclass" : "newobj", - "numinlets" : 0, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 50.0, 14.0, 60.0, 22.0 ], - "text" : "in 1 offset" + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 142.0, 337.0, 35.0, 22.0 ], + "text" : "out 2" } } , { "box" : { - "id" : "obj-2", + "id" : "obj-1", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 305.0, 14.0, 88.0, 22.0 ], - "text" : "param cv1_foo" + "patching_rect" : [ 33.0, 73.0, 28.0, 22.0 ], + "text" : "in 1" } } , { "box" : { - "id" : "obj-3", + "id" : "obj-2", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 176.0, 149.0, 37.0, 22.0 ], - "text" : "noise" + "patching_rect" : [ 142.0, 73.0, 28.0, 22.0 ], + "text" : "in 2" } } @@ -184,8 +241,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 176.0, 418.0, 61.0, 22.0 ], - "text" : "out 1 sum" + "patching_rect" : [ 33.0, 337.0, 35.0, 22.0 ], + "text" : "out 1" } } @@ -199,209 +256,96 @@ } , { "patchline" : { - "destination" : [ "obj-4", 0 ], - "source" : [ "obj-2", 0 ] + "destination" : [ "obj-9", 1 ], + "source" : [ "obj-10", 0 ] } } , { "patchline" : { - "destination" : [ "obj-4", 0 ], - "source" : [ "obj-3", 0 ] + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-2", 0 ] } } , { "patchline" : { "destination" : [ "obj-8", 0 ], - "order" : 1, - "source" : [ "obj-5", 0 ] + "source" : [ "obj-6", 0 ] } } , { "patchline" : { "destination" : [ "obj-9", 0 ], - "order" : 0, - "source" : [ "obj-5", 0 ] + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-8", 0 ] } } , { "patchline" : { "destination" : [ "obj-4", 0 ], - "source" : [ "obj-7", 0 ] + "source" : [ "obj-9", 0 ] } } ] } , - "patching_rect" : [ 184.0, 291.0, 130.0, 22.0 ], + "patching_rect" : [ 49.0, 213.0, 36.0, 22.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/examples/", - "exportname" : "otherpatch" + "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/help/", + "exportname" : "oopsymaxhelp" } , - "text" : "gen~ @title otherpatch", - "varname" : "otherpatch" + "text" : "gen~", + "varname" : "oopsymaxhelp" } } , { "box" : { - "id" : "obj-12", - "maxclass" : "button", + "id" : "obj-4", + "maxclass" : "comment", "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "bang" ], - "parameter_enable" : 0, - "patching_rect" : [ 375.0, 186.0, 33.0, 33.0 ] + "numoutlets" : 0, + "patching_rect" : [ 13.0, 48.0, 123.0, 20.0 ], + "text" : "Daisy from gen~" } } , { "box" : { - "id" : "obj-6", - "maxclass" : "newobj", + "fontname" : "Arial Bold Italic", + "fontsize" : 24.0, + "id" : "obj-2", + "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 375.0, 225.0, 119.0, 22.0 ], - "text" : "oopsy @target patch" + "patching_rect" : [ 13.0, 13.0, 123.0, 33.0 ], + "text" : "Oopsy" } } -, { - "box" : { - "id" : "obj-3", - "maxclass" : "newobj", - "numinlets" : 2, - "numoutlets" : 1, - "outlettype" : [ "signal" ], - "patcher" : { - "fileversion" : 1, - "appversion" : { - "major" : 8, - "minor" : 1, - "revision" : 5, - "architecture" : "x64", - "modernui" : 1 - } -, - "classnamespace" : "dsp.gen", - "rect" : [ 84.0, 103.0, 600.0, 450.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-1", - "maxclass" : "newobj", - "numinlets" : 0, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 50.0, 14.0, 28.0, 22.0 ], - "text" : "in 1" - } - - } -, { - "box" : { - "id" : "obj-2", - "maxclass" : "newobj", - "numinlets" : 0, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 305.0, 14.0, 28.0, 22.0 ], - "text" : "in 2" - } - - } -, { - "box" : { - "id" : "obj-3", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 2, - "outlettype" : [ "", "" ], - "patching_rect" : [ 176.0, 149.0, 36.0, 22.0 ], - "text" : "cycle" - } - - } -, { - "box" : { - "id" : "obj-4", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 46.5, 302.0, 35.0, 22.0 ], - "text" : "out 1" - } - - } ], - "lines" : [ { - "patchline" : { - "destination" : [ "obj-4", 0 ], - "source" : [ "obj-1", 0 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-4", 0 ], - "source" : [ "obj-3", 0 ] - } + "lines" : [ ], + "parameters" : { + "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], + "parameterbanks" : { - } - ] - } + } , - "patching_rect" : [ 33.0, 291.0, 137.0, 22.0 ], - "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/examples/", - "exportname" : "simplepatch" - } + "inherited_shortname" : 1 + } , - "text" : "gen~ @title simplepatch", - "varname" : "simplepatch" - } - - } - ], - "lines" : [ { - "patchline" : { - "destination" : [ "obj-6", 0 ], - "source" : [ "obj-12", 0 ] - } - - } - ], "dependency_cache" : [ { "name" : "oopsy.maxpat", "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", diff --git a/init/oopsy-objectmappings.txt b/init/oopsy-objectmappings.txt new file mode 100644 index 0000000..04440f5 --- /dev/null +++ b/init/oopsy-objectmappings.txt @@ -0,0 +1,10 @@ +max definesubstitution oopsy.patch bpatcher @name oopsy.maxpat @args patch; +max objectfile oopsy.patch oopsy.patch; +max definesubstitution oopsy.field bpatcher @name oopsy.maxpat @args field; +max objectfile oopsy.field oopsy.field; +max definesubstitution oopsy.petal bpatcher @name oopsy.maxpat @args petal; +max objectfile oopsy.petal oopsy.petal; +max definesubstitution oopsy.pod bpatcher @name oopsy.maxpat @args pod; +max objectfile oopsy.pod oopsy.pod; +max definesubstitution oopsy.versio bpatcher @name oopsy.maxpat @args versio; +max objectfile oopsy.versio oopsy.versio; diff --git a/install.sh b/install.sh index 745c458..8505711 100755 --- a/install.sh +++ b/install.sh @@ -15,5 +15,5 @@ echo "rebuilding libdaisy" cd source cd libdaisy make clean | grep "warningr:\|error:" -make | grep "warning:r\|error:" +make -j4 | grep "warning:r\|error:" echo "done building libdaisy" diff --git a/javascript/oopsy.node4max.js b/javascript/oopsy.node4max.js index e36b390..63521b1 100644 --- a/javascript/oopsy.node4max.js +++ b/javascript/oopsy.node4max.js @@ -1,19 +1,40 @@ // Node4Max wrapper of the gen2daisy.node.js script -const path = require("path") -// fs = require("fs"), -// os = require("os"), -// assert = require("assert"); -// const {exec, spawn} = require("child_process"); - +const path = require("path"), + os = require("os") const maxAPI = require("max-api"); const run = require(path.join(__dirname, "..", "source", "oopsy.js")); -try { +let filter +if (os.platform() == "win32") { + filter = function(str) { + maxAPI.outlet(str) + } +} else { + filter = function(str) { + let match + if (match = label.match(/^Building/gm)) { + maxAPI.outlet(str) + } else { + maxAPI.outlet("--" + str) + } + } +} - // I'd like to filter the stdout/stderr streams here - // especially for the DFU upload stuff (no point showing errors that are not really errors!) +// duplicate stdout here so we can filter it and display more useful things in Max: +// dup stdout to our handler: +process.stdout.write = (function() { + const stdout_write = process.stdout.write; + return function(str) { + stdout_write.apply(process.stdout, arguments); + let match + if (match = str.match(/^oopsy (.*)/i)) { + maxAPI.outlet(match[1]) + } + } +})(); +try { run(...process.argv.slice(2)) } catch(e) { maxAPI.post(e.message ? e.message : e, maxAPI.POST_LEVELS.ERROR); diff --git a/javascript/oopsy.snoop.js b/javascript/oopsy.snoop.js index ff4cec8..5bde857 100644 --- a/javascript/oopsy.snoop.js +++ b/javascript/oopsy.snoop.js @@ -14,13 +14,13 @@ function bang() { function configure(doExport) { var pat = this.patcher.parentpatcher; if (!pat.filepath) { - error("patcher needs to be saved first\n"); + error("oopsy: your patcher needs to be saved first\n"); pat.message("write"); return false; } var export_path = extractFilepath(pat.filepath); - + var default_name = pat.name || "gen"; // send message out to convert this path // response will update the variable `path`: @@ -34,7 +34,7 @@ function configure(doExport) { var gen = pat.firstobject; while (gen) { if (gen.maxclass.toString() == "gen~") { - var name = "gen"; + var name = default_name; if (gen.getattr("exportname")) { name = gen.getattr("exportname").toString(); } else if (gen.getattr("title")) { diff --git a/patchers/oopsy.maxpat b/patchers/oopsy.maxpat index 1cc6948..6f896fe 100644 --- a/patchers/oopsy.maxpat +++ b/patchers/oopsy.maxpat @@ -4,15 +4,15 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 5, + "revision" : 8, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 477.0, 107.0, 674.0, 467.0 ], + "rect" : [ 608.0, 155.0, 806.0, 727.0 ], "bglocked" : 0, - "openinpresentation" : 0, + "openinpresentation" : 1, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", @@ -40,119 +40,494 @@ "assistshowspatchername" : 0, "boxes" : [ { "box" : { - "id" : "obj-4", + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 552.0, 594.0, 106.0, 22.0 ], + "text" : "route stdout stderr" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 222.0, 166.0, 58.0, 22.0 ], + "text" : "loadbang" + } + + } +, { + "box" : { + "id" : "obj-56", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 430.0, 16.0, 168.0, 33.0 ], - "text" : "bang (or save patcher) to trigger the oopsy workflow" + "patching_rect" : [ 516.0, 193.0, 150.0, 33.0 ], + "text" : "saving a patcher will also trigger compile" } } , { "box" : { - "id" : "obj-3", + "id" : "obj-55", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 521.0, 323.25, 150.0, 33.0 ], + "text" : "audio must be on for exportcode to work" + } + + } +, { + "box" : { + "id" : "obj-48", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "int" ], + "patching_rect" : [ 425.0, 323.25, 91.0, 22.0 ], + "text" : "adstatus switch" + } + + } +, { + "box" : { + "id" : "obj-45", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], - "patching_rect" : [ 367.0, 24.0, 61.0, 22.0 ], + "patching_rect" : [ 435.0, 193.0, 61.0, 22.0 ], "text" : "savebang" } } , { "box" : { - "id" : "obj-30", - "linecount" : 4, - "maxclass" : "comment", + "comment" : "", + "id" : "obj-43", + "index" : 0, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 222.0, 53.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "id" : "obj-41", + "maxclass" : "newobj", "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 23.0, 89.0, 67.0, 60.0 ], - "text" : "choose device target to compile for" + "numoutlets" : 2, + "outlettype" : [ "bang", "int" ], + "patching_rect" : [ 406.0, 291.0, 32.0, 22.0 ], + "text" : "t b 1" } } , { "box" : { - "id" : "obj-29", - "linecount" : 5, - "maxclass" : "comment", + "id" : "obj-38", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "bang", "" ], + "patching_rect" : [ 222.0, 90.0, 136.0, 22.0 ], + "text" : "sel bang" + } + + } +, { + "box" : { + "id" : "obj-37", + "maxclass" : "newobj", "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 40.5, 264.0, 224.0, 74.0 ], - "text" : "the node.js script is a thin wrapper around oopsy.js, which will generate the glue code between gen~ export and the Daisy APIs, compile it, and try to upload it to a device." + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 222.0, 235.0, 94.0, 22.0 ], + "text" : "prepend symbol" } } , { "box" : { - "id" : "obj-28", - "linecount" : 4, - "maxclass" : "comment", + "id" : "obj-21", + "linecount" : 3, + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "", "", "" ], + "patching_rect" : [ 339.0, 166.0, 64.0, 49.0 ], + "text" : "route target done" + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "newobj", "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 40.5, 199.500003099441528, 223.5, 60.0 ], - "text" : "oopsy.snoop will find all the gen~ objects in the parent patcher, configure them for export, trigger the export, then notify the node.js script" + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 222.0, 193.0, 72.0, 22.0 ], + "text" : "patcherargs" } } , { "box" : { - "id" : "obj-26", - "linecount" : 2, + "id" : "obj-11", + "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 457.0, 203.000003099441528, 114.0, 33.0 ], - "text" : "turn Max-style path into OS path" + "patching_rect" : [ 39.5, 65.0, 152.0, 47.0 ], + "text" : "bang will trigger compile,\nother messages route to patcherattrs parser first" } } , { "box" : { - "id" : "obj-25", + "id" : "obj-35", "maxclass" : "newobj", - "numinlets" : 2, + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 0.0, 0.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-23", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 50.0, 173.75, 40.0, 22.0 ], + "text" : "itoa" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "" ], + "patching_rect" : [ 50.0, 136.5, 35.0, 22.0 ], + "text" : "t 13 l" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 100.0, 71.0, 22.0 ], + "text" : "fromsymbol" + } + + } +, { + "box" : { + "id" : "obj-50", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 211.0, 96.0, 22.0 ], + "text" : "prepend append" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-33", + "index" : 1, + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 40.0, 30.0, 30.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-34", + "index" : 1, + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 50.0, 293.0, 30.0, 30.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-23", 0 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "source" : [ "obj-22", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-9", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 273.0, 538.0, 53.0, 22.0 ], + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p format" + } + + } +, { + "box" : { + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "clear" ], + "patching_rect" : [ 329.5, 538.0, 41.0, 22.0 ], + "text" : "t clear" + } + + } +, { + "box" : { + "id" : "obj-47", + "maxclass" : "textedit", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "", "int", "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 273.0, 573.0, 136.0, 75.0 ], + "presentation" : 1, + "presentation_rect" : [ 0.0, 32.0, 128.0, 92.0 ], + "readonly" : 1, + "separator" : "newline" + } + + } +, { + "box" : { + "id" : "obj-36", + "maxclass" : "live.menu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "float" ], + "parameter_enable" : 1, + "patching_rect" : [ 222.0, 269.0, 100.0, 15.0 ], + "presentation" : 1, + "presentation_rect" : [ 31.0, 0.0, 45.0, 15.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_enum" : [ "patch", "field", "petal", "pod" ], + "parameter_longname" : "live.menu[1]", + "parameter_mmax" : 3, + "parameter_shortname" : "live.menu", + "parameter_type" : 2 + } + + } +, + "varname" : "live.menu" + } + + } +, { + "box" : { + "automation" : "Off", + "automationon" : "On", + "id" : "obj-32", + "maxclass" : "live.text", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "parameter_enable" : 1, + "patching_rect" : [ 502.0, 533.191986000000043, 62.0, 16.0 ], + "presentation" : 1, + "presentation_rect" : [ 76.0, 0.0, 52.0, 15.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_enum" : [ "Off", "On" ], + "parameter_initial" : [ 0 ], + "parameter_linknames" : 1, + "parameter_longname" : "live.text[2]", + "parameter_mmax" : 1, + "parameter_shortname" : "FILTER", + "parameter_type" : 2 + } + + } +, + "text" : "DISCREET", + "texton" : "VERBOSE", + "varname" : "live.text[2]" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "bang", "" ], - "patching_rect" : [ 296.5, 89.0, 54.0, 22.0 ], - "text" : "sel bang" + "patching_rect" : [ 262.5, 291.0, 29.5, 22.0 ], + "text" : "t b l" } } , { "box" : { - "id" : "obj-24", + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 552.0, 562.0, 32.0, 22.0 ], + "text" : "gate" + } + + } +, { + "box" : { + "id" : "obj-30", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 39.5, 235.0, 150.0, 33.0 ], + "text" : "choose device target to compile for" + } + + } +, { + "box" : { + "id" : "obj-29", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 351.0, 89.0, 94.0, 74.0 ], - "text" : "audio must be on for the exportcode message to work" + "patching_rect" : [ 39.5, 466.0, 224.0, 74.0 ], + "text" : "the node.js script is a thin wrapper around oopsy.js, which will generate the glue code between gen~ export and the Daisy APIs, compile it, and try to upload it to a device." } } , { "box" : { - "id" : "obj-20", - "maxclass" : "ezdac~", - "numinlets" : 2, + "id" : "obj-28", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 296.5, 137.0, 31.0, 31.0 ] + "patching_rect" : [ 39.5, 376.000003099441528, 223.5, 60.0 ], + "text" : "oopsy.snoop will find all the gen~ objects in the parent patcher, configure them for export, trigger the export, then notify the node.js script" } } , { "box" : { - "id" : "obj-19", - "maxclass" : "newobj", + "id" : "obj-26", + "linecount" : 2, + "maxclass" : "comment", "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "int" ], - "patching_rect" : [ 296.5, 113.0, 22.0, 22.0 ], - "text" : "t 1" + "numoutlets" : 0, + "patching_rect" : [ 456.0, 376.000003099441528, 114.0, 33.0 ], + "text" : "turn Max-style path into OS path" } } @@ -163,7 +538,7 @@ "numinlets" : 2, "numoutlets" : 4, "outlettype" : [ "dictionary", "", "", "" ], - "patching_rect" : [ 340.0, 394.0, 50.5, 22.0 ], + "patching_rect" : [ 482.0, 594.0, 50.5, 22.0 ], "saved_object_attributes" : { "embed" : 0, "parameter_enable" : 0, @@ -173,17 +548,6 @@ "text" : "dict" } - } -, { - "box" : { - "id" : "obj-34", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 487.0, 357.0, 66.0, 22.0 ], - "text" : "print stderr" - } - } , { "box" : { @@ -191,8 +555,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 412.0, 357.0, 68.0, 22.0 ], - "text" : "print stdout" + "patching_rect" : [ 552.0, 626.0, 114.0, 22.0 ], + "text" : "print oopsy-verbose" } } @@ -203,7 +567,7 @@ "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "", "" ], - "patching_rect" : [ 340.0, 357.0, 65.0, 22.0 ], + "patching_rect" : [ 482.0, 562.0, 65.0, 22.0 ], "text" : "route error" } @@ -212,11 +576,11 @@ "box" : { "id" : "obj-42", "maxclass" : "newobj", - "numinlets" : 6, - "numoutlets" : 6, - "outlettype" : [ "", "", "", "", "", "" ], - "patching_rect" : [ 340.0, 310.0, 219.0, 22.0 ], - "text" : "route terminated stdout stderr stop start" + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 482.0, 501.0, 102.0, 22.0 ], + "text" : "route terminated" } } @@ -228,9 +592,9 @@ "numoutlets" : 1, "outlettype" : [ "bang" ], "parameter_enable" : 0, - "patching_rect" : [ 333.0, 16.0, 30.0, 30.0 ], + "patching_rect" : [ 406.0, 235.0, 30.0, 30.0 ], "presentation" : 1, - "presentation_rect" : [ 333.0, 16.0, 30.0, 30.0 ] + "presentation_rect" : [ 0.0, 0.0, 30.0, 30.0 ] } } @@ -243,10 +607,12 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "" ], - "patching_rect" : [ 274.0, 264.0, 228.0, 26.0 ], + "patching_rect" : [ 273.0, 466.0, 228.0, 26.0 ], "saved_object_attributes" : { "autostart" : 0, "defer" : 0, + "node_bin_path" : "", + "npm_bin_path" : "", "watch" : 0 } , @@ -261,61 +627,10 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 274.0, 235.0, 111.0, 22.0 ], + "patching_rect" : [ 273.0, 408.0, 111.0, 22.0 ], "text" : "prepend script start" } - } -, { - "box" : { - "id" : "obj-18", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 1, - "outlettype" : [ "" ], - "patching_rect" : [ 93.5, 89.0, 72.0, 22.0 ], - "text" : "prepend set" - } - - } -, { - "box" : { - "id" : "obj-17", - "maxclass" : "newobj", - "numinlets" : 3, - "numoutlets" : 3, - "outlettype" : [ "", "", "" ], - "patching_rect" : [ 93.5, 59.0, 199.0, 22.0 ], - "text" : "route target done" - } - - } -, { - "box" : { - "id" : "obj-16", - "maxclass" : "newobj", - "numinlets" : 1, - "numoutlets" : 2, - "outlettype" : [ "", "" ], - "patching_rect" : [ 40.5, 24.0, 72.0, 22.0 ], - "text" : "patcherargs" - } - - } -, { - "box" : { - "id" : "obj-15", - "items" : [ "patch", ",", "field", ",", "petal", ",", "pod" ], - "maxclass" : "umenu", - "numinlets" : 1, - "numoutlets" : 3, - "outlettype" : [ "int", "", "" ], - "parameter_enable" : 0, - "patching_rect" : [ 93.5, 118.0, 100.0, 22.0 ], - "presentation" : 1, - "presentation_rect" : [ 93.5, 118.0, 100.0, 22.0 ] - } - } , { "box" : { @@ -324,7 +639,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 134.0, 147.000003099441528, 130.0, 22.0 ], + "patching_rect" : [ 273.0, 323.25, 130.0, 22.0 ], "text" : "prepend setprop target" } @@ -341,7 +656,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 5, + "revision" : 8, "architecture" : "x64", "modernui" : 1 } @@ -469,7 +784,7 @@ ] } , - "patching_rect" : [ 398.0, 203.000003099441528, 54.0, 22.0 ], + "patching_rect" : [ 397.0, 376.000003099441528, 54.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -480,19 +795,6 @@ "text" : "p fixpath" } - } -, { - "box" : { - "comment" : "", - "id" : "obj-1", - "index" : 1, - "maxclass" : "inlet", - "numinlets" : 0, - "numoutlets" : 1, - "outlettype" : [ "bang" ], - "patching_rect" : [ 117.5, 16.0, 30.0, 30.0 ] - } - } , { "box" : { @@ -503,9 +805,9 @@ "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "", "" ], - "patching_rect" : [ 274.0, 203.000003099441528, 114.0, 26.0 ], + "patching_rect" : [ 273.0, 376.000003099441528, 114.0, 26.0 ], "saved_object_attributes" : { - "filename" : "oopsy.snoop.js", + "filename" : "oopsy.snoop", "parameter_enable" : 0 } , @@ -516,7 +818,7 @@ ], "lines" : [ { "patchline" : { - "destination" : [ "obj-17", 0 ], + "destination" : [ "obj-15", 0 ], "source" : [ "obj-1", 0 ] } @@ -527,113 +829,198 @@ "source" : [ "obj-12", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-13", 0 ] + } + } , { "patchline" : { "destination" : [ "obj-5", 0 ], + "midpoints" : [ 282.5, 363.750001549720764, 282.5, 363.750001549720764 ], "source" : [ "obj-14", 0 ] } } , { "patchline" : { - "destination" : [ "obj-14", 0 ], + "destination" : [ "obj-21", 0 ], "source" : [ "obj-15", 1 ] } } , { "patchline" : { - "destination" : [ "obj-17", 0 ], - "source" : [ "obj-16", 1 ] + "destination" : [ "obj-37", 0 ], + "source" : [ "obj-15", 0 ] } } , { "patchline" : { - "destination" : [ "obj-18", 0 ], - "source" : [ "obj-17", 0 ] + "destination" : [ "obj-13", 1 ], + "order" : 0, + "source" : [ "obj-2", 0 ] } } , { "patchline" : { - "destination" : [ "obj-25", 0 ], - "order" : 0, - "source" : [ "obj-17", 2 ] + "destination" : [ "obj-35", 0 ], + "order" : 1, + "source" : [ "obj-2", 0 ] } } , { "patchline" : { - "destination" : [ "obj-5", 0 ], - "order" : 1, - "source" : [ "obj-17", 2 ] + "destination" : [ "obj-42", 0 ], + "source" : [ "obj-2", 1 ] } } , { "patchline" : { - "destination" : [ "obj-15", 0 ], - "source" : [ "obj-18", 0 ] + "destination" : [ "obj-37", 0 ], + "midpoints" : [ 348.5, 227.5, 231.5, 227.5 ], + "source" : [ "obj-21", 0 ] } } , { "patchline" : { - "destination" : [ "obj-20", 0 ], - "source" : [ "obj-19", 0 ] + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-21", 1 ] } } , { "patchline" : { - "destination" : [ "obj-42", 0 ], - "source" : [ "obj-2", 1 ] + "destination" : [ "obj-49", 0 ], + "source" : [ "obj-3", 2 ] } } , { "patchline" : { - "destination" : [ "obj-19", 0 ], - "source" : [ "obj-25", 0 ] + "destination" : [ "obj-49", 0 ], + "source" : [ "obj-3", 1 ] } } , { "patchline" : { - "destination" : [ "obj-17", 0 ], + "destination" : [ "obj-49", 0 ], "source" : [ "obj-3", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "source" : [ "obj-35", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "source" : [ "obj-36", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-36", 0 ], + "source" : [ "obj-37", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "source" : [ "obj-38", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "midpoints" : [ 231.5, 131.0, 415.5, 131.0 ], + "source" : [ "obj-38", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "order" : 0, + "source" : [ "obj-40", 0 ] + } + } , { "patchline" : { "destination" : [ "obj-2", 0 ], + "order" : 2, "source" : [ "obj-40", 0 ] } } , { "patchline" : { - "destination" : [ "obj-44", 0 ], - "source" : [ "obj-42", 0 ] + "destination" : [ "obj-51", 0 ], + "midpoints" : [ 282.5, 447.5, 339.0, 447.5 ], + "order" : 1, + "source" : [ "obj-40", 0 ] } } , { "patchline" : { - "destination" : [ "obj-49", 0 ], - "source" : [ "obj-42", 2 ] + "destination" : [ "obj-48", 0 ], + "source" : [ "obj-41", 1 ] } } , { "patchline" : { - "destination" : [ "obj-49", 0 ], + "destination" : [ "obj-5", 0 ], + "midpoints" : [ 415.5, 358.500001549720764, 282.5, 358.500001549720764 ], + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], "source" : [ "obj-42", 1 ] } + } +, { + "patchline" : { + "destination" : [ "obj-44", 0 ], + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "source" : [ "obj-43", 0 ] + } + } , { "patchline" : { @@ -641,6 +1028,13 @@ "source" : [ "obj-44", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-45", 0 ] + } + } , { "patchline" : { @@ -658,12 +1052,52 @@ } , { "patchline" : { - "destination" : [ "obj-17", 0 ], + "destination" : [ "obj-47", 0 ], + "source" : [ "obj-51", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "source" : [ "obj-6", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 0 ], "source" : [ "obj-7", 0 ] } } - ] + ], + "parameters" : { + "obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-36" : [ "live.menu[1]", "live.menu", 0 ], + "parameterbanks" : { + + } +, + "inherited_shortname" : 1 + } +, + "dependency_cache" : [ { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } + ], + "autosave" : 0 } } diff --git a/source/daisy.field.json b/source/daisy.field.json index e566a0d..de2492e 100644 --- a/source/daisy.field.json +++ b/source/daisy.field.json @@ -1,5 +1,138 @@ { - "audio_ins": [ + "max_apps":8, + "defines": { + "OOPSY_TARGET_FIELD": 1 + }, + "labels": { + "params": { + "knob1": "dsy_knob1", + "knob2": "dsy_knob2", + "knob3": "dsy_knob3", + "knob4": "dsy_knob4", + "knob5": "dsy_knob5", + "knob6": "dsy_knob6", + "knob7": "dsy_knob7", + "knob8": "dsy_knob8", + "keyA1": "dsy_key9", + "keyA2": "dsy_key10", + "keyA3": "dsy_key11", + "keyA4": "dsy_key12", + "keyA5": "dsy_key13", + "keyA6": "dsy_key14", + "keyA7": "dsy_key15", + "keyA8": "dsy_key16", + "keyB1": "dsy_key1", + "keyB2": "dsy_key2", + "keyB3": "dsy_key3", + "keyB4": "dsy_key4", + "keyB5": "dsy_key5", + "keyB6": "dsy_key6", + "keyB7": "dsy_key7", + "keyB8": "dsy_key8", + "sw1": "dsy_switch1", + "sw2": "dsy_switch2", + "cv1": "dsy_cv_in1", + "cv2": "dsy_cv_in2", + "cv3": "dsy_cv_in3", + "cv4": "dsy_cv_in4", + "gate1": "dsy_gate_in1", + + "key1": "dsy_key1", + "key2": "dsy_key2", + "key3": "dsy_key3", + "key4": "dsy_key4", + "key5": "dsy_key5", + "key6": "dsy_key6", + "key7": "dsy_key7", + "key8": "dsy_key8", + "key9": "dsy_key9", + "key10": "dsy_key10", + "key11": "dsy_key11", + "key12": "dsy_key12", + "key13": "dsy_key13", + "key14": "dsy_key14", + "key15": "dsy_key15", + "key16": "dsy_key16", + "ctrl1": "dsy_knob1", + "ctrl2": "dsy_knob2", + "ctrl3": "dsy_knob3", + "ctrl4": "dsy_knob4", + "ctrl5": "dsy_knob5", + "ctrl6": "dsy_knob6", + "ctrl7": "dsy_knob7", + "ctrl8": "dsy_knob8", + "switch1": "dsy_switch1", + "switch2": "dsy_switch2", + + "knob": "dsy_knob1", + "key": "dsy_key1", + "ctrl": "dsy_knob1", + "cv": "dsy_cv_in1", + "gate": "dsy_gate_in1", + "switch": "dsy_switch1" + }, + "outs": { + "cv": "dsy_cv_out1", + "cv1": "dsy_cv_out1", + "cv2": "dsy_cv_out2", + "gate": "dsy_gate_out1", + "gate1": "dsy_gate_out1" + }, + "datas": { + "leds": "dsy_leds" + } + }, + "inputs": { + "dsy_knob1": "hardware.GetKnobValue(hardware.KNOB_1)", + "dsy_knob2": "hardware.GetKnobValue(hardware.KNOB_2)", + "dsy_knob3": "hardware.GetKnobValue(hardware.KNOB_3)", + "dsy_knob4": "hardware.GetKnobValue(hardware.KNOB_4)", + "dsy_knob5": "hardware.GetKnobValue(hardware.KNOB_5)", + "dsy_knob6": "hardware.GetKnobValue(hardware.KNOB_6)", + "dsy_knob7": "hardware.GetKnobValue(hardware.KNOB_7)", + "dsy_knob8": "hardware.GetKnobValue(hardware.KNOB_8)", + "dsy_key1": "(hardware.KeyboardState(0)?1.f:0.f)", + "dsy_key2": "(hardware.KeyboardState(1)?1.f:0.f)", + "dsy_key3": "(hardware.KeyboardState(2)?1.f:0.f)", + "dsy_key4": "(hardware.KeyboardState(3)?1.f:0.f)", + "dsy_key5": "(hardware.KeyboardState(4)?1.f:0.f)", + "dsy_key6": "(hardware.KeyboardState(5)?1.f:0.f)", + "dsy_key7": "(hardware.KeyboardState(6)?1.f:0.f)", + "dsy_key8": "(hardware.KeyboardState(7)?1.f:0.f)", + "dsy_key9": "(hardware.KeyboardState(8)?1.f:0.f)", + "dsy_key10": "(hardware.KeyboardState(9)?1.f:0.f)", + "dsy_key11": "(hardware.KeyboardState(10)?1.f:0.f)", + "dsy_key12": "(hardware.KeyboardState(11)?1.f:0.f)", + "dsy_key13": "(hardware.KeyboardState(12)?1.f:0.f)", + "dsy_key14": "(hardware.KeyboardState(13)?1.f:0.f)", + "dsy_key15": "(hardware.KeyboardState(14)?1.f:0.f)", + "dsy_key16": "(hardware.KeyboardState(15)?1.f:0.f)", + "dsy_switch1": "(hardware.GetSwitch(0)->Pressed()?1.f:0.f)", + "dsy_switch2": "(hardware.GetSwitch(1)->Pressed()?1.f:0.f)", + "dsy_cv_in1": "hardware.GetCvValue(0)", + "dsy_cv_in2": "hardware.GetCvValue(1)", + "dsy_cv_in3": "hardware.GetCvValue(2)", + "dsy_cv_in4": "hardware.GetCvValue(3)", + "dsy_gate_in1": "(hardware.gate_in_.State()?1.f:0.f)" + }, + "outputs": { + "dsy_cv_out1": { + "where":"main", + "setter": "dsy_dac_write(DSY_DAC_CHN1, $ * 4095)" + }, + "dsy_cv_out2": { + "where":"main", + "setter": "dsy_dac_write(DSY_DAC_CHN2, $ * 4095)" + }, + "dsy_gate_out1": { + "where":"audio", + "setter": "dsy_gpio_write(&hardware.gate_out_, $ > 0.f)" + } + }, + "mainhandlers": { + "dsy_leds": "daisy.setFieldLedsFromData($)" + }, + "audio_ins": [ "dsy_in1", "dsy_in2" ], @@ -13,79 +146,5 @@ "midi_outs": [ "dsy_midi_out1" ], - "cv_ins": [ - "cv_in1", - "cv_in2", - "cv_in3", - "cv_in4" - ], - "cv_outs": [ - "cv_out1", - "cv_out2" - ], - "knobs": [ - "knob1", - "knob2", - "knob3", - "knob4", - "knob5", - "knob6", - "knob7", - "knob8" - ], - "gate_ins": [ - "gate_in1" - ], - "gate_outs": [ - "gate_out1" - ], - "leds": [ - "led1", - "led2", - "led3", - "led4", - "led5", - "led6", - "led7", - "led8", - "ledA1", - "ledA2", - "ledA3", - "ledA4", - "ledA5", - "ledA6", - "ledA7", - "ledA8", - "ledB1", - "ledB2", - "ledB3", - "ledB4", - "ledB5", - "ledB6", - "ledB7", - "ledB8" - ], - "switches": [ - "switch1", - "switch2" - ], - "keys": [ - "key1", - "key2", - "key3", - "key4", - "key5", - "key6", - "key7", - "key8", - "key9", - "key10", - "key11", - "key12", - "key13", - "key14", - "key15", - "key16" - ], "oled": true } \ No newline at end of file diff --git a/source/daisy.patch.json b/source/daisy.patch.json index 4413663..f5b23d2 100644 --- a/source/daisy.patch.json +++ b/source/daisy.patch.json @@ -1,4 +1,59 @@ { + "max_apps":8, + "defines": { + "OOPSY_TARGET_PATCH": 1 + }, + "labels": { + "params": { + "cv1": "dsy_cv_in1", + "cv2": "dsy_cv_in2", + "cv3": "dsy_cv_in3", + "cv4": "dsy_cv_in4", + "gate1": "dsy_gate_in1", + "gate2": "dsy_gate_in2", + + "cv": "dsy_cv_in1", + "ctrl": "dsy_cv_in1", + "ctrl1": "dsy_cv_in1", + "ctrl2": "dsy_cv_in2", + "ctrl3": "dsy_cv_in3", + "ctrl4": "dsy_cv_in4", + "gate": "dsy_gate_in1" + }, + "outs": { + "cv1": "dsy_cv_out1", + "cv2": "dsy_cv_out2", + "gate1": "dsy_gate_out1", + + "cv": "dsy_cv_out1", + "gate": "dsy_gate_out1" + + }, + "datas": {} + }, + "inputs": { + "dsy_cv_in1": "hardware.GetCtrlValue(hardware.CTRL_1)", + "dsy_cv_in2": "hardware.GetCtrlValue(hardware.CTRL_2)", + "dsy_cv_in3": "hardware.GetCtrlValue(hardware.CTRL_3)", + "dsy_cv_in4": "hardware.GetCtrlValue(hardware.CTRL_4)", + "dsy_gate_in1": "(hardware.gate_input[hardware.GATE_IN_1].State()?1.f:0.f)", + "dsy_gate_in2": "(hardware.gate_input[hardware.GATE_IN_2].State()?1.f:0.f)" + }, + "outputs": { + "dsy_cv_out1": { + "where": "main", + "setter": "dsy_dac_write(DSY_DAC_CHN1, $ * 4095)" + }, + "dsy_cv_out2": { + "where": "main", + "setter": "dsy_dac_write(DSY_DAC_CHN2, $ * 4095)" + }, + "dsy_gate_out1": { + "where": "audio", + "setter": "dsy_gpio_write(&hardware.gate_output, $ > 0.f)" + } + }, + "mainhandlers": {}, "audio_ins": [ "dsy_in1", "dsy_in2", @@ -17,25 +72,5 @@ "midi_outs": [ "dsy_midi_out1" ], - "cv_ins": [ - "cv_in1", - "cv_in2", - "cv_in3", - "cv_in4" - ], - "cv_outs": [ - "cv_out1", - "cv_out2" - ], - "gate_ins": [ - "gate_in1", - "gate_in2" - ], - "gate_outs": [ - "gate_out1" - ], - "encoder": [ - "encoder1" - ], "oled": true } \ No newline at end of file diff --git a/source/daisy.petal.json b/source/daisy.petal.json index b20670c..1da51fa 100644 --- a/source/daisy.petal.json +++ b/source/daisy.petal.json @@ -1,5 +1,89 @@ { - "audio_ins": [ + "max_apps":8, + "defines": { + "OOPSY_TARGET_PETAL": 1 + }, + "labels": { + "params": { + "knob1": "dsy_knob1", + "knob2": "dsy_knob2", + "knob3": "dsy_knob3", + "knob4": "dsy_knob4", + "knob5": "dsy_knob5", + "knob6": "dsy_knob6", + "sw1": "dsy_switch1", + "sw2": "dsy_switch2", + "sw3": "dsy_switch3", + "sw4": "dsy_switch4", + "sw5": "dsy_switch5", + "sw6": "dsy_switch6", + "sw7": "dsy_switch7", + "exp1": "dsy_exp1", + + "ctrl1": "dsy_knob1", + "ctrl2": "dsy_knob2", + "ctrl3": "dsy_knob3", + "ctrl4": "dsy_knob4", + "ctrl5": "dsy_knob5", + "ctrl6": "dsy_knob6", + "switch1": "dsy_switch1", + "switch2": "dsy_switch2", + "switch3": "dsy_switch3", + "switch4": "dsy_switch4", + "switch5": "dsy_switch5", + "switch6": "dsy_switch6", + "switch7": "dsy_switch7", + "knob": "dsy_knob1", + "ctrl": "dsy_knob1", + "switch": "dsy_switch1", + "exp": "dsy_exp1", + "expression": "dsy_exp1" + }, + "outs": { + "led1": "dsy_footswitch_led1", + "led2": "dsy_footswitch_led2", + "led3": "dsy_footswitch_led3", + "led4": "dsy_footswitch_led4" + }, + "datas": {} + }, + "inputs": { + "dsy_knob1": "hardware.GetKnobValue(hardware.KNOB_1)", + "dsy_knob2": "hardware.GetKnobValue(hardware.KNOB_2)", + "dsy_knob3": "hardware.GetKnobValue(hardware.KNOB_3)", + "dsy_knob4": "hardware.GetKnobValue(hardware.KNOB_4)", + "dsy_knob5": "hardware.GetKnobValue(hardware.KNOB_5)", + "dsy_knob6": "hardware.GetKnobValue(hardware.KNOB_6)", + "dsy_switch1": "(hardware.switches[0].Pressed()?1.f:0.f)", + "dsy_switch2": "(hardware.switches[1].Pressed()?1.f:0.f)", + "dsy_switch3": "(hardware.switches[2].Pressed()?1.f:0.f)", + "dsy_switch4": "(hardware.switches[3].Pressed()?1.f:0.f)", + "dsy_switch5": "(hardware.switches[4].Pressed()?1.f:0.f)", + "dsy_switch6": "(hardware.switches[5].Pressed()?1.f:0.f)", + "dsy_switch7": "(hardware.switches[6].Pressed()?1.f:0.f)", + "dsy_exp1": "(hardware.GetExpression())" + }, + "outputs": { + "dsy_footswitch_led1": { + "where": "display", + "setter": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_1, $)" + }, + "dsy_footswitch_led2": { + "where": "display", + "setter": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_2, $)" + }, + "dsy_footswitch_led3": { + "where": "display", + "setter": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_3, $)" + }, + "dsy_footswitch_led4": { + "where": "display", + "setter": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_4, $)" + } + }, + "mainhandlers": { + }, + "audio_ins": [ "dsy_in1", "dsy_in2" ], @@ -8,42 +92,5 @@ "dsy_out2" ], "midi_ins": [], - "midi_outs": [], - "cv_ins": [], - "cv_outs": [], - "gate_ins": [], - "gate_outs": [], - "knobs": [ - "knob1", - "knob2", - "knob3", - "knob4", - "knob5", - "knob6" - ], - "switches": [ - "switch1", - "switch2", - "switch3", - "switch4", - "switch5", - "switch6", - "switch7" - ], - "expression": [ - "exp1" - ], - "encoder": [ - "encoder1" - ], - "leds": [ - "led1", - "led2", - "led3", - "led4", - "led5", - "led6", - "led7", - "led8" - ] + "midi_outs": [] } \ No newline at end of file diff --git a/source/daisy.pod.json b/source/daisy.pod.json index f2ae002..fa258cf 100644 --- a/source/daisy.pod.json +++ b/source/daisy.pod.json @@ -1,5 +1,55 @@ { - "audio_ins": [ + "max_apps":1, + "defines": { + "OOPSY_TARGET_POD": 1 + }, + "labels": { + "params": { + "knob1": "dsy_knob1", + "knob2": "dsy_knob2", + "sw1": "dsy_switch1", + "sw2": "dsy_switch2", + "sw3": "dsy_encoder_switch", + "encoder": "dsy_encoder_incr", + + "ctrl1": "dsy_knob1", + "ctrl2": "dsy_knob2", + "switch1": "dsy_switch1", + "switch2": "dsy_switch2", + "switch3": "dsy_encoder_switch", + "knob": "dsy_knob1", + "ctrl": "dsy_knob1", + "switch": "dsy_switch1", + "press": "dsy_encoder_switch" + }, + "outs": { + "led1": "dsy_led1", + "led2": "dsy_led2", + + "led": "dsy_led1" + }, + "datas": {} + }, + "inputs": { + "dsy_knob1": "hardware.GetKnobValue(hardware.KNOB_1)", + "dsy_knob2": "hardware.GetKnobValue(hardware.KNOB_2)", + "dsy_switch1": "(hardware.button1.Pressed()?1.f:0.f)", + "dsy_switch2": "(hardware.button2.Pressed()?1.f:0.f)", + "dsy_encoder_incr": "(hardware.encoder.Increment())", + "dsy_encoder_switch": "(hardware.encoder.Pressed())" + }, + "outputs": { + "dsy_led1": { + "where": "audio", + "setter": "hardware.led1.Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f)" + }, + "dsy_led2": { + "where": "audio", + "setter": "hardware.led2.Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f)" + } + }, + "mainhandlers": {}, + "audio_ins": [ "dsy_in1", "dsy_in2" ], @@ -10,24 +60,5 @@ "midi_ins": [ "dsy_midi_in1" ], - "midi_outs": [], - "switches": [ - "switch1", - "switch2" - ], - "cv_ins": [], - "cv_outs": [], - "gate_ins": [], - "gate_outs": [], - "knobs": [ - "knob1", - "knob2" - ], - "encoder": [ - "encoder1" - ], - "leds": [ - "led1", - "led2" - ] + "midi_outs": [] } \ No newline at end of file diff --git a/source/daisy.versio.json b/source/daisy.versio.json new file mode 100644 index 0000000..bfa5673 --- /dev/null +++ b/source/daisy.versio.json @@ -0,0 +1,81 @@ +{ + "max_apps":1, + "defines": { + "OOPSY_TARGET_VERSIO": 1 + }, + "labels": { + "params": { + "knob1": "dsy_knob1", + "knob2": "dsy_knob2", + "knob3": "dsy_knob3", + "knob4": "dsy_knob4", + "knob5": "dsy_knob5", + "knob6": "dsy_knob6", + "knob7": "dsy_knob7", + "button1": "dsy_button1", + "sw1": "dsy_switch1", + "sw2": "dsy_switch2", + "gate1": "dsy_gate_in1", + + "cv1": "dsy_knob1", + "cv2": "dsy_knob2", + "cv3": "dsy_knob3", + "cv4": "dsy_knob4", + "cv5": "dsy_knob5", + "cv6": "dsy_knob6", + "cv7": "dsy_knob7", + "ctrl1": "dsy_knob1", + "ctrl2": "dsy_knob2", + "ctrl3": "dsy_knob3", + "ctrl4": "dsy_knob4", + "ctrl5": "dsy_knob5", + "ctrl6": "dsy_knob6", + "ctrl7": "dsy_knob7", + "switch1": "dsy_switch1", + "switch2": "dsy_switch2", + + "knob": "dsy_knob1", + "button": "dsy_button1", + "ctrl": "dsy_knob1", + "cv": "dsy_knob1", + "switch": "dsy_switch1", + "gate": "dsy_gate_in1", + + + "tap": "dsy_button1", + "fsu": "dsy_button1", + "abc": "dsy_switch1", + "xyz": "dsy_switch2" + + }, + "outs": { + + }, + "datas": {} + }, + "inputs": { + "dsy_knob1": "hardware.GetKnobValue(hardware.KNOB_0)", + "dsy_knob2": "hardware.GetKnobValue(hardware.KNOB_1)", + "dsy_knob3": "hardware.GetKnobValue(hardware.KNOB_2)", + "dsy_knob4": "hardware.GetKnobValue(hardware.KNOB_3)", + "dsy_knob5": "hardware.GetKnobValue(hardware.KNOB_4)", + "dsy_knob6": "hardware.GetKnobValue(hardware.KNOB_5)", + "dsy_knob7": "hardware.GetKnobValue(hardware.KNOB_6)", + "dsy_switch1": "(hardware.sw_[0].Read())", + "dsy_switch1": "(hardware.sw_[1].Read())", + "dsy_button1": "(hardware.SwitchPressed()?1.f:0.f)", + "dsy_gate_in1": "(hardware.Gate()?1.f:0.f)" + }, + "outputs": {}, + "mainhandlers": {}, + "audio_ins": [ + "dsy_in1", + "dsy_in2" + ], + "audio_outs": [ + "dsy_out1", + "dsy_out2" + ], + "midi_ins": [], + "midi_outs": [] +} \ No newline at end of file diff --git a/source/gen_dsp/genlib_exportfunctions.h b/source/gen_dsp/genlib_exportfunctions.h index 9ef7b66..5647e8c 100644 --- a/source/gen_dsp/genlib_exportfunctions.h +++ b/source/gen_dsp/genlib_exportfunctions.h @@ -34,7 +34,7 @@ void genlib_sysmem_copyptr(const void *src, void *dst, t_ptr_size bytes); void genlib_report_error(const char *s); void genlib_report_message(const char *s); void genlib_set_zero64(t_sample *mem, long size); - +unsigned long genlib_ticks(); void genlib_init(); void genlib_info(); diff --git a/source/gen_dsp/genlib_ops.h b/source/gen_dsp/genlib_ops.h index 79fb796..0b67db7 100644 --- a/source/gen_dsp/genlib_ops.h +++ b/source/gen_dsp/genlib_ops.h @@ -24,6 +24,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef GENLIB_OPS_H #define GENLIB_OPS_H 1 +#include "genlib_exportfunctions.h" + #ifndef MSP_ON_CLANG # include #endif @@ -95,6 +97,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #define GENLIB_QUANT(f1,f2) t_sample(floor((f1)*(f2)+0.5)/(f2)) + inline t_sample genlib_isnan(t_sample v) { return GENLIB_IS_NAN(v); } inline t_sample fixnan(t_sample v) { return GENLIB_FIX_NAN(v); } inline t_sample fixdenorm(t_sample v) { return GENLIB_FIX_DENORM(v); } diff --git a/source/genlib_daisy.h b/source/genlib_daisy.h index 29f1e1d..f110332 100644 --- a/source/genlib_daisy.h +++ b/source/genlib_daisy.h @@ -3,71 +3,71 @@ #include "daisy.h" #include "genlib.h" +#include "genlib_ops.h" #include "genlib_exportfunctions.h" #include #include #include // memset #include // vprintf +#if defined(OOPSY_TARGET_PATCH) + #include "daisy_patch.h" + #define OOPSY_IO_COUNT (4) + typedef daisy::DaisyPatch Daisy; -#if defined(GEN_DAISY_TARGET_PATCH) -#include "daisy_patch.h" -#define GEN_DAISY_TARGET_HAS_OLED 1 -#define GEN_DAISY_IO_COUNT (4) -typedef daisy::DaisyPatch Daisy; +#elif defined(OOPSY_TARGET_FIELD) + #include "daisy_field.h" + #define OOPSY_IO_COUNT (2) + typedef daisy::DaisyField Daisy; -#elif defined(GEN_DAISY_TARGET_FIELD) -#include "daisy_field.h" -#define GEN_DAISY_TARGET_HAS_OLED 1 -#define GEN_DAISY_IO_COUNT (2) -typedef daisy::DaisyField Daisy; +#elif defined(OOPSY_TARGET_PETAL) + #include "daisy_petal.h" + #define OOPSY_IO_COUNT (2) + typedef daisy::DaisyPetal Daisy; -#elif defined(GEN_DAISY_TARGET_PETAL) -#include "daisy_petal.h" -#define GEN_DAISY_IO_COUNT (2) -typedef daisy::DaisyPetal Daisy; +#elif defined(OOPSY_TARGET_POD) + #include "daisy_pod.h" + #define OOPSY_IO_COUNT (2) + typedef daisy::DaisyPod Daisy; -#elif defined(GEN_DAISY_TARGET_POD) -#include "daisy_pod.h" -#define GEN_DAISY_IO_COUNT (2) -typedef daisy::DaisyPod Daisy; +#elif defined(OOPSY_TARGET_VERSIO) + #include "daisy_versio.h" + #define OOPSY_IO_COUNT (2) + typedef daisy::DaisyVersio Daisy; #else -#include "daisy_seed.h" -#define GEN_DAISY_IO_COUNT (2) -typedef daisy::DaisySeed Daisy; + #include "daisy_seed.h" + #define OOPSY_IO_COUNT (2) + typedef daisy::DaisySeed Daisy; #endif - ////////////////////////// DAISY EXPORT INTERFACING ////////////////////////// -#define GEN_DAISY_BUFFER_SIZE 48 -#define GEN_DAISY_MIDI_BUFFER_SIZE 64 -#define GEN_DAISY_LONG_PRESS_MS 250 -#define GEN_DAISY_DISPLAY_PERIOD_MS 20 -static const uint32_t GEN_DAISY_SRAM_SIZE = 512 * 1024; -static const uint32_t GEN_DAISY_SDRAM_SIZE = 64 * 1024 * 1024; - +#define OOPSY_BUFFER_SIZE 48 +#define OOPSY_MIDI_BUFFER_SIZE 64 +#define OOPSY_LONG_PRESS_MS 250 +#define OOPSY_DISPLAY_PERIOD_MS 10 +#define OOPSY_SCOPE_MAX_ZOOM (9) +static const uint32_t OOPSY_SRAM_SIZE = 512 * 1024; +static const uint32_t OOPSY_SDRAM_SIZE = 64 * 1024 * 1024; -namespace gendaisylib { - - char * sram_pool = nullptr; - char DSY_SDRAM_BSS sdram_pool[GEN_DAISY_SDRAM_SIZE]; +namespace oopsy { uint32_t sram_used = 0, sram_usable = 0; uint32_t sdram_used = 0, sdram_usable = 0; + char * sram_pool = nullptr; + char DSY_SDRAM_BSS sdram_pool[OOPSY_SDRAM_SIZE]; void init() { - if (!sram_pool) sram_pool = (char *)malloc(GEN_DAISY_SRAM_SIZE); - sram_usable = GEN_DAISY_SRAM_SIZE; + if (!sram_pool) sram_pool = (char *)malloc(OOPSY_SRAM_SIZE); + sram_usable = OOPSY_SRAM_SIZE; sram_used = 0; - sdram_usable = GEN_DAISY_SDRAM_SIZE; + sdram_usable = OOPSY_SDRAM_SIZE; sdram_used = 0; } void * allocate(uint32_t size) { - //console.log("alloc %d/%d", size, sram_usable); if (size < sram_usable) { void * p = sram_pool + sram_used; sram_used += size; @@ -85,8 +85,7 @@ namespace gendaisylib { void memset(void *p, int c, long size) { char *p2 = (char *)p; int i; - for (i = 0; i < size; i++, p2++) - *p2 = char(c); + for (i = 0; i < size; i++, p2++) *p2 = char(c); } // void genlib_memcpy(void *dst, const void *src, long size) { @@ -107,529 +106,636 @@ namespace gendaisylib { // void * m = malloc(sz * 1024); // if (!m) break; // free(m); - // console.log("%d: malloced %dk", i, sz); + // log("%d: malloced %dk", i, sz); // i++; // } - // console.log("all OK"); + // log("all OK"); // } -}; - - -struct Timer { - int32_t period = GEN_DAISY_DISPLAY_PERIOD_MS, t=0; - - bool ready(int32_t dt) { - t += dt; - if (t > period) { - t = 0; - return true; - } - return false; - } -}; + struct Timer { + int32_t period = OOPSY_DISPLAY_PERIOD_MS, + t = OOPSY_DISPLAY_PERIOD_MS; -struct MidiUart { - daisy::UartHandler uart; - uint8_t in_written = 0, out_written = 0; - uint8_t in_active = 0, out_active = 0; - uint8_t out_data[GEN_DAISY_MIDI_BUFFER_SIZE]; - float in_data[GEN_DAISY_BUFFER_SIZE]; - - void init() { - uart.Init(); - uart.StartRx(); - } - - void preperform(size_t size) { - // fill remainder of midi buffer with non-data: - for (size_t i=in_written; i= 0.f) { - // scale (0.0, 1.0) back to (0, 255) for MIDI bytes - out_data[out_written++] = buf[i] * 256.0f; - out_active = 1; - } - } - } - - void mainloop() { - // input: - while(uart.Readable()) { - uint8_t byte = uart.PopRx(); - if (in_written < GEN_DAISY_BUFFER_SIZE) { - // scale (0, 255) to (0.0, 1.0) - // to protect hardware from accidental patching - in_data[in_written] = byte / 256.0f; - in_written++; + bool ready(int32_t dt) { + t += dt; + if (t > period) { + t = 0; + return true; } - in_active = 1; - } - // output: - if (out_written) { - if (0 == uart.PollTx(out_data, out_written)) out_written = 0; - } - } -}; - - -#if defined(GEN_DAISY_TARGET_HAS_OLED) -#define GEN_DAISY_SCOPE_MAX_ZOOM (9) -struct Console { - FontDef& font = Font_6x8; - uint_fast8_t scope_zoom = 5; - uint_fast8_t scope_step = 0; - uint16_t console_cols, console_rows, console_line; - char * console_stats; - char * console_memory; - char ** console_lines; - float scope_data[SSD1309_WIDTH*2]; // 128 pixels - char scope_label[11]; - - Console& init() { - console_cols = SSD1309_WIDTH / font.FontWidth + 1; // +1 to accommodate null terminators. - console_rows = SSD1309_HEIGHT / font.FontHeight - 1; // leave one row free for stats - console_memory = (char *)calloc(console_cols, console_rows); - console_stats = (char *)calloc(console_cols, 1); - for (int i=0; i 0) { - scope_zoom = scope_zoom + 1; - if (scope_zoom > GEN_DAISY_SCOPE_MAX_ZOOM) scope_zoom = 1; - } else if (incr < 0) { - scope_zoom = scope_zoom - 1; - if (scope_zoom < 1) scope_zoom = GEN_DAISY_SCOPE_MAX_ZOOM; + return false; } - return *this; - } - - Console& scope_store(float * buf, size_t size, float samplerate) { - size_t samples = scope_samples(); - for (size_t i=0; i pt0 ? pt0 : min0; - max0 = max0 < pt0 ? pt0 : max0; - } - scope_data[scope_step] = (min0); - scope_step++; - scope_data[scope_step] = (max0); - scope_step++; - //console.log("m1 %d %d", int(min1 * 10), int(max1 * 10)); - if (scope_step >= SSD1309_WIDTH*2) scope_step = 0; - } - return *this; - } - - Console& scope_display(daisy::OledDisplay& oled, float samplerate) { - uint8_t h = SSD1309_HEIGHT - font.FontHeight; - oled.Fill(false); - for (uint_fast8_t i=0; i= 0.f) { + // scale (0.0, 1.0) back to (0, 255) for MIDI bytes + out_data[out_written++] = buf[i] * 256.0f; + out_active = 1; + } + } + } + + // void fromData(Data& data) { + // // this might need a reset: + // static long data_read = 0; + // while (out_written < OOPSY_MIDI_BUFFER_SIZE) { + // double b = data.mData[data_read]; + // if (b < 0.) break; + + // out_data[out_written++] = b * 256.0; + // out_active = 1; + // data_read++; if (data_read >= data.dim) data_read = 0; + // } + // } + + void mainloop() { + // input: + while(uart.Readable()) { + uint8_t byte = uart.PopRx(); + if (in_written < OOPSY_BUFFER_SIZE) { + // scale (0, 255) to (0.0, 1.0) + // to protect hardware from accidental patching + in_data[in_written] = byte / 256.0f; + in_written++; + } + in_active = 1; + } + // output: + if (out_written) { + if (0 == uart.PollTx(out_data, out_written)) out_written = 0; + } + } + } midi; + #endif - int app_count = 1; - int app_selected = 0, app_selecting = 0; - - int encoder_held = 0, encoder_held_ms = 0, encoder_released = 0, encoder_incr = 0; + struct GenDaisy { - int is_mode_selecting = 0; + Daisy hardware; + AppDef * appdefs = nullptr; + int mode, mode_default; + int app_count = 1, app_selected = 0, app_selecting = 0; + int menu_button_held = 0, menu_button_released = 0, menu_button_held_ms = 0, menu_button_incr = 0; + int is_mode_selecting = 0; - uint32_t t = 0, dt = 10; - Timer uitimer; + uint32_t t = 0, dt = 10; + Timer uitimer; - // microseconds spent in audio callback - uint32_t audioCpuUs = 0; + // microseconds spent in audio callback + uint32_t audioCpuUs = 0; - float samplerate; // default 48014 - size_t blocksize; // default 48 + float samplerate; // default 48014 + size_t blocksize; // default 48 - #ifdef GEN_DAISY_TARGET_USES_MIDI_UART - MidiUart midi; - #endif - - Console console; - - void (*mainloopCallback)(uint32_t t, uint32_t dt); - void * app = nullptr; - void * gen = nullptr; - bool nullAudioCallbackRunning = false; - - template - void reset(A& newapp) { - // first, remove callbacks: - mainloopCallback = nullMainloopCallback; - nullAudioCallbackRunning = false; - hardware.ChangeAudioCallback(nullAudioCallback); - while (!nullAudioCallbackRunning) dsy_system_delay(10); - // reset memory - gendaisylib::init(); - // install new app: - app = &newapp; - newapp.init(*this); - // install new callbacks: - mainloopCallback = newapp.staticMainloopCallback; - hardware.ChangeAudioCallback(newapp.staticAudioCallback); - //console.log("app loaded"); + void (*mainloopCallback)(uint32_t t, uint32_t dt); + void (*displayCallback)(uint32_t t, uint32_t dt); + void * app = nullptr; + void * gen = nullptr; + bool nullAudioCallbackRunning = false; - console.log("loaded %s", appdefs[app_selected].name); - console.log("%d/%dK+%d/%dM", gendaisylib::sram_used/1024, GEN_DAISY_SRAM_SIZE/1024, gendaisylib::sdram_used/1048576, GEN_DAISY_SDRAM_SIZE/1048576); - } + #ifdef OOPSY_TARGET_HAS_OLED + + enum { + SCOPESTYLE_OVERLAY = 0, + SCOPESTYLE_TOPBOTTOM, + SCOPESTYLE_LEFTRIGHT, + SCOPESTYLE_LISSAJOUS, + SCOPESTYLE_COUNT + } ScopeStyles; + + enum { + SCOPEOPTION_STYLE = 0, + SCOPEOPTION_SOURCE, + SCOPEOPTION_ZOOM, + SCOPEOPTION_COUNT + } ScopeOptions; + + FontDef& font = Font_6x8; + uint_fast8_t scope_zoom = 3; + uint_fast8_t scope_step = 0; + uint_fast8_t scope_option = 0, scope_source = 0, scope_style = 0; + uint16_t console_cols, console_rows, console_line; + char * console_stats; + char * console_memory; + char ** console_lines; + float scope_data[SSD1309_WIDTH*2][2]; // 128 pixels + char scope_label[11]; + #endif // OOPSY_TARGET_HAS_OLED + + template + void reset(A& newapp) { + // first, remove callbacks: + mainloopCallback = nullMainloopCallback; + displayCallback = nullMainloopCallback; + nullAudioCallbackRunning = false; + hardware.ChangeAudioCallback(nullAudioCallback); + while (!nullAudioCallbackRunning) dsy_system_delay(10); + // reset memory + oopsy::init(); + // install new app: + app = &newapp; + newapp.init(*this); + // install new callbacks: + mainloopCallback = newapp.staticMainloopCallback; + displayCallback = newapp.staticDisplayCallback; + hardware.ChangeAudioCallback(newapp.staticAudioCallback); + log("loaded gen~ %s", appdefs[app_selected].name); + log("%d/%dK+%d/%dM", oopsy::sram_used/1024, OOPSY_SRAM_SIZE/1024, oopsy::sdram_used/1048576, OOPSY_SDRAM_SIZE/1048576); + } + + int run(AppDef * appdefs, int count) { + this->appdefs = appdefs; + app_count = count; + + mode_default = (Mode)(MODE_COUNT-1); + mode = mode_default; + + hardware.Init(); + samplerate = hardware.AudioSampleRate(); // default 48014 + blocksize = hardware.AudioBlockSize(); // default 48 + + #ifdef OOPSY_TARGET_HAS_OLED + console_cols = SSD1309_WIDTH / font.FontWidth + 1; // +1 to accommodate null terminators. + console_rows = SSD1309_HEIGHT / font.FontHeight; + console_memory = (char *)calloc(console_cols, console_rows); + console_stats = (char *)calloc(console_cols, 1); + for (int i=0; iappdefs = appdefs; + hardware.StartAdc(); + hardware.StartAudio(nullAudioCallback); + mainloopCallback = nullMainloopCallback; + displayCallback = nullMainloopCallback; - mode_default = (Mode)(MODE_COUNT-1); - mode = mode_default; + #ifdef OOPSY_TARGET_USES_MIDI_UART + midi.init(); + #endif - hardware.Init(); - #ifdef GEN_DAISY_TARGET_FIELD - samplerate = hardware.SampleRate(); // default 48014 - blocksize = hardware.BlockSize(); // default 48 - #else - samplerate = hardware.AudioSampleRate(); // default 48014 - blocksize = hardware.AudioBlockSize(); // default 48 - #endif - app_count = count; - console.init(); + app_selected = 0; + appdefs[app_selected].load(); - hardware.StartAdc(); - hardware.StartAudio(nullAudioCallback); - mainloopCallback = nullMainloopCallback; + #ifdef OOPSY_TARGET_HAS_OLED + console_display(); + #endif - #ifdef GEN_DAISY_TARGET_USES_MIDI_UART - midi.init(); - #endif + static bool blink; + while(1) { + uint32_t t1 = dsy_system_getnow(); + dt = t1-t; + t = t1; - app_selected = 0; - appdefs[app_selected].load(); + // pulse seed LED for status according to CPU usage: + hardware.seed.SetLed((t % 1000)/10 <= uint32_t(0.0001f*audioCpuUs*samplerate/blocksize)); + + // handle app-level code (e.g. for CV/gate outs) + mainloopCallback(t, dt); + + if (uitimer.ready(dt)) { - #ifdef GEN_DAISY_TARGET_HAS_OLED - console.display(hardware.display); - #endif - while(1) { - uint32_t t1 = dsy_system_getnow(); - dt = t1-t; - t = t1; + #ifdef OOPSY_TARGET_USES_MIDI_UART + midi.mainloop(); + #endif - #ifdef GEN_DAISY_TARGET_USES_MIDI_UART - midi.mainloop(); - #endif - // handle app-level code (e.g. for LED/CV/gate outs) - mainloopCallback(t, dt); - - if (uitimer.ready(dt)) { - // Handle encoder press/longpress actions: - if (encoder_held_ms > GEN_DAISY_LONG_PRESS_MS) { - // LONG PRESS - is_mode_selecting = 1; - } - - // Handle encoder increment actions: - if (is_mode_selecting) { - //if (encoder_incr) console.log("mode %d %d %d", encoder_incr, mode, MODE_COUNT); - mode += encoder_incr; - if (mode >= MODE_COUNT) mode = 1; - if (mode < 1) mode = MODE_COUNT-1; - #ifdef GEN_DAISY_MULTI_APP - } else if (mode == MODE_MENU) { - app_selecting += encoder_incr; - if (app_selecting >= app_count) app_selecting -= app_count; - if (app_selecting < 0) app_selecting += app_count; - #endif - #ifdef GEN_DAISY_TARGET_HAS_OLED - } else if (mode == MODE_SCOPE) { - console.scope_increment(encoder_incr); - #endif - } - encoder_incr = 0; + if (menu_button_held_ms > OOPSY_LONG_PRESS_MS) { + // LONG PRESS + is_mode_selecting = 1; + } + + // CLEAR DISPLAY + #ifdef OOPSY_TARGET_HAS_OLED + hardware.display.Fill(false); + #endif + #ifdef OOPSY_TARGET_PETAL + hardware.ClearLeds(); + #endif + + #ifdef OOPSY_TARGET_PETAL + // has no mode selection + is_mode_selecting = 0; + #if defined(OOPSY_MULTI_APP) + // multi-app is always in menu mode: + mode = MODE_MENU; + #endif + for(int i = 0; i < 8; i++) { + float white = (i == app_selecting || menu_button_released); + hardware.SetRingLed((daisy::DaisyPetal::RingLed)i, + (i == app_selected || white) * 1.f, + white * 1.f, + (i < app_count) * 0.3f + white * 1.f + ); + } + #endif //OOPSY_TARGET_PETAL + + #ifdef OOPSY_TARGET_VERSIO + // has no mode selection + is_mode_selecting = 0; + #if defined(OOPSY_MULTI_APP) + // multi-app is always in menu mode: + mode = MODE_MENU; + #endif + for(int i = 0; i < 4; i++) { + float white = (i == app_selecting || menu_button_released); + hardware.SetLed(i, + (i == app_selected || white) * 1.f, + white * 1.f, + (i < app_count) * 0.3f + white * 1.f + ); + } + #endif //OOPSY_TARGET_VERSIO - // SHORT PRESS - if (encoder_released) { + // Handle encoder increment actions: if (is_mode_selecting) { - is_mode_selecting = 0; - #ifdef GEN_DAISY_MULTI_APP + mode += menu_button_incr; + if (mode >= MODE_COUNT) mode = 0; + if (mode < 0) mode = MODE_COUNT-1; + #ifdef OOPSY_MULTI_APP } else if (mode == MODE_MENU) { - if (app_selected != app_selecting) { - app_selected = app_selecting; - appdefs[app_selected].load(); - mode = mode_default; + #ifdef OOPSY_TARGET_VERSIO + app_selecting = menu_button_incr; + #else + app_selecting += menu_button_incr; + #endif + if (app_selecting >= app_count) app_selecting -= app_count; + if (app_selecting < 0) app_selecting += app_count; + #endif // OOPSY_MULTI_APP + #ifdef OOPSY_TARGET_HAS_OLED + } else if (mode == MODE_SCOPE) { + switch (scope_option) { + case SCOPEOPTION_STYLE: { + scope_style = (scope_style + menu_button_incr) % SCOPESTYLE_COUNT; + } break; + case SCOPEOPTION_SOURCE: { + if (menu_button_incr) scope_source = !scope_source; + } break; + case SCOPEOPTION_ZOOM: { + scope_zoom = (scope_zoom + menu_button_incr); + if (scope_zoom > OOPSY_SCOPE_MAX_ZOOM) scope_zoom = 1; + if (scope_zoom < 1) scope_zoom = OOPSY_SCOPE_MAX_ZOOM; + } break; } - #endif + #endif //OOPSY_TARGET_HAS_OLED } - } - encoder_released = 0; - - // if (encoder_held_ms > GEN_DAISY_LONG_PRESS_MS) { - // mode = MODE_MENU; - // } else if (mode == MODE_MENU) { - // // just released: - // mode = mode_default; - // if (app_selected != app_selecting) { - // app_selected = app_selecting; - // console.log("load %s", appdefs[app_selected].name); - // appdefs[app_selected].load(); - // } - // } - - // switch (mode) { - // case MODE_MENU: { - // app_selecting += encoder_incr; - // if (app_selecting >= app_count) app_selecting -= app_count; - // if (app_selecting < 0) app_selecting += app_count; - - // } break; - // #ifdef GEN_DAISY_TARGET_HAS_OLED - // case MODE_SCOPE: scope.increment(encoder_incr); break; - // #endif - // default: break; - // } - - - #ifdef GEN_DAISY_TARGET_HAS_OLED - hardware.display.Fill(false); - #endif - switch(mode) { - #ifdef GEN_DAISY_TARGET_HAS_OLED - #ifdef GEN_DAISY_MULTI_APP - case MODE_MENU: { - FontDef& font = console.font; - for (int i=0; i<8; i++) { - if (i == app_selecting) { - hardware.display.SetCursor(0, font.FontHeight * i); - hardware.display.WriteString((char *)">", font, true); + menu_button_incr = 0; + + // SHORT PRESS + if (menu_button_released) { + menu_button_released = 0; + if (is_mode_selecting) { + is_mode_selecting = 0; + #ifdef OOPSY_MULTI_APP + } else if (mode == MODE_MENU) { + if (app_selected != app_selecting) { + app_selected = app_selecting; + #ifndef OOPSY_TARGET_HAS_OLED + mode = mode_default; + #endif + appdefs[app_selected].load(); + continue; + } + #endif + #ifdef OOPSY_TARGET_HAS_OLED + } else if (mode == MODE_SCOPE) { + scope_option = (scope_option + 1) % SCOPEOPTION_COUNT; + #endif + } + } + + // OLED DISPLAY: + #ifdef OOPSY_TARGET_HAS_OLED + switch(mode) { + #ifdef OOPSY_MULTI_APP + case MODE_MENU: { + for (int i=0; i<8; i++) { + if (i == app_selecting) { + hardware.display.SetCursor(0, font.FontHeight * i); + hardware.display.WriteString((char *)">", font, i != app_selected); + } + if (i < app_count) { + hardware.display.SetCursor(font.FontWidth, font.FontHeight * i); + hardware.display.WriteString((char *)appdefs[i].name, font, i != app_selected); + } } - if (i < app_count) { - hardware.display.SetCursor(font.FontWidth, font.FontHeight * i); - hardware.display.WriteString((char *)appdefs[i].name, font, true); + } break; + #endif //OOPSY_MULTI_APP + case MODE_SCOPE: { + uint8_t h = SSD1309_HEIGHT; + uint8_t w2 = SSD1309_WIDTH/2, w4 = SSD1309_WIDTH/4; + uint8_t h2 = h/2, h4 = h/4; + size_t samples = scope_samples(); + hardware.display.Fill(false); + + // stereo views: + switch (scope_style) { + case SCOPESTYLE_OVERLAY: { + // stereo overlay: + for (uint_fast8_t i=0; i' : ' '); + midi.in_active = midi.out_active = 0; + #endif + offset += snprintf(console_stats+offset, console_cols-offset, "%02d%%", int(0.0001f*audioCpuUs*(samplerate)/blocksize)); + // stats: + hardware.display.SetCursor(SSD1309_WIDTH - (offset) * font.FontWidth, font.FontHeight * 0); + hardware.display.WriteString(console_stats, font, true); } - } + #endif //OOPSY_TARGET_HAS_OLED + + // handle app-level code (e.g. for LED etc.) + displayCallback(t, dt); - if (is_mode_selecting) { - #ifdef GEN_DAISY_TARGET_HAS_OLED - hardware.display.DrawRect(0, 0, SSD1309_WIDTH-1, SSD1309_HEIGHT-1, 1); - #endif - } - #ifdef GEN_DAISY_TARGET_HAS_OLED - #ifdef GEN_DAISY_MULTI_APP - if (mode != MODE_MENU) - #endif //GEN_DAISY_MULTI_APP - { - // status bar - int offset = 0; - offset += snprintf(console.console_stats+offset, console.console_cols-offset, "%02d%%", int(0.0001f*audioCpuUs*(samplerate)/blocksize)); - #ifdef GEN_DAISY_TARGET_USES_MIDI_UART - offset += snprintf(console.console_stats+offset, console.console_cols-offset, " %cM%c", midi.in_active ? '<' : ' ', midi.out_active ? '>' : ' '); - midi.in_active = midi.out_active = 0; - #endif - console.status_display(hardware.display); - } - hardware.display.Update(); - #endif //GEN_DAISY_TARGET_HAS_OLED - } // uitimer.ready + #ifdef OOPSY_TARGET_HAS_OLED + hardware.display.Update(); + #endif //OOPSY_TARGET_HAS_OLED + #if (OOPSY_TARGET_PETAL || OOPSY_TARGET_VERSIO) + hardware.UpdateLeds(); + #endif //(OOPSY_TARGET_PETAL || OOPSY_TARGET_VERSIO) + + } // uitimer.ready + } + return 0; } - return 0; - } - void audio_preperform(size_t size) { + void audio_preperform(size_t size) { + #ifdef OOPSY_TARGET_USES_MIDI_UART + midi.preperform(size); + #endif - #ifdef GEN_DAISY_TARGET_USES_MIDI_UART - midi.preperform(size); - #endif + #if (OOPSY_TARGET_FIELD || OOPSY_TARGET_VERSIO) + hardware.ProcessAnalogControls(); + #if OOPSY_TARGET_FIELD + hardware.UpdateDigitalControls(); + #endif + #else + hardware.DebounceControls(); + hardware.UpdateAnalogControls(); + #endif - #if (GEN_DAISY_TARGET_FIELD) - hardware.ProcessAnalogControls(); - hardware.UpdateDigitalControls(); - #else - hardware.DebounceControls(); - hardware.UpdateAnalogControls(); - #endif + #ifdef OOPSY_TARGET_FIELD + menu_button_held = hardware.GetSwitch(0)->Pressed(); + menu_button_incr += hardware.GetSwitch(1)->FallingEdge(); + menu_button_held_ms = hardware.GetSwitch(0)->TimeHeldMs(); + if (hardware.GetSwitch(0)->FallingEdge()) menu_button_released = 1; + #elif OOPSY_TARGET_VERSIO + // menu_button_held = hardware.tap_.Pressed(); + // menu_button_incr += hardware.GetKnobValue(6) * app_count; + // menu_button_held_ms = hardware.tap_.TimeHeldMs(); + // if (hardware.tap_.FallingEdge()) menu_button_released = 1; + #else + menu_button_held = hardware.encoder.Pressed(); + menu_button_incr += hardware.encoder.Increment(); + menu_button_held_ms = hardware.encoder.TimeHeldMs(); + if (hardware.encoder.FallingEdge()) menu_button_released = 1; + #endif + } - #ifdef GEN_DAISY_TARGET_FIELD - encoder_held = hardware.GetSwitch(0)->Pressed(); - encoder_incr += hardware.GetSwitch(1)->FallingEdge(); - encoder_held_ms = hardware.GetSwitch(0)->TimeHeldMs(); - if (hardware.GetSwitch(0)->FallingEdge()) encoder_released = 1; - #else - encoder_held = hardware.encoder.Pressed(); - encoder_incr += hardware.encoder.Increment(); - encoder_held_ms = hardware.encoder.TimeHeldMs(); - if (hardware.encoder.FallingEdge()) encoder_released = 1; - #endif + void audio_postperform(float **hardware_ins, float **hardware_outs, size_t size) { + #ifdef OOPSY_TARGET_HAS_OLED + if (mode == MODE_SCOPE) { + // TODO: add selector for scope storage source: + float * buf0 = scope_source ? hardware_ins[0] : hardware_outs[0]; + float * buf1 = scope_source ? hardware_ins[1] : hardware_outs[1]; + size_t samples = scope_samples(); + for (size_t i=0; i pt0 ? pt0 : min0; + max0 = max0 < pt0 ? pt0 : max0; + min1 = min1 > pt1 ? pt1 : min1; + max1 = max1 < pt1 ? pt1 : max1; + } + scope_data[scope_step][0] = (min0); + scope_data[scope_step][1] = (min1); + scope_step++; + scope_data[scope_step][0] = (max0); + scope_data[scope_step][1] = (max1); + scope_step++; + if (scope_step >= SSD1309_WIDTH*2) scope_step = 0; + } + } + #endif + #if (OOPSY_TARGET_POD) + hardware.UpdateLeds(); + #endif + } - } + #ifdef OOPSY_TARGET_HAS_OLED + inline int scope_samples() { + // valid zoom sizes: 1, 2, 3, 4, 6, 8, 12, 16, 24 + switch(scope_zoom) { + case 1: case 2: case 3: case 4: return scope_zoom; break; + case 5: return 6; break; + case 6: return 8; break; + case 7: return 12; break; + case 8: return 16; break; + default: return 24; break; + } + } - void audio_postperform(float **hardware_ins, float **hardware_outs, size_t size) { - #ifdef GEN_DAISY_TARGET_HAS_OLED - if (mode == MODE_SCOPE) { - //scope.store(hardware_ins, size, samplerate); - console.scope_store(hardware_outs[0], size, samplerate); + GenDaisy& console_display() { + for (int i=0; i 7 && idx < 16) idx = 23-i; + hardware.led_driver_.SetLed(idx, data.mData[i]); + } + hardware.led_driver_.SwapBuffersAndTransmit(); + }; #endif + + static void nullAudioCallback(float **hardware_ins, float **hardware_outs, size_t size); + + static void nullMainloopCallback(uint32_t t, uint32_t dt) {} + } daisy; + + void GenDaisy::nullAudioCallback(float **hardware_ins, float **hardware_outs, size_t size) { + daisy.nullAudioCallbackRunning = true; + // zero audio outs: + for (int i=0; i + struct App { + + static void staticMainloopCallback(uint32_t t, uint32_t dt) { + T& self = *(T *)daisy.app; + self.mainloopCallback(daisy, t, dt); + } -// Curiously-recurring template to make App definitions simpler: -template -struct StaticApp { - - static void staticMainloopCallback(uint32_t t, uint32_t dt) { - T& self = *(T *)gendaisy.app; - self.mainloopCallback(gendaisy, t, dt); - } + static void staticDisplayCallback(uint32_t t, uint32_t dt) { + T& self = *(T *)daisy.app; + self.displayCallback(daisy, t, dt); + } - static void staticAudioCallback(float **hardware_ins, float **hardware_outs, size_t size) { - uint32_t start = dsy_tim_get_tick(); // 200MHz - gendaisy.audio_preperform(size); - ((T *)gendaisy.app)->audioCallback(gendaisy, hardware_ins, hardware_outs, size); - gendaisy.audio_postperform(hardware_ins, hardware_outs, size); - // convert elapsed time (200Mhz ticks) to CPU percentage: - gendaisy.audioCpuUs = (dsy_tim_get_tick() - start) / 200; - } -}; + static void staticAudioCallback(float **hardware_ins, float **hardware_outs, size_t size) { + uint32_t start = dsy_tim_get_tick(); // 200MHz + daisy.audio_preperform(size); + ((T *)daisy.app)->audioCallback(daisy, hardware_ins, hardware_outs, size); + daisy.audio_postperform(hardware_ins, hardware_outs, size); + // convert elapsed time (200Mhz ticks) to CPU percentage: + daisy.audioCpuUs = (dsy_tim_get_tick() - start) / 200; + } + }; -////////////////////////// BINDING DAISY TO GENLIB ////////////////////////// +}; // oopsy:: + +void genlib_report_error(const char *s) { oopsy::daisy.log(s); } +void genlib_report_message(const char *s) { oopsy::daisy.log(s); } -void genlib_report_error(const char *s) { gendaisy.console.log(s); } -void genlib_report_message(const char *s) { gendaisy.console.log(s); } unsigned long genlib_ticks() { return dsy_system_getnow(); } t_ptr genlib_sysmem_newptr(t_ptr_size size) { - return (t_ptr)gendaisylib::allocate(size); + return (t_ptr)oopsy::allocate(size); } t_ptr genlib_sysmem_newptrclear(t_ptr_size size) { t_ptr p = genlib_sysmem_newptr(size); - if (p) gendaisylib::memset(p, 0, size); + if (p) oopsy::memset(p, 0, size); return p; } + #endif //GENLIB_DAISY_H diff --git a/source/libdaisy b/source/libdaisy index d6214ef..a2f2c78 160000 --- a/source/libdaisy +++ b/source/libdaisy @@ -1 +1 @@ -Subproject commit d6214ef2bd9ebfd9f40dbe3645c9beb8baaba001 +Subproject commit a2f2c780f6ce52d124d1b1286cc52507326390d6 diff --git a/source/oopsy.js b/source/oopsy.js index 8f4b26f..e973348 100755 --- a/source/oopsy.js +++ b/source/oopsy.js @@ -19,6 +19,19 @@ function interpolate(str, data) { return str.replace(/\$<([^>]+)>/gm, (s, key) => data[key]) } +// prints a number as a C-style float: +function toCfloat(n) { + let s = (+n).toString(); + // add point if needed: + if (s.includes("e")) { + return s; + } else if (s.includes(".")) { + return s + "f"; + } else { + return s + ".f"; + } +} + const help = ` <[cmds]> <[target]> <[cpps]> @@ -69,24 +82,43 @@ function run() { case "pod": case "field": case "petal": - case "patch": {target = arg;} break; + case "patch": + case "versio": {target = arg;} break; case "watch": watch=true; break; + default: { - let p = path.parse(arg); - switch(p.ext) { - case ".json": {target_path = arg; target = ""}; break; - case ".cpp": cpps.push(arg); break; - // case ".gendsp": - // case ".maxpat": - // case ".maxhelp": {pat_path = arg}; break; - default: { - console.warn("unexpected input", arg); + + if (fs.existsSync(arg)) { + if (fs.lstatSync(arg).isDirectory()) { + // add a whole folder full of cpps: + cpps = cpps.concat(fs.readdirSync(arg) + .filter(s => path.parse(s).ext == ".cpp") + .map(s => path.join(arg, s)) + ) + } else { + let p = path.parse(arg); + switch(p.ext) { + case ".json": {target_path = arg; target = ""}; break; + case ".cpp": cpps.push(arg); break; + // case ".gendsp": + // case ".maxpat": + // case ".maxhelp": {pat_path = arg}; break; + default: { + console.warn("unexpected input", arg); + } + } } } } } }); + // remove duplicates: + cpps = cpps.reduce(function (acc, s) { + if (acc.indexOf(s) === -1) acc.push(s) + return acc + }, []); + // configure target: if (!target && !target_path) target = "patch"; if (!target_path) { @@ -97,25 +129,21 @@ function run() { console.log(`Target ${target} configured in path ${target_path}`) assert(fs.existsSync(target_path), `couldn't find target configuration file ${target_path}`); const hardware = JSON.parse(fs.readFileSync(target_path, "utf8")); - if (!hardware.keys) hardware.keys = [] - if (!hardware.knobs) hardware.knobs = [] - if (!hardware.switches) hardware.switches = [] // verify and analyze cpps: assert(cpps.length > 0, "an argument specifying the path to at least one gen~ exported cpp file is required"); - if (cpps.length > 8) { - console.log("maximum 8 apps supported currently") - cpps.length = 8; + if (hardware.max_apps && cpps.length > hardware.max_apps) { + console.log(`this target does not support more than ${hardwre.max_apps} apps`) + cpps.length = hardware.max_apps } - let gloos = cpps.map(cpp_path => { + let apps = cpps.map(cpp_path => { assert(fs.existsSync(cpp_path), `couldn't find source C++ file ${cpp_path}`); - let gloo = analyze_cpp(fs.readFileSync(cpp_path, "utf8")); - gloo.hardware = hardware; - gloo.target = target; - gloo.path = cpp_path; - return gloo; + return { + path: cpp_path, + patch: analyze_cpp(fs.readFileSync(cpp_path, "utf8")) + } }) - let build_name = gloos.map(v=>v.name).join("_") + let build_name = apps.map(v=>v.patch.name).join("_") // configure build path: const build_path = path.join(__dirname, `build_${build_name}_${target}`) @@ -123,6 +151,13 @@ function run() { // ensure build path exists: fs.mkdirSync(build_path, {recursive: true}); + let config = { + build_name: build_name, + build_path: build_path, + target: target, + hardware: hardware, + apps: apps, + } // add watcher if (watch && watchers.length < 1) { @@ -131,7 +166,6 @@ function run() { })) } - const makefile_path = path.join(build_path, `Makefile`) const bin_path = path.join(build_path, "build", build_name+".bin"); const maincpp_path = path.join(build_path, `${build_name}_${target}.cpp`); @@ -142,91 +176,106 @@ TARGET = ${build_name} CPP_SOURCES = ${posixify_path(path.relative(build_path, maincpp_path).replace(" ", "\\ "))} # Library Locations LIBDAISY_DIR = ${(posixify_path(path.relative(build_path, path.join(__dirname, "libdaisy"))).replace(" ", "\\ "))} +# Optimize (i.e. CFLAGS += -O3): +OPT = -O3 # Core location, and generic Makefile. SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core include $(SYSTEM_FILES_DIR)/Makefile # Include the gen_dsp files CFLAGS+=-I"${posixify_path(path.relative(build_path, path.join(__dirname, "gen_dsp")))}" -CFLAGS+=-Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -# Enable printing of floats (for OLED display) -LDFLAGS+=-u _printf_float +# Silence irritating warnings: +CFLAGS+=-O3 -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable +CPPFLAGS+=-O3 -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable `, "utf-8"); + + // didn't seem to be working: + //# Enable printing of floats (for OLED display) + //LDFLAGS+=-u _printf_float console.log(`Will ${action} from ${cpps.join(", ")} by writing to:`) console.log(`\t${maincpp_path}`) console.log(`\t${makefile_path}`) console.log(`\t${bin_path}`) - gloos.map(gloo => { - gloo.relative_path = path.relative(build_path, gloo.path); - generate_gloo(gloo); - return gloo; + apps.map(app => { + generate_app(app, hardware, target); + return app; }) - // store for debugging: - fs.writeFileSync(path.join(build_path, `${build_name}_${target}.json`), JSON.stringify(gloos,null," "),"utf8"); + let defines = Object.assign({}, hardware.defines); + if (apps.some(g => (g.has_midi_in && hardware.midi_ins.length) || (g.has_midi_out && hardware.midi_outs.length))) { + defines.OOPSY_TARGET_USES_MIDI_UART = 1 + } + if (apps.length > 1) defines.OOPSY_MULTI_APP = 1 + if (hardware.oled) defines.OOPSY_TARGET_HAS_OLED = 1 - const cppcode = `${ -target=="patch" ? "#define GEN_DAISY_TARGET_PATCH 1" : -target=="field" ? "#define GEN_DAISY_TARGET_FIELD 1" : -target=="petal" ? "#define GEN_DAISY_TARGET_PETAL 1" : -target=="pod" ? "#define GEN_DAISY_TARGET_POD 1" : -""} -${gloos.some(g => g.has_midi_in || g.has_midi_out) ? "#define GEN_DAISY_TARGET_USES_MIDI_UART 1" : "// no midi"} -${(gloos.length > 1) ? "#define GEN_DAISY_MULTI_APP 1" : "// single app"} + // store for debugging: + //fs.writeFileSync(path.join(build_path, `${build_name}_${target}.json`), JSON.stringify(config,null," "),"utf8"); + const cppcode = `${Object.keys(defines).map(k => ` +#define ${k} (${defines[k]})`).join("")} #include "../genlib_daisy.h" #include "../genlib_daisy.cpp" -${gloos.map(gloo => `#include "${posixify_path(gloo.relative_path)}"`).join("\n")} -${gloos.map(gloo => gloo.cpp.struct).join("\n")} +${apps.map(app => `#include "${posixify_path(path.relative(build_path, app.path))}"`).join("\n")} +${apps.map(app => app.cpp.struct).join("\n")} // store apps in a union to re-use memory, since only one app is active at once: union { - ${gloos.map(gloo => gloo.cpp.union).join("\n\t")} + ${apps.map(app => app.cpp.union).join("\n\t")} } apps; -GenDaisy::AppDef appdefs[] = { - ${gloos.map(gloo => gloo.cpp.appdef).join("\n\t")} +oopsy::AppDef appdefs[] = { + ${apps.map(app => app.cpp.appdef).join("\n\t")} }; int main(void) { - return gendaisy.run(appdefs, sizeof(appdefs)/sizeof(GenDaisy::AppDef)); + return oopsy::daisy.run(appdefs, ${apps.length}); } ` fs.writeFileSync(maincpp_path, cppcode, "utf-8"); + console.log("oopsy generated code") + // now try to make: try { + try { + console.log(execSync("make clean", { cwd: build_path }).toString()) + if (os.platform() == "win32") { + // Gather up make output to run command per line as child process + let build_cmd = execSync("make -n", { cwd: build_path }).toString().split(os.EOL) + build_cmd.forEach(line => { + // Silently execute the commands line-by-line. + if (line.length > 0) + execSync(line, { cwd: build_path }).toString() + }) + } else { + console.log(execSync("export PATH=$PATH:/usr/local/bin && make", { cwd: build_path }).toString()) + } - console.log(execSync("make clean", { cwd: build_path }).toString()) - // TODO: make this cross-platform: - if (os.platform() == "win32") { - //console.log(execSync("set PATH=%PATH%;/usr/local/bin && make", { cwd: build_path }).toString()) - - // Gather up make output to run command per line as child process - // TODO: fix the awful output.. - let build_cmd = execSync("make -n", { cwd: build_path }).toString().split(os.EOL) - build_cmd.forEach(line => { - if (line.length > 0) - console.log(execSync(line, { cwd: build_path }).toString()) - }) - - } else { - console.log(execSync("export PATH=$PATH:/usr/local/bin && make", { cwd: build_path }).toString()) + console.log("oopsy compiled code") + } catch (e) { + // errors from make here + console.error("make failed"); } // if successful, try to upload to hardware: if (fs.existsSync(bin_path) && action=="upload") { - console.log("uploading", bin_path) + + console.log("oopsy flashing...") + if (os.platform() == "win32") { console.log(execSync("set PATH=%PATH%;/usr/local/bin && make program-dfu", { cwd: build_path }).toString()) } else { console.log(execSync("export PATH=$PATH:/usr/local/bin && make program-dfu", { cwd: build_path, stdio:'inherit' }).toString()) + //console.log(execSync("export PATH=$PATH:/usr/local/bin && make program-dfu", { cwd: build_path }).toString()) + //console.log(execSync("export PATH=$PATH:/usr/local/bin && make program-dfu", { cwd: build_path, stdio:'inherit' }) } + + console.log("oopsy flashed") } } catch (e) { // errors from make here - console.error("make failed"); + console.log("upload failed"); } - console.log("done") + console.log("oopsy done") } function analyze_cpp(cpp) { @@ -261,10 +310,11 @@ function analyze_cpp(cpp) { } function generate_daisy(hardware, nodes, target) { - return { + let daisy = { audio_ins: hardware.audio_ins.map((v, i)=>{ let name = `dsy_in${i+1}` nodes[name] = { + name: name, // name: name, // kind: "input_buffer", // index: i, @@ -275,6 +325,7 @@ function generate_daisy(hardware, nodes, target) { audio_outs: hardware.audio_outs.map((v, i)=>{ let name = `dsy_out${i+1}` nodes[name] = { + name: name, // name: name, // kind: "output_buffer", // index: i, @@ -286,6 +337,7 @@ function generate_daisy(hardware, nodes, target) { midi_ins: hardware.midi_ins.map((v, i)=>{ let name = `dsy_midi_in${i+1}` nodes[name] = { + name: name, // buffername: name, // index: i, to: [], @@ -295,6 +347,7 @@ function generate_daisy(hardware, nodes, target) { midi_outs: hardware.midi_outs.map((v, i)=>{ let name = `dsy_midi_out${i+1}` nodes[name] = { + name: name, // buffername: name, // index: i, from: [], @@ -302,98 +355,56 @@ function generate_daisy(hardware, nodes, target) { return name; }), - keys: hardware.keys.map((v, i)=>{ - let name = `dsy_key_in${i+1}` - nodes[name] = { - // buffername: name, - // index: i, - to: [], - get: `(hardware.KeyboardState(${i})?1.f:0.f)`, - } - return name; - }), - switches: hardware.switches.map((v, i)=>{ - let name = `dsy_sw_in${i+1}` - nodes[name] = { - // buffername: name, - // index: i, - to: [], - get: (target=="pod") ? `(hardware.button${i+1}.Pressed()?1.f:0.f)` : (target=="petal") ? `(hardware.switches[${i}].Pressed()?1.f:0.f)` : `(hardware.GetSwitch(${i})->Pressed()?1.f:0.f)`, - } - return name; - }), - knobs: hardware.knobs.map((v, i)=>{ - let name = `dsy_knob_in${i+1}` + // DEVICE INPUTS: + device_inputs: Object.keys(hardware.inputs).map(v => { + let name = v nodes[name] = { - // buffername: name, - // index: i, + name: name, to: [], - get: `hardware.GetKnobValue(hardware.KNOB_${i+1})`, + get: hardware.inputs[v], } return name; }), - cv_ins: hardware.cv_ins.map((v, i)=>{ - let name = `dsy_cv_in${i+1}` + + // DEVICE OUTPUTS: + mainhandlers: Object.keys(hardware.mainhandlers).map(name => { nodes[name] = { - // buffername: name, - // index: i, - to: [], - get: (target == "field") ? `hardware.GetCvValue(${i})` : `hardware.GetCtrlValue(hardware.CTRL_${i+1})`, + name: name, + setter: hardware.mainhandlers[name], + data: null, } return name; }), - cv_outs: hardware.cv_outs.map((v, i)=>{ - let name = `dsy_cv_out${i+1}` + + // DEVICE OUTPUTS: + device_outs: Object.keys(hardware.outputs).map(name => { nodes[name] = { - // buffername: name, - // index: i, + name: name, + config: hardware.outputs[name], from: [], - set: `dsy_dac_write(DSY_DAC_CHN${i+1}, ${name} * 4095);` } return name; }), - gate_ins: hardware.gate_ins.map((v, i)=>{ - let name = `dsy_gate_in${i+1}` - nodes[name] = { - // buffername: name, - // index: i, - to: [], - get: (target == "field") ? `(hardware.gate_in_.State()?1.f:0.f)` : `(hardware.gate_input[hardware.GATE_IN_${i+1}].State()?1.f:0.f)` - } - return name; - }), - gate_outs: hardware.gate_outs.map((v, i)=>{ - let name = `dsy_gate_out${i+1}` - nodes[name] = { - // buffername: name, - // index: i, - from: [], - set: (target == "field") ? `dsy_gpio_write(&hardware.gate_out_, ${name} > 0.f);` : `dsy_gpio_write(&hardware.gate_output, ${name} > 0.f);` - } - return name; - }) } + return daisy } -function generate_gloo(gloo) { - const {hardware, target} = gloo; - +function generate_app(app, hardware, target) { const nodes = {} const daisy = generate_daisy(hardware, nodes, target); const gen = {} + const name = app.patch.name; - gloo.audio_outs = [] - gloo.has_midi_in = false - gloo.has_midi_out = false - - gloo.nodes = nodes; - gloo.daisy = daisy; - gloo.gen = gen; - gloo.nodes = nodes; + app.audio_outs = [] + app.has_midi_in = false + app.has_midi_out = false + app.nodes = nodes; + app.daisy = daisy; + app.gen = gen; + app.nodes = nodes; - - gen.audio_ins = gloo.ins.map((s, i)=>{ + gen.audio_ins = app.patch.ins.map((s, i)=>{ let name = "gen_in"+(i+1) let label = s.replace(/"/g, "").trim(); let src = null; @@ -401,7 +412,7 @@ function generate_gloo(gloo) { if (label == "midi") { if (daisy.midi_ins.length) { src = daisy.midi_ins[0] - gloo.has_midi_in = true; + app.has_midi_in = true; } } else if (daisy.audio_ins.length > 0) { src = daisy.audio_ins[i % daisy.audio_ins.length]; @@ -418,7 +429,7 @@ function generate_gloo(gloo) { return name; }) - gen.audio_outs = gloo.outs.map((s, i)=>{ + gen.audio_outs = app.patch.outs.map((s, i)=>{ let name = "gen_out"+(i+1) let label = s.replace(/"/g, "").trim(); let src = daisy.audio_outs[i]; @@ -432,7 +443,7 @@ function generate_gloo(gloo) { //label: s, to: [], } - gloo.audio_outs.push(src); + app.audio_outs.push(src); } nodes[name] = { // name: name, @@ -442,24 +453,24 @@ function generate_gloo(gloo) { } // figure out if the out buffer maps to anything: + + // search for a matching [out] name / prefix: let map - let match + let maplabel + Object.keys(hardware.labels.outs).sort().forEach(k => { + let match + if (match = new RegExp(`^${k}_?(.+)?`).exec(label)) { + map = hardware.labels.outs[k]; + maplabel = match[1] || label + } + }) if (label == "midi") { map = daisy.midi_outs[0] - gloo.has_midi_out = true; - } else - // cv/ctrl[n] - if (match = label.match(/^(cv|ctrl)(\d*)$/)) { - map = daisy.cv_outs[(match[2] || 1) - 1] - label = match[3] || label - } else - // gate[n] - if (match = label.match(/^(gate)(\d*)$/)) { - map = daisy.gate_outs[(match[2] || 1) - 1] - label = match[3] || label - } else - // else it is audio data - { + app.has_midi_out = true; + } else if (map) { + label = maplabel + } else { + // else it is audio data nodes[src].src = src; } nodes[name].label = label @@ -471,49 +482,56 @@ function generate_gloo(gloo) { return name; }) - gen.params = gloo.params.map((param, i)=>{ + gen.params = app.patch.params.map((param, i)=>{ const varname = "gen_param_"+param.name; - - let src; - let label; - let match; - if (match = param.name.match(/^(cv|ctrl)(\d*)_?(.+)?/)) { - src = daisy.cv_ins[(match[2] || 1) - 1] - label = match[3] || param.name - } - else if (match = param.name.match(/^(gate)(\d*)_?(.+)?/)) { - src = daisy.gate_ins[(match[2] || 1) - 1] - label = match[3] || param.name - } - else if (match = param.name.match(/^(knob)(\d*)_?(.+)?/)) { - src = daisy.knobs[(match[2] || 1) - 1] - label = match[3] || param.name - } - else if (match = param.name.match(/^(key)(\d*)_?(.+)?/)) { - src = daisy.keys[(match[2] || 1) - 1] - label = match[3] || param.name - } - + let src, label; + + // search for a matching [out] name / prefix: + Object.keys(hardware.labels.params).sort().forEach(k => { + let match + if (match = new RegExp(`^${k}_?(.+)?`).exec(param.name)) { + src = hardware.labels.params[k]; + label = match[1] || param.name + } + }) + let node = Object.assign({ varname: varname, - label: label, + label: label || param.name, src: src, }, param); - nodes[varname] = node; + if (src) { nodes[src].to.push(varname) } return varname; }) - gen.datas = gloo.datas.map((param, i)=>{ + gen.datas = app.patch.datas.map((param, i)=>{ const varname = "gen_data_"+param.name; + let src, label; + // search for a matching [out] name / prefix: + Object.keys(hardware.labels.datas).sort().forEach(k => { + let match + if (match = new RegExp(`^${k}_?(.+)?`).exec(param.name)) { + src = hardware.labels.datas[k]; + label = match[1] || param.name + } + }) + let node = Object.assign({ varname: varname, label: param.name, }, param); nodes[varname] = node; + + if (src) { + nodes[src].data = "gen." + param.cname; + //nodes[src].to.push(varname) + //nodes[src].from.push(src); + } + return varname; }) @@ -521,23 +539,14 @@ function generate_gloo(gloo) { // map unused cvs/knobs to unmapped params let upi=0; // unused param index let param = gen.params[upi]; - daisy.knobs.forEach((name, i)=>{ - const node = nodes[name]; - if (node.to.length == 0) { - // find next param without a src: - while (param && !!nodes[param].src) param = gen.params[++upi]; - if (param) { - nodes[param].src = name; - node.to.push(param); - } - } - }) - daisy.cv_ins.forEach((name, i)=>{ + Object.keys(hardware.inputs).forEach(name => { const node = nodes[name]; if (node.to.length == 0) { + //console.log(name, "not mapped") // find next param without a src: while (param && !!nodes[param].src) param = gen.params[++upi]; if (param) { + //console.log("map to", param) nodes[param].src = name; node.to.push(param); } @@ -560,82 +569,102 @@ function generate_gloo(gloo) { // normal cv outs etc. in the same way { let available = [] - daisy.cv_outs.forEach((name, i)=>{ + let i=0 + daisy.device_outs.forEach(name => { const node = nodes[name]; - // does this output have an audio source? + // does this output have an cv source? if (node.from.length) { available.push(name); } else if (available.length) { - //node.from.push( available[i % available.length] ); - node.src = available[i % available.length]; + node.src = available[i++ % available.length]; } - }); + }) } - const name = gloo.name; const struct = ` -struct App_${name} : public StaticApp { +struct App_${name} : public oopsy::App { ${gen.params .filter(name => nodes[name].src) - .concat(daisy.cv_outs, daisy.gate_outs) + .concat(daisy.device_outs) .map(name=>` float ${name};`).join("")} - ${gloo.audio_outs.map(name=>` - float ${name}[GEN_DAISY_BUFFER_SIZE];`).join("")} + ${app.audio_outs.map(name=>` + float ${name}[OOPSY_BUFFER_SIZE];`).join("")} - void init(GenDaisy& gendaisy) { - gendaisy.gen = ${name}::create(gendaisy.samplerate, gendaisy.blocksize); + void init(oopsy::GenDaisy& daisy) { + daisy.gen = ${name}::create(daisy.samplerate, daisy.blocksize); ${gen.params .filter(name => nodes[name].src) - .concat(daisy.cv_outs, daisy.gate_outs) + .concat(daisy.device_outs) .map(name=>` ${name} = 0.f;`).join("")} } - void mainloopCallback(GenDaisy& gendaisy, uint32_t t, uint32_t dt) { - // whatever handling is needed here - Daisy& hardware = gendaisy.hardware; - ${daisy.cv_outs.concat(daisy.gate_outs) - .filter(name => nodes[name].src || nodes[name].from.length) - .map((name, i)=>` - ${nodes[name].set}`).join("")} + void mainloopCallback(oopsy::GenDaisy& daisy, uint32_t t, uint32_t dt) { + Daisy& hardware = daisy.hardware; + ${name}::State& gen = *(${name}::State *)daisy.gen; + ${daisy.device_outs.map(name => nodes[name]) + .filter(node => node.src || node.from.length) + .filter(node => node.config.where == "main") + .map(node=>` + ${interpolate(node.config.setter, node)};`).join("")} } - void audioCallback(GenDaisy& gendaisy, float **hardware_ins, float **hardware_outs, size_t size) { - Daisy& hardware = gendaisy.hardware; - ${name}::State& gen = *(${name}::State *)gendaisy.gen; - ${daisy.knobs - .concat(daisy.switches, daisy.keys, daisy.cv_ins, daisy.gate_ins) - .filter(name => nodes[name].to.length) - .map(name=>` - float ${name} = ${nodes[name].get};`).join("")} + void displayCallback(oopsy::GenDaisy& daisy, uint32_t t, uint32_t dt) { + Daisy& hardware = daisy.hardware; + ${name}::State& gen = *(${name}::State *)daisy.gen; + ${daisy.mainhandlers.map(name => nodes[name]) + .filter(node => node.data) + .map(node =>` + ${interpolate(node.setter, node)};`).join("")} + ${daisy.device_outs.map(name => nodes[name]) + .filter(node => node.src || node.from.length) + .filter(node => node.config.where == "display") + .map(node=>` + ${interpolate(node.config.setter, node)};`).join("")} + } + + void audioCallback(oopsy::GenDaisy& daisy, float **hardware_ins, float **hardware_outs, size_t size) { + Daisy& hardware = daisy.hardware; + ${name}::State& gen = *(${name}::State *)daisy.gen; + ${daisy.device_inputs.map(name => nodes[name]) + .filter(node => node.to.length) + .map(node=>` + float ${node.name} = ${node.get};`).join("")} ${gen.params.filter(name => nodes[name].src).map(name=>` // ${nodes[name].label} - ${name} = ${nodes[name].src}*${nodes[name].max-nodes[name].min} + ${nodes[name].min}; + ${name} = ${nodes[name].src}*${toCfloat(nodes[name].max-nodes[name].min)} + ${toCfloat(nodes[name].min)}; gen.set_${nodes[name].name}(${name});`).join("")} ${daisy.audio_ins.map((name, i)=>` float * ${name} = hardware_ins[${i}];`).join("")} ${daisy.audio_outs.map((name, i)=>` float * ${name} = hardware_outs[${i}];`).join("")} - ${gloo.has_midi_in ? daisy.midi_ins.map(name=>` - float * ${name} = gendaisy.midi.in_data;`).join("") : ''} + ${app.has_midi_in ? daisy.midi_ins.map(name=>` + float * ${name} = oopsy::midi.in_data;`).join("") : ''} + // ${gen.audio_ins.map(name=>nodes[name].label).join(", ")}: float * inputs[] = { ${gen.audio_ins.map(name=>nodes[name].src).join(", ")} }; + // ${gen.audio_outs.map(name=>nodes[name].label).join(", ")}: float * outputs[] = { ${gen.audio_outs.map(name=>nodes[name].src).join(", ")} }; gen.perform(inputs, outputs, size); - ${daisy.cv_outs.concat(daisy.gate_outs) - .filter(name => nodes[name].src || nodes[name].from.length > 0) - .map(name => nodes[name].src ? ` - ${name} = ${nodes[name].src};` : ` - ${name} = ${nodes[name].from.map(name=>name+"[size-1]").join(" + ")};`).join("")} - ${gloo.has_midi_out ? daisy.midi_outs.map(name=>nodes[name].from.map(name=>` - gendaisy.midi.postperform(${name}, size);`).join("")).join("") : ''} + ${daisy.device_outs.map(name => nodes[name]) + .filter(node => node.src || node.from.length) + .map(node => node.src ? ` + ${node.name} = ${node.src};` : ` + ${node.name} = ${node.from.map(name=>name+"[size-1]").join(" + ")};`).join("")} + ${daisy.device_outs.map(name => nodes[name]) + .filter(node => node.src || node.from.length) + .filter(node => node.config.where == "audio") + .map(node=>` + ${interpolate(node.config.setter, node)};`).join("")} + ${app.has_midi_out ? daisy.midi_outs.map(name=>nodes[name].from.map(name=>` + oopsy::midi.postperform(${name}, size);`).join("")).join("") : ''} } };` - gloo.cpp = { + app.cpp = { union: `App_${name} app_${name};`, - appdef: `{"${name}", []()->void { gendaisy.reset(apps.app_${name}); } },`, + appdef: `{"${name}", []()->void { oopsy::daisy.reset(apps.app_${name}); } },`, struct: struct, } - return gloo + return app } diff --git a/templates/oopsy_field.maxpat b/templates/oopsy_field.maxpat new file mode 100644 index 0000000..401ab1d --- /dev/null +++ b/templates/oopsy_field.maxpat @@ -0,0 +1,2212 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 890.0, 138.0, 756.0, 523.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-23", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 279.0, 127.942857142857122, 48.0, 20.0 ], + "text" : "etc." + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 279.0, 198.771428571428544, 48.0, 20.0 ], + "text" : "etc." + } + + } +, { + "box" : { + "id" : "obj-16", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 279.0, 270.714285714285666, 48.0, 20.0 ], + "text" : "etc." + } + + } +, { + "box" : { + "attr" : "keyB2", + "displaymode" : 8, + "id" : "obj-12", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 246.714285714285666, 150.0, 22.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial Italic", + "fontsize" : 18.0, + "id" : "obj-24", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 24.0, 22.0, 221.0, 27.0 ], + "text" : "Template for DaisyField" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 215.0, 376.0, 24.0, 24.0 ] + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "bang", "bang" ], + "patching_rect" : [ 215.0, 344.0, 42.0, 22.0 ], + "text" : "edge~" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 215.0, 402.0, 42.0, 20.0 ], + "text" : "gate" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 155.0, 402.0, 42.0, 20.0 ], + "text" : "cv2" + } + + } +, { + "box" : { + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 94.0, 400.0, 42.0, 20.0 ], + "text" : "cv1" + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 155.0, 376.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 94.0, 376.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 24.0, 448.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "id" : "obj-11", + "lastchannelcount" : 0, + "maxclass" : "live.gain~", + "numinlets" : 2, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "", "float", "list" ], + "parameter_enable" : 1, + "patching_rect" : [ 24.0, 342.0, 44.0, 90.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_longname" : "live.gain~", + "parameter_mmax" : 6.0, + "parameter_mmin" : -70.0, + "parameter_shortname" : "live.gain~", + "parameter_type" : 0, + "parameter_unitstyle" : 4 + } + + } +, + "varname" : "live.gain~" + } + + } +, { + "box" : { + "attr" : "keyA1", + "displaymode" : 8, + "id" : "obj-10", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 222.714285714285666, 150.0, 22.0 ] + } + + } +, { + "box" : { + "args" : [ "@loop", 1, "@file", "jongly.aif" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-7", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "demosound.maxpat", + "numinlets" : 0, + "numoutlets" : 1, + "offset" : [ 0.0, 0.0 ], + "outlettype" : [ "signal" ], + "patching_rect" : [ 24.0, 55.0, 225.0, 105.0 ], + "viewvisibility" : 1 + } + + } +, { + "box" : { + "fontsize" : 24.0, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 6, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal", "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 84.0, 103.0, 1095.0, 792.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-36", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 916.633333333333439, 34.0, 139.0, 20.0 ], + "text" : "MIDI:" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 916.633333333333439, 67.5, 53.0, 22.0 ], + "text" : "in 3 midi" + } + + } +, { + "box" : { + "id" : "obj-30", + "linecount" : 7, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 936.633333333333439, 128.5, 139.0, 100.0 ], + "text" : "\"midi\" input/output is converted to/from normalized byte streams. See the MIDI examples more info on how to read and write these. " + } + + } +, { + "box" : { + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 916.633333333333439, 323.0, 61.0, 22.0 ], + "text" : "out 6 midi" + } + + } +, { + "box" : { + "id" : "obj-88", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 913.133333333333326, 640.0, 79.0, 22.0 ], + "text" : "param keyB8" + } + + } +, { + "box" : { + "id" : "obj-89", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 926.800000000000182, 671.0, 22.0, 22.0 ], + "text" : "15" + } + + } +, { + "box" : { + "id" : "obj-90", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 913.133333333333439, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-91", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 830.990476190476215, 640.0, 79.0, 22.0 ], + "text" : "param keyB7" + } + + } +, { + "box" : { + "id" : "obj-92", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 843.800000000000068, 671.0, 22.0, 22.0 ], + "text" : "14" + } + + } +, { + "box" : { + "id" : "obj-93", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 830.133333333333439, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-94", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 748.847619047619105, 640.0, 79.0, 22.0 ], + "text" : "param keyB6" + } + + } +, { + "box" : { + "id" : "obj-95", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 762.800000000000182, 671.0, 22.0, 22.0 ], + "text" : "13" + } + + } +, { + "box" : { + "id" : "obj-96", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 748.133333333333553, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-97", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 666.704761904761995, 640.0, 79.0, 22.0 ], + "text" : "param keyB5" + } + + } +, { + "box" : { + "id" : "obj-98", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 679.800000000000068, 671.0, 22.0, 22.0 ], + "text" : "12" + } + + } +, { + "box" : { + "id" : "obj-99", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 666.133333333333439, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-100", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 584.561904761904884, 640.0, 79.0, 22.0 ], + "text" : "param keyB4" + } + + } +, { + "box" : { + "id" : "obj-101", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 598.800000000000182, 671.0, 21.0, 22.0 ], + "text" : "11" + } + + } +, { + "box" : { + "id" : "obj-102", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 584.561904761904884, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-103", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 502.419047619047774, 640.0, 79.0, 22.0 ], + "text" : "param keyB3" + } + + } +, { + "box" : { + "id" : "obj-104", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 515.800000000000068, 671.0, 22.0, 22.0 ], + "text" : "10" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 502.133333333333439, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-106", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 420.276190476190607, 640.0, 79.0, 22.0 ], + "text" : "param keyB2" + } + + } +, { + "box" : { + "id" : "obj-107", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 434.800000000000182, 671.0, 19.0, 22.0 ], + "text" : "9" + } + + } +, { + "box" : { + "id" : "obj-108", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 421.133333333333553, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-109", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 338.133333333333439, 640.0, 79.0, 22.0 ], + "text" : "param keyB1" + } + + } +, { + "box" : { + "id" : "obj-110", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 351.800000000000068, 671.0, 19.0, 22.0 ], + "text" : "8" + } + + } +, { + "box" : { + "id" : "obj-111", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 338.133333333333439, 696.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-76", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 913.133333333333326, 553.0, 79.0, 22.0 ], + "text" : "param keyA8" + } + + } +, { + "box" : { + "id" : "obj-77", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 926.800000000000182, 584.0, 19.0, 22.0 ], + "text" : "7" + } + + } +, { + "box" : { + "id" : "obj-78", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 913.133333333333439, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-79", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 830.990476190476215, 553.0, 79.0, 22.0 ], + "text" : "param keyA7" + } + + } +, { + "box" : { + "id" : "obj-80", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 843.800000000000068, 584.0, 19.0, 22.0 ], + "text" : "6" + } + + } +, { + "box" : { + "id" : "obj-81", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 830.133333333333439, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-82", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 748.847619047619105, 553.0, 79.0, 22.0 ], + "text" : "param keyA6" + } + + } +, { + "box" : { + "id" : "obj-83", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 762.800000000000182, 584.0, 19.0, 22.0 ], + "text" : "5" + } + + } +, { + "box" : { + "id" : "obj-84", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 748.133333333333553, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-85", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 666.704761904761995, 553.0, 79.0, 22.0 ], + "text" : "param keyA5" + } + + } +, { + "box" : { + "id" : "obj-86", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 679.800000000000068, 584.0, 19.0, 22.0 ], + "text" : "4" + } + + } +, { + "box" : { + "id" : "obj-87", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 666.133333333333439, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-70", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 584.561904761904884, 553.0, 79.0, 22.0 ], + "text" : "param keyA4" + } + + } +, { + "box" : { + "id" : "obj-71", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 598.800000000000182, 584.0, 19.0, 22.0 ], + "text" : "3" + } + + } +, { + "box" : { + "id" : "obj-72", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 584.561904761904884, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-73", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 502.419047619047774, 553.0, 79.0, 22.0 ], + "text" : "param keyA3" + } + + } +, { + "box" : { + "id" : "obj-74", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 515.800000000000068, 584.0, 19.0, 22.0 ], + "text" : "2" + } + + } +, { + "box" : { + "id" : "obj-75", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 502.133333333333439, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-67", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 420.276190476190607, 553.0, 79.0, 22.0 ], + "text" : "param keyA2" + } + + } +, { + "box" : { + "id" : "obj-68", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 434.800000000000182, 584.0, 19.0, 22.0 ], + "text" : "1" + } + + } +, { + "box" : { + "id" : "obj-69", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 421.133333333333553, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-66", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 338.133333333333439, 553.0, 79.0, 22.0 ], + "text" : "param keyA1" + } + + } +, { + "box" : { + "id" : "obj-64", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 351.800000000000068, 584.0, 19.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "id" : "obj-65", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 338.133333333333439, 609.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-63", + "linecount" : 6, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 42.5, 553.0, 256.0, 87.0 ], + "text" : "Use a [data leds 24] to address the LEDs on Field, since there are so many of them. \n\nLEDS 0-7 correspond to buttons A1-8\nLEDS 8-15 correspond to buttons B1-8\nLEDS 16-23 correspond to knobs 1-8" + } + + } +, { + "box" : { + "id" : "obj-54", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 408.633333333333439, 295.0, 22.0, 22.0 ], + "text" : "23" + } + + } +, { + "box" : { + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 394.966666666666697, 320.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-56", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 392.900000000000091, 345.0, 22.0, 22.0 ], + "text" : "22" + } + + } +, { + "box" : { + "id" : "obj-57", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 379.233333333333462, 370.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-58", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 377.033333333333417, 395.0, 22.0, 22.0 ], + "text" : "21" + } + + } +, { + "box" : { + "id" : "obj-59", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 363.366666666666731, 420.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-60", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 361.300000000000125, 446.0, 22.0, 22.0 ], + "text" : "20" + } + + } +, { + "box" : { + "id" : "obj-61", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 347.633333333333439, 471.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-49", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 272.56666666666672, 295.0, 22.0, 22.0 ], + "text" : "19" + } + + } +, { + "box" : { + "id" : "obj-50", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 258.899999999999977, 320.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-52", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 256.833333333333371, 345.0, 22.0, 22.0 ], + "text" : "18" + } + + } +, { + "box" : { + "id" : "obj-53", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 243.166666666666714, 370.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-47", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 240.966666666666697, 395.0, 22.0, 22.0 ], + "text" : "17" + } + + } +, { + "box" : { + "id" : "obj-48", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 227.300000000000011, 420.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-46", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 225.233333333333377, 446.0, 22.0, 22.0 ], + "text" : "16" + } + + } +, { + "box" : { + "id" : "obj-45", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 0, + "patching_rect" : [ 211.56666666666672, 471.0, 60.0, 22.0 ], + "text" : "poke leds" + } + + } +, { + "box" : { + "id" : "obj-44", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 42.5, 522.0, 74.0, 22.0 ], + "text" : "data leds 24" + } + + } +, { + "box" : { + "id" : "obj-40", + "linecount" : 3, + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 394.899999999999977, 154.0, 80.0, 49.0 ], + "text" : "param knob8 @min 0 @max 1" + } + + } +, { + "box" : { + "id" : "obj-41", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 379.100000000000023, 124.599099099636078, 79.0, 22.0 ], + "text" : "param knob7" + } + + } +, { + "box" : { + "id" : "obj-42", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 363.300000000000011, 96.0, 79.0, 22.0 ], + "text" : "param knob6" + } + + } +, { + "box" : { + "id" : "obj-43", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 347.5, 69.0, 79.0, 22.0 ], + "text" : "param knob5" + } + + } +, { + "box" : { + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 258.899999999999977, 154.0, 79.0, 22.0 ], + "text" : "param knob4" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 243.099999999999994, 124.599099099636078, 79.0, 22.0 ], + "text" : "param knob3" + } + + } +, { + "box" : { + "id" : "obj-23", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 227.300000000000011, 96.0, 79.0, 22.0 ], + "text" : "param knob2" + } + + } +, { + "box" : { + "id" : "obj-24", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 272.56666666666672, 185.0, 74.288288295269012, 47.0 ], + "text" : "knob1_foo etc also works" + } + + } +, { + "box" : { + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 211.5, 69.0, 79.0, 22.0 ], + "text" : "param knob1" + } + + } +, { + "box" : { + "id" : "obj-35", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 211.5, 34.0, 150.0, 20.0 ], + "text" : "Knobs" + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 570.5, 296.0, 36.5, 22.0 ], + "text" : "min" + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 509.5, 296.0, 38.0, 22.0 ], + "text" : "max" + } + + } +, { + "box" : { + "id" : "obj-39", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 42.5, 667.0, 107.0, 22.0 ], + "text" : "oopsy.suggestions" + } + + } +, { + "box" : { + "id" : "obj-38", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 7.5, 323.0, 69.0, 20.0 ], + "text" : "OUTPUTS" + } + + } +, { + "box" : { + "id" : "obj-37", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 7.5, 69.0, 69.0, 20.0 ], + "text" : "INPUTS" + } + + } +, { + "box" : { + "id" : "obj-34", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 702.5, 426.0, 201.0, 60.0 ], + "text" : "Gate will be low (0v) if the value here is equal to or less than zero, and high (5v) if the value here is greater than zero. " + } + + } +, { + "box" : { + "id" : "obj-33", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 702.5, 323.0, 69.0, 22.0 ], + "text" : "out 5 gate1" + } + + } +, { + "box" : { + "id" : "obj-31", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 509.5, 426.0, 189.0, 33.0 ], + "text" : "CV outputs clamp a 0..1 range to 0-5v on the Daisy hardware. " + } + + } +, { + "box" : { + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 570.5, 323.0, 57.0, 22.0 ], + "text" : "out 4 cv2" + } + + } +, { + "box" : { + "id" : "obj-28", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 509.5, 323.0, 57.0, 22.0 ], + "text" : "out 3 cv1" + } + + } +, { + "box" : { + "id" : "obj-27", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 702.5, 357.400900900363922, 201.0, 47.0 ], + "text" : "Gate inputs are similar to CVs, but the input is always either @min or @max, also 0 or 1 by default." + } + + } +, { + "box" : { + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 702.5, 67.5, 76.0, 22.0 ], + "text" : "param gate1" + } + + } +, { + "box" : { + "id" : "obj-17", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 509.5, 357.400900900363922, 189.0, 60.0 ], + "text" : "CV inputs of 0v to 5v will be mapped to the @min..@max range. @min @max are 0 and 1 by default." + } + + } +, { + "box" : { + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 588.0, 144.0, 65.0, 22.0 ], + "text" : "param cv4" + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 570.5, 118.5, 65.0, 22.0 ], + "text" : "param cv3" + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 528.5, 92.900900900363922, 65.0, 22.0 ], + "text" : "param cv2" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 509.5, 69.0, 65.0, 22.0 ], + "text" : "param cv1" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 509.5, 34.0, 150.0, 20.0 ], + "text" : "CV/Gate etc." + } + + } +, { + "box" : { + "id" : "obj-11", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 115.5, 34.0, 69.0, 20.0 ], + "text" : "Audio IOs" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 156.5, 69.0, 28.0, 22.0 ], + "text" : "in 2" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 156.5, 323.0, 35.0, 22.0 ], + "text" : "out 2" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 115.5, 69.0, 28.0, 22.0 ], + "text" : "in 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 115.5, 323.0, 35.0, 22.0 ], + "text" : "out 1" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-102", 0 ], + "source" : [ "obj-100", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-102", 1 ], + "source" : [ "obj-101", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-105", 0 ], + "source" : [ "obj-103", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-105", 1 ], + "source" : [ "obj-104", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-108", 0 ], + "source" : [ "obj-106", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-108", 1 ], + "source" : [ "obj-107", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-111", 0 ], + "source" : [ "obj-109", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-111", 1 ], + "source" : [ "obj-110", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 1 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "source" : [ "obj-15", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 1 ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-48", 0 ], + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "source" : [ "obj-40", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-57", 0 ], + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-59", 0 ], + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-61", 0 ], + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 1 ], + "source" : [ "obj-46", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-48", 1 ], + "source" : [ "obj-47", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 1 ], + "source" : [ "obj-49", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 1 ], + "source" : [ "obj-52", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 1 ], + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-57", 1 ], + "source" : [ "obj-56", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-59", 1 ], + "source" : [ "obj-58", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-61", 1 ], + "source" : [ "obj-60", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-65", 1 ], + "source" : [ "obj-64", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-65", 0 ], + "source" : [ "obj-66", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-69", 0 ], + "source" : [ "obj-67", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-69", 1 ], + "source" : [ "obj-68", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-72", 0 ], + "source" : [ "obj-70", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-72", 1 ], + "source" : [ "obj-71", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-75", 0 ], + "source" : [ "obj-73", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-75", 1 ], + "source" : [ "obj-74", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 0 ], + "source" : [ "obj-76", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-78", 1 ], + "source" : [ "obj-77", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-81", 0 ], + "source" : [ "obj-79", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-81", 1 ], + "source" : [ "obj-80", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-84", 0 ], + "source" : [ "obj-82", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-84", 1 ], + "source" : [ "obj-83", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-87", 0 ], + "source" : [ "obj-85", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-87", 1 ], + "source" : [ "obj-86", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-90", 0 ], + "source" : [ "obj-88", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-90", 1 ], + "source" : [ "obj-89", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-93", 0 ], + "source" : [ "obj-91", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-93", 1 ], + "source" : [ "obj-92", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-96", 0 ], + "source" : [ "obj-94", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-96", 1 ], + "source" : [ "obj-95", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 0 ], + "source" : [ "obj-97", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 1 ], + "source" : [ "obj-98", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 24.0, 290.0, 194.0, 35.0 ], + "text" : "gen~" + } + + } +, { + "box" : { + "attr" : "cv1", + "id" : "obj-2", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 81.0, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "cv2", + "id" : "obj-4", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 103.942857142857122, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "gate1", + "displaymode" : 8, + "id" : "obj-5", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 57.0, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "knob1", + "id" : "obj-6", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 151.828571428571394, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "knob2", + "id" : "obj-8", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 174.771428571428544, 150.0, 22.0 ] + } + + } +, { + "box" : { + "args" : [ "@target", "field" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 567.5, 57.0, 128.0, 128.0 ], + "viewvisibility" : 1 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-11", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-20", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-3", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 1 ], + "source" : [ "obj-3", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "source" : [ "obj-3", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 0 ], + "source" : [ "obj-3", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-8", 0 ] + } + + } + ], + "parameters" : { + "obj-11" : [ "live.gain~", "live.gain~", 0 ], + "obj-7::obj-21::obj-6" : [ "live.tab[3]", "live.tab[1]", 0 ], + "obj-7::obj-35" : [ "[5]", "Level", 0 ], + "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], + "parameterbanks" : { + + } +, + "inherited_shortname" : 1 + } +, + "dependency_cache" : [ { + "name" : "oopsy.maxpat", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "patcherrelativepath" : "../patchers", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.suggestions.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.ctrl.smooth3.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "demosound.maxpat", + "bootpath" : "C74:/help/msp", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "sine.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "saw.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "square.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "random.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "interfacecolor.js", + "bootpath" : "C74:/interfaces", + "type" : "TEXT", + "implicit" : 1 + } + ], + "autosave" : 0 + } + +} diff --git a/templates/oopsy_patch.maxpat b/templates/oopsy_patch.maxpat new file mode 100644 index 0000000..c8fee48 --- /dev/null +++ b/templates/oopsy_patch.maxpat @@ -0,0 +1,1107 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 431.0, 199.0, 711.0, 513.0 ], + "bglocked" : 0, + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 1, + "gridsize" : [ 15.0, 15.0 ], + "gridsnaponopen" : 1, + "objectsnaponopen" : 1, + "statusbarvisible" : 2, + "toolbarvisible" : 1, + "lefttoolbarpinned" : 0, + "toptoolbarpinned" : 0, + "righttoolbarpinned" : 0, + "bottomtoolbarpinned" : 0, + "toolbars_unpinned_last_save" : 0, + "tallnewobj" : 0, + "boxanimatetime" : 200, + "enablehscroll" : 1, + "enablevscroll" : 1, + "devicewidth" : 0.0, + "description" : "", + "digest" : "", + "tags" : "", + "style" : "", + "subpatcher_template" : "", + "assistshowspatchername" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial Italic", + "fontsize" : 18.0, + "id" : "obj-24", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 24.0, 22.0, 221.0, 27.0 ], + "text" : "Template for DaisyPatch" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 243.0, 365.0, 24.0, 24.0 ] + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "bang", "bang" ], + "patching_rect" : [ 243.0, 333.0, 42.0, 22.0 ], + "text" : "edge~" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 243.0, 391.0, 42.0, 20.0 ], + "text" : "gate" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 183.0, 391.0, 42.0, 20.0 ], + "text" : "cv2" + } + + } +, { + "box" : { + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 122.0, 389.0, 42.0, 20.0 ], + "text" : "cv1" + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 183.0, 365.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 122.0, 365.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 24.0, 425.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "id" : "obj-12", + "lastchannelcount" : 0, + "maxclass" : "live.gain~", + "numinlets" : 2, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "", "float", "list" ], + "parameter_enable" : 1, + "patching_rect" : [ 73.0, 319.0, 44.0, 90.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_longname" : "live.gain~[1]", + "parameter_mmax" : 6.0, + "parameter_mmin" : -70.0, + "parameter_shortname" : "live.gain~", + "parameter_type" : 0, + "parameter_unitstyle" : 4 + } + + } +, + "varname" : "live.gain~[1]" + } + + } +, { + "box" : { + "id" : "obj-11", + "lastchannelcount" : 0, + "maxclass" : "live.gain~", + "numinlets" : 2, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "", "float", "list" ], + "parameter_enable" : 1, + "patching_rect" : [ 24.0, 319.0, 44.0, 90.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_longname" : "live.gain~", + "parameter_mmax" : 6.0, + "parameter_mmin" : -70.0, + "parameter_shortname" : "live.gain~", + "parameter_type" : 0, + "parameter_unitstyle" : 4 + } + + } +, + "varname" : "live.gain~" + } + + } +, { + "box" : { + "attr" : "gate2", + "displaymode" : 8, + "id" : "obj-10", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 211.714285714285666, 150.0, 22.0 ] + } + + } +, { + "box" : { + "args" : [ "@loop", 1, "@file", "jongly.aif" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-7", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "demosound.maxpat", + "numinlets" : 0, + "numoutlets" : 1, + "offset" : [ 0.0, 0.0 ], + "outlettype" : [ "signal" ], + "patching_rect" : [ 24.0, 97.0, 225.0, 105.0 ], + "viewvisibility" : 1 + } + + } +, { + "box" : { + "args" : [ "field", "@target", "patch" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 485.5, 97.0, 128.0, 128.0 ], + "viewvisibility" : 1 + } + + } +, { + "box" : { + "fontsize" : 24.0, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 8, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal", "signal", "signal", "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 84.0, 103.0, 1101.0, 556.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-21", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 369.5, 323.0, 36.5, 22.0 ], + "text" : "min" + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 308.5, 323.0, 38.0, 22.0 ], + "text" : "max" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 511.5, 133.0, 29.5, 22.0 ], + "text" : "or" + } + + } +, { + "box" : { + "id" : "obj-39", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 911.5, 96.0, 107.0, 22.0 ], + "text" : "oopsy.suggestions" + } + + } +, { + "box" : { + "id" : "obj-38", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 9.5, 350.0, 69.0, 20.0 ], + "text" : "OUTPUTS" + } + + } +, { + "box" : { + "id" : "obj-37", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 9.5, 96.0, 69.0, 20.0 ], + "text" : "INPUTS" + } + + } +, { + "box" : { + "id" : "obj-36", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 727.0, 61.0, 139.0, 20.0 ], + "text" : "MIDI:" + } + + } +, { + "box" : { + "id" : "obj-34", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 511.5, 453.0, 201.0, 60.0 ], + "text" : "Gate will be low (0v) if the value here is equal to or less than zero, and high (5v) if the value here is greater than zero. " + } + + } +, { + "box" : { + "id" : "obj-33", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 511.5, 350.0, 69.0, 22.0 ], + "text" : "out 7 gate1" + } + + } +, { + "box" : { + "id" : "obj-31", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 308.5, 453.0, 189.0, 33.0 ], + "text" : "CV outputs clamp a 0..1 range to 0-5v on the Daisy hardware. " + } + + } +, { + "box" : { + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 369.5, 350.0, 57.0, 22.0 ], + "text" : "out 6 cv2" + } + + } +, { + "box" : { + "id" : "obj-28", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 308.5, 350.0, 57.0, 22.0 ], + "text" : "out 5 cv1" + } + + } +, { + "box" : { + "id" : "obj-27", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 511.5, 384.400900900363922, 201.0, 47.0 ], + "text" : "Gate inputs are similar to CVs, but the input is always either @min or @max, also 0 or 1 by default." + } + + } +, { + "box" : { + "id" : "obj-25", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 594.5, 96.0, 76.0, 22.0 ], + "text" : "param gate2" + } + + } +, { + "box" : { + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 511.5, 94.5, 76.0, 22.0 ], + "text" : "param gate1" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 727.0, 94.5, 53.0, 22.0 ], + "text" : "in 5 midi" + } + + } +, { + "box" : { + "id" : "obj-30", + "linecount" : 7, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 747.0, 155.5, 139.0, 100.0 ], + "text" : "\"midi\" input/output is converted to/from normalized byte streams. See the MIDI examples more info on how to read and write these. " + } + + } +, { + "box" : { + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 727.0, 350.0, 61.0, 22.0 ], + "text" : "out 8 midi" + } + + } +, { + "box" : { + "id" : "obj-17", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 308.5, 384.400900900363922, 189.0, 60.0 ], + "text" : "CV inputs of 0v to 5v will be mapped to the @min..@max range. @min @max are 0 and 1 by default." + } + + } +, { + "box" : { + "id" : "obj-16", + "linecount" : 3, + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 387.0, 171.0, 86.0, 49.0 ], + "text" : "param ctrl4 @min -10 @max 10" + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 369.5, 145.5, 69.0, 22.0 ], + "text" : "param ctrl3" + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 327.5, 119.900900900363922, 69.0, 22.0 ], + "text" : "param ctrl2" + } + + } +, { + "box" : { + "id" : "obj-13", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 407.211711704730988, 225.0, 74.288288295269012, 47.0 ], + "text" : "cv1, knob1, cv1_foo, etc. all work" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 308.5, 96.0, 69.0, 22.0 ], + "text" : "param ctrl1" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 308.5, 61.0, 150.0, 20.0 ], + "text" : "Knob/CV/Gate etc." + } + + } +, { + "box" : { + "id" : "obj-11", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 117.5, 61.0, 150.0, 20.0 ], + "text" : "Audio IOs" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 240.5, 96.0, 28.0, 22.0 ], + "text" : "in 4" + } + + } +, { + "box" : { + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 240.5, 350.0, 35.0, 22.0 ], + "text" : "out 4" + } + + } +, { + "box" : { + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 199.5, 96.0, 28.0, 22.0 ], + "text" : "in 3" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 199.5, 350.0, 35.0, 22.0 ], + "text" : "out 3" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 158.5, 96.0, 28.0, 22.0 ], + "text" : "in 2" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 158.5, 350.0, 35.0, 22.0 ], + "text" : "out 2" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 117.5, 96.0, 28.0, 22.0 ], + "text" : "in 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 117.5, 350.0, 35.0, 22.0 ], + "text" : "out 1" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 1 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "source" : [ "obj-15", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 1 ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "source" : [ "obj-18", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 1 ], + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "source" : [ "obj-8", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 24.0, 267.0, 194.0, 35.0 ], + "saved_object_attributes" : { + "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportname" : "oopsy_patch" + } +, + "text" : "gen~", + "varname" : "oopsy_patch" + } + + } +, { + "box" : { + "attr" : "ctrl1", + "id" : "obj-2", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 97.0, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "ctrl2", + "id" : "obj-4", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 119.942857142857122, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "ctrl3", + "id" : "obj-5", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 142.885714285714272, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "ctrl4", + "id" : "obj-6", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 165.828571428571394, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "gate1", + "displaymode" : 8, + "id" : "obj-8", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 269.0, 188.771428571428544, 150.0, 22.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-11", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-20", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-3", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 1 ], + "source" : [ "obj-3", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 1 ], + "source" : [ "obj-3", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-3", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "source" : [ "obj-3", 5 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 0 ], + "source" : [ "obj-3", 6 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-8", 0 ] + } + + } + ], + "parameters" : { + "obj-11" : [ "live.gain~", "live.gain~", 0 ], + "obj-12" : [ "live.gain~[1]", "live.gain~", 0 ], + "obj-7::obj-21::obj-6" : [ "live.tab[3]", "live.tab[1]", 0 ], + "obj-7::obj-35" : [ "[5]", "Level", 0 ], + "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], + "parameterbanks" : { + + } +, + "inherited_shortname" : 1 + } +, + "dependency_cache" : [ { + "name" : "oopsy.suggestions.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.gate.min.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.ctrl.smooth3.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.ctrl.smooth2.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.maxpat", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "patcherrelativepath" : "../patchers", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "demosound.maxpat", + "bootpath" : "C74:/help/msp", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "sine.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "saw.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "square.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "random.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "interfacecolor.js", + "bootpath" : "C74:/interfaces", + "type" : "TEXT", + "implicit" : 1 + } + ], + "autosave" : 0 + } + +} diff --git a/templates/oopsy_petal.maxpat b/templates/oopsy_petal.maxpat new file mode 100644 index 0000000..2400000 --- /dev/null +++ b/templates/oopsy_petal.maxpat @@ -0,0 +1,981 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 672.0, 224.0, 496.0, 523.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-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 262.333333333333371, 110.942857142857122, 150.0, 20.0 ], + "text" : "etc." + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-12", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 140.0, 314.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 140.0, 285.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 75.0, 314.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "fontface" : 0, + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 75.0, 285.0, 56.0, 22.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "fontname" : "Arial Italic", + "fontsize" : 18.0, + "id" : "obj-24", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 19.333333333333343, 22.0, 221.0, 27.0 ], + "text" : "Template for DaisyPetal" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 17.333333333333343, 393.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "id" : "obj-11", + "lastchannelcount" : 0, + "maxclass" : "live.gain~", + "numinlets" : 2, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "", "float", "list" ], + "parameter_enable" : 1, + "patching_rect" : [ 17.333333333333343, 287.0, 44.0, 90.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_longname" : "live.gain~", + "parameter_mmax" : 6.0, + "parameter_mmin" : -70.0, + "parameter_shortname" : "live.gain~", + "parameter_type" : 0, + "parameter_unitstyle" : 4 + } + + } +, + "varname" : "live.gain~" + } + + } +, { + "box" : { + "args" : [ "@loop", 1, "@file", "jongly.aif" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-7", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "demosound.maxpat", + "numinlets" : 0, + "numoutlets" : 1, + "offset" : [ 0.0, 0.0 ], + "outlettype" : [ "signal" ], + "patching_rect" : [ 17.333333333333343, 65.0, 225.0, 105.0 ], + "viewvisibility" : 1 + } + + } +, { + "box" : { + "attr" : "sw1", + "id" : "obj-2", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 262.333333333333371, 65.0, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "sw2", + "id" : "obj-4", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 262.333333333333371, 87.942857142857122, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "knob5", + "id" : "obj-5", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 262.333333333333371, 128.885714285714272, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "knob6", + "id" : "obj-6", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 262.333333333333371, 151.828571428571394, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "exp", + "displaymode" : 1, + "id" : "obj-8", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 262.333333333333371, 174.771428571428544, 150.0, 22.0 ] + } + + } +, { + "box" : { + "args" : [ "@target", "petal" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 267.5, 327.0, 128.0, 128.0 ], + "viewvisibility" : 1 + } + + } +, { + "box" : { + "color" : [ 0.254901960784314, 0.533333333333333, 0.258823529411765, 1.0 ], + "fontsize" : 24.0, + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 6, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal", "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 67.0, 198.0, 1141.0, 427.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-28", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 628.0, 314.0, 46.0, 22.0 ], + "text" : "cycle 1" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 77.0, 221.0, 29.5, 22.0 ], + "text" : "*" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 77.0, 178.0, 37.0, 22.0 ], + "text" : "noise" + } + + } +, { + "box" : { + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 77.0, 264.0, 29.5, 22.0 ], + "text" : "*" + } + + } +, { + "box" : { + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 458.140522875816941, 341.0, 61.0, 22.0 ], + "text" : "out 6 led4" + } + + } +, { + "box" : { + "id" : "obj-27", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 381.5, 341.0, 61.0, 22.0 ], + "text" : "out 5 led3" + } + + } +, { + "box" : { + "id" : "obj-25", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 301.140522875816941, 341.0, 61.0, 22.0 ], + "text" : "out 4 led2" + } + + } +, { + "box" : { + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 235.5, 341.0, 61.0, 22.0 ], + "text" : "out 3 led1" + } + + } +, { + "box" : { + "id" : "obj-23", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 535.5, 88.0, 65.0, 22.0 ], + "text" : "param exp" + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 320.547120418848181, 230.30375586854467, 67.0, 22.0 ], + "text" : "param sw7" + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 307.515706806282765, 206.586463223787234, 67.0, 22.0 ], + "text" : "param sw6" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 291.74083769633512, 182.86917057902977, 67.0, 22.0 ], + "text" : "param sw5" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 277.33769633507859, 159.151877934272306, 67.0, 22.0 ], + "text" : "param sw4" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 264.30628272251306, 135.434585289514871, 67.0, 22.0 ], + "text" : "param sw3" + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 458.140522875816941, 210.0, 176.0, 22.0 ], + "text" : "param knob6 @min -1 @max 1" + } + + } +, { + "box" : { + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 441.166666666666742, 185.600000000000023, 79.0, 22.0 ], + "text" : "param knob5" + } + + } +, { + "box" : { + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 427.807189542483684, 161.200000000000017, 79.0, 22.0 ], + "text" : "param knob4" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 412.833333333333258, 136.800000000000011, 79.0, 22.0 ], + "text" : "param knob3" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 248.531413612565416, 111.717292644757435, 67.0, 22.0 ], + "text" : "param sw2" + } + + } +, { + "box" : { + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 235.5, 88.0, 67.0, 22.0 ], + "text" : "param sw1" + } + + } +, { + "box" : { + "id" : "obj-39", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1000.5, 88.0, 107.0, 22.0 ], + "text" : "oopsy.suggestions" + } + + } +, { + "box" : { + "id" : "obj-38", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.5, 342.0, 69.0, 20.0 ], + "text" : "OUTPUTS" + } + + } +, { + "box" : { + "id" : "obj-37", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.5, 88.0, 69.0, 20.0 ], + "text" : "INPUTS" + } + + } +, { + "box" : { + "id" : "obj-17", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 235.5, 40.0, 319.0, 33.0 ], + "text" : "Knob and switch inputs will be mapped to the @min..@max range. @min @max are 0 and 1 by default." + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 396.473856209150313, 112.400000000000006, 79.0, 22.0 ], + "text" : "param knob2" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 381.5, 88.0, 79.0, 22.0 ], + "text" : "param knob1" + } + + } +, { + "box" : { + "id" : "obj-11", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 126.5, 53.0, 69.0, 20.0 ], + "text" : "Audio IOs" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 167.5, 88.0, 28.0, 22.0 ], + "text" : "in 2" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 167.5, 342.0, 35.0, 22.0 ], + "text" : "out 2" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 126.5, 88.0, 28.0, 22.0 ], + "text" : "in 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 126.5, 342.0, 35.0, 22.0 ], + "text" : "out 1" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "order" : 1, + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "order" : 0, + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "source" : [ "obj-15", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-27", 0 ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 1 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "source" : [ "obj-28", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "source" : [ "obj-7", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 17.333333333333343, 222.0, 71.5, 35.0 ], + "saved_object_attributes" : { + "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportname" : "oopsy_petal" + } +, + "text" : "gen~", + "varname" : "oopsy_petal" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-11", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-16", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "source" : [ "obj-16", 5 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "source" : [ "obj-16", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-16", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-8", 0 ] + } + + } + ], + "parameters" : { + "obj-11" : [ "live.gain~", "live.gain~", 0 ], + "obj-7::obj-21::obj-6" : [ "live.tab[3]", "live.tab[1]", 0 ], + "obj-7::obj-35" : [ "[5]", "Level", 0 ], + "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], + "parameterbanks" : { + + } +, + "inherited_shortname" : 1 + } +, + "dependency_cache" : [ { + "name" : "oopsy.suggestions.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.gate.min.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.ctrl.smooth3.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.ctrl.smooth2.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.maxpat", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "patcherrelativepath" : "../patchers", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "demosound.maxpat", + "bootpath" : "C74:/help/msp", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "sine.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "saw.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "square.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "random.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "interfacecolor.js", + "bootpath" : "C74:/interfaces", + "type" : "TEXT", + "implicit" : 1 + } + ], + "autosave" : 0 + } + +} diff --git a/templates/oopsy_pod.maxpat b/templates/oopsy_pod.maxpat new file mode 100644 index 0000000..dd07a4d --- /dev/null +++ b/templates/oopsy_pod.maxpat @@ -0,0 +1,790 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 692.0, 240.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-1", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 4, + "outlettype" : [ "signal", "signal", "signal", "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 8, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 84.0, 103.0, 964.0, 458.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-21", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 284.5, 315.0, 29.5, 22.0 ], + "text" : "*" + } + + } +, { + "box" : { + "id" : "obj-20", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 225.5, 378.0, 186.0, 47.0 ], + "presentation_linecount" : 6, + "text" : "LED outputs range -1 to 1; where output will be green when positive and red when negative" + } + + } +, { + "box" : { + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 225.5, 284.0, 36.0, 22.0 ], + "text" : "cycle" + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 289.0, 350.0, 61.0, 22.0 ], + "text" : "out 4 led2" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 225.5, 350.0, 61.0, 22.0 ], + "text" : "out 3 led1" + } + + } +, { + "box" : { + "id" : "obj-10", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 492.5, 157.0, 108.0, 60.0 ], + "text" : "Pod encoder will be +1, -1 or 0;\nencoder press will be 0 or 1" + } + + } +, { + "box" : { + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 472.5, 120.0, 75.0, 22.0 ], + "text" : "param press" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 453.5, 96.0, 89.0, 22.0 ], + "text" : "param encoder" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 284.5, 172.0, 164.0, 22.0 ], + "text" : "param sw2 @min -1 @max 1" + } + + } +, { + "box" : { + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 265.5, 148.0, 67.0, 22.0 ], + "text" : "param sw1" + } + + } +, { + "box" : { + "id" : "obj-39", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 794.5, 96.0, 107.0, 22.0 ], + "text" : "oopsy.suggestions" + } + + } +, { + "box" : { + "id" : "obj-38", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 9.5, 350.0, 69.0, 20.0 ], + "text" : "OUTPUTS" + } + + } +, { + "box" : { + "id" : "obj-37", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 9.5, 96.0, 69.0, 20.0 ], + "text" : "INPUTS" + } + + } +, { + "box" : { + "id" : "obj-36", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 631.0, 62.5, 139.0, 20.0 ], + "text" : "MIDI:" + } + + } +, { + "box" : { + "id" : "obj-19", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 631.0, 96.0, 53.0, 22.0 ], + "text" : "in 3 midi" + } + + } +, { + "box" : { + "id" : "obj-30", + "linecount" : 7, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 651.0, 157.0, 139.0, 100.0 ], + "text" : "\"midi\" input/output is converted to/from normalized byte streams. See the MIDI examples more info on how to read and write these. " + } + + } +, { + "box" : { + "id" : "obj-17", + "linecount" : 6, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 313.5, 211.400900900363922, 122.0, 87.0 ], + "text" : "Knob and switch inputs will be mapped to the @min..@max range. @min @max are 0 and 1 by default." + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 244.5, 120.0, 176.0, 22.0 ], + "text" : "param knob2 @min -1 @max 1" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 225.5, 96.0, 127.0, 22.0 ], + "text" : "param knob1 @max 1" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 225.5, 61.0, 57.0, 20.0 ], + "text" : "Knobs" + } + + } +, { + "box" : { + "id" : "obj-11", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 117.5, 61.0, 69.0, 20.0 ], + "text" : "Audio IOs" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 158.5, 96.0, 28.0, 22.0 ], + "text" : "in 2" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 158.5, 350.0, 35.0, 22.0 ], + "text" : "out 2" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 117.5, 96.0, 28.0, 22.0 ], + "text" : "in 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 117.5, 350.0, 35.0, 22.0 ], + "text" : "out 1" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 1 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "order" : 1, + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "order" : 0, + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 0 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-3", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 18.0, 267.0, 137.0, 22.0 ], + "saved_object_attributes" : { + "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportname" : "oopsy_pod" + } +, + "text" : "gen~", + "varname" : "oopsy_pod" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 429.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "id" : "obj-11", + "lastchannelcount" : 0, + "maxclass" : "live.gain~", + "numinlets" : 2, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "", "float", "list" ], + "parameter_enable" : 1, + "patching_rect" : [ 18.0, 323.0, 44.0, 90.0 ], + "saved_attribute_attributes" : { + "valueof" : { + "parameter_longname" : "live.gain~", + "parameter_mmax" : 6.0, + "parameter_mmin" : -70.0, + "parameter_shortname" : "live.gain~", + "parameter_type" : 0, + "parameter_unitstyle" : 4 + } + + } +, + "varname" : "live.gain~" + } + + } +, { + "box" : { + "attr" : "press", + "displaymode" : 8, + "id" : "obj-10", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 263.0, 215.714285714285666, 150.0, 22.0 ] + } + + } +, { + "box" : { + "args" : [ "@loop", 1, "@file", "jongly.aif" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-7", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "demosound.maxpat", + "numinlets" : 0, + "numoutlets" : 1, + "offset" : [ 0.0, 0.0 ], + "outlettype" : [ "signal" ], + "patching_rect" : [ 18.0, 101.0, 225.0, 105.0 ], + "viewvisibility" : 1 + } + + } +, { + "box" : { + "attr" : "knob1", + "id" : "obj-2", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 263.0, 101.0, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "knob2", + "id" : "obj-4", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 263.0, 123.942857142857122, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "sw1", + "id" : "obj-5", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 263.0, 146.885714285714272, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "sw2", + "id" : "obj-6", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 263.0, 169.828571428571394, 150.0, 22.0 ] + } + + } +, { + "box" : { + "attr" : "encoder", + "displaymode" : 1, + "id" : "obj-8", + "maxclass" : "attrui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 263.0, 192.771428571428544, 150.0, 22.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial Italic", + "fontsize" : 18.0, + "id" : "obj-24", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 25.0, 221.0, 27.0 ], + "text" : "Template for DaisyPod" + } + + } +, { + "box" : { + "args" : [ "@target", "pod" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-9", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 457.5, 101.0, 128.0, 128.0 ], + "viewvisibility" : 1 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-11", 1 ], + "source" : [ "obj-1", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-11", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "source" : [ "obj-8", 0 ] + } + + } + ], + "parameters" : { + "obj-11" : [ "live.gain~", "live.gain~", 0 ], + "obj-7::obj-21::obj-6" : [ "live.tab[3]", "live.tab[1]", 0 ], + "obj-7::obj-35" : [ "[5]", "Level", 0 ], + "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-9::obj-36" : [ "live.menu[1]", "live.menu", 0 ], + "parameterbanks" : { + + } +, + "inherited_shortname" : 1 + } +, + "dependency_cache" : [ { + "name" : "oopsy.maxpat", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "patcherrelativepath" : "../patchers", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "oopsy.snoop.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.node4max.js", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "patcherrelativepath" : "../javascript", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "demosound.maxpat", + "bootpath" : "C74:/help/msp", + "type" : "JSON", + "implicit" : 1 + } +, { + "name" : "sine.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "saw.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "square.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "random.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", + "implicit" : 1 + } +, { + "name" : "interfacecolor.js", + "bootpath" : "C74:/interfaces", + "type" : "TEXT", + "implicit" : 1 + } +, { + "name" : "oopsy.suggestions.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.gate.min.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.ctrl.smooth3.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } +, { + "name" : "oopsy.ctrl.smooth2.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", + "implicit" : 1 + } + ], + "autosave" : 0 + } + +}