diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a48286f --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + branches: + - main + tags: + - "v*" + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + path: 'oopsy' + ref: 'main' + - name: Install ARM Toolchain + uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '10-2020-q4' + - name: update submodules + working-directory: oopsy + run: | + git submodule update --init + - name: Build libDaisy + run: | + make -C oopsy/source/libdaisy -j$(nproc) + - name: Zip it up + run: | + rm -rf oopsy/.git + rm -rf oopsy/.github + zip -r oopsy.zip oopsy + - name: Make Release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: ${{ github.token }} + draft: true + prerelease: false + files: | + oopsy.zip + LICENSE diff --git a/init/oopsy-objectmappings.txt b/init/oopsy-objectmappings.txt index be811ad..e9b5d9e 100644 --- a/init/oopsy-objectmappings.txt +++ b/init/oopsy-objectmappings.txt @@ -1,14 +1,16 @@ -max definesubstitution oopsy.patch bpatcher @name oopsy.maxpat @args patch; +max definesubstitution oopsy.patch bpatcher @name oopsy.maxpat @args patch @patching_rect 256 256 171 171; max objectfile oopsy.patch oopsy.patch; -max definesubstitution oopsy.field bpatcher @name oopsy.maxpat @args field; +max definesubstitution oopsy.field bpatcher @name oopsy.maxpat @args field @patching_rect 256 256 171 171; max objectfile oopsy.field oopsy.field; -max definesubstitution oopsy.petal bpatcher @name oopsy.maxpat @args petal; +max definesubstitution oopsy.petal bpatcher @name oopsy.maxpat @args petal @patching_rect 256 256 171 171; max objectfile oopsy.petal oopsy.petal; -max definesubstitution oopsy.pod bpatcher @name oopsy.maxpat @args pod; +max definesubstitution oopsy.petal bpatcher @name oopsy.maxpat @args petal_125b_sm @patching_rect 256 256 171 171; +max objectfile oopsy.petal_125b_sm oopsy.petal_125b_sm; +max definesubstitution oopsy.pod bpatcher @name oopsy.maxpat @args pod @patching_rect 256 256 171 171; max objectfile oopsy.pod oopsy.pod; -max definesubstitution oopsy.patch_sm bpatcher @name oopsy.maxpat @args patch_sm; -max objectfile oopsy.patch_sm oopsy.patch_sm; -max definesubstitution oopsy.bluemchen bpatcher @name oopsy.maxpat @args bluemchen; +max definesubstitution oopsy.patch_init bpatcher @name oopsy.maxpat @args patch_init @patching_rect 256 256 171 171; +max objectfile oopsy.patch_init oopsy.patch_init; +max definesubstitution oopsy.bluemchen bpatcher @name oopsy.maxpat @args bluemchen @patching_rect 256 256 171 171; max objectfile oopsy.bluemchen oopsy.bluemchen; -max definesubstitution oopsy.nehcmeulb bpatcher @name oopsy.maxpat @args nehcmeulb; +max definesubstitution oopsy.nehcmeulb bpatcher @name oopsy.maxpat @args nehcmeulb @patching_rect 256 256 171 171; max objectfile oopsy.nehcmeulb oopsy.nehcmeulb; diff --git a/javascript/oopsy.node4max.js b/javascript/oopsy.node4max.js index 52b4fdb..64df913 100644 --- a/javascript/oopsy.node4max.js +++ b/javascript/oopsy.node4max.js @@ -17,7 +17,10 @@ process.stdout.write = (function() { if (match = str.match(/^oopsy (.*)/i)) { //maxAPI.outlet(match[1]) // Node was timing out here, so we set up an interval reader instead msgs.push(match[1]) - } + } + if (match = str.match(/^build_path (.*)/i)) { + msgs.push(['build_path', match[1]]) + } } })(); diff --git a/patchers/oopsy.maxpat b/patchers/oopsy.maxpat index aed8cf3..ad9147f 100644 --- a/patchers/oopsy.maxpat +++ b/patchers/oopsy.maxpat @@ -4,13 +4,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 392.0, 105.0, 1246.0, 808.0 ], + "rect" : [ 178.0, 104.0, 721.0, 654.0 ], "bglocked" : 0, "openinpresentation" : 1, "default_fontsize" : 12.0, @@ -39,6 +39,96 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "id" : "obj-68", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 15.5, 577.0, 150.0, 60.0 ], + "text" : "these objects grab the build path and allow users to open a file browser right to it" + } + + } +, { + "box" : { + "id" : "obj-65", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "", "int" ], + "patching_rect" : [ 170.0, 608.0, 159.0, 22.0 ], + "text" : "conformpath native absolute" + } + + } +, { + "box" : { + "fontsize" : 10.0, + "id" : "obj-61", + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 70.0, 647.0, 41.0, 19.0 ], + "presentation" : 1, + "presentation_rect" : [ 120.0, 19.0, 50.0, 19.0 ], + "text" : "Build" + } + + } +, { + "box" : { + "id" : "obj-60", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 295.0, 562.0, 95.0, 22.0 ], + "text" : "route build_path" + } + + } +, { + "box" : { + "id" : "obj-58", + "linecount" : 3, + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 170.0, 647.0, 83.0, 49.0 ], + "text" : "sprintf \"; max launchbrowser \\\"file://%s\\\"\"" + } + + } +, { + "box" : { + "id" : "obj-52", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 763.0, 394.0, 57.0, 22.0 ], + "text" : "/usr/local" + } + + } +, { + "box" : { + "id" : "obj-23", + "linecount" : 2, + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 70.0, 713.0, 141.0, 35.0 ], + "text" : ";\rmax launchbrowser file://" + } + + } +, { "box" : { "id" : "obj-20", "maxclass" : "button", @@ -134,7 +224,7 @@ "parameter_enable" : 1, "patching_rect" : [ 735.0, 298.0, 52.5, 20.0 ], "presentation" : 1, - "presentation_rect" : [ 75.0, 37.0, 54.0, 15.0 ], + "presentation_rect" : [ 102.0, 37.0, 69.0, 15.0 ], "saved_attribute_attributes" : { "valueof" : { "parameter_enum" : [ "Off", "On" ], @@ -166,7 +256,7 @@ "parameter_enable" : 1, "patching_rect" : [ 554.0, 298.0, 43.5, 20.0 ], "presentation" : 1, - "presentation_rect" : [ 37.0, 37.0, 40.0, 15.0 ], + "presentation_rect" : [ 47.0, 37.0, 60.0, 15.0 ], "saved_attribute_attributes" : { "valueof" : { "parameter_enum" : [ "Off", "On" ], @@ -198,7 +288,7 @@ "parameter_enable" : 0, "patching_rect" : [ 179.0, 315.0, 85.0, 19.0 ], "presentation" : 1, - "presentation_rect" : [ 86.0, 19.0, 42.0, 19.0 ] + "presentation_rect" : [ 86.0, 19.0, 35.0, 19.0 ] } } @@ -301,7 +391,7 @@ "parameter_enable" : 1, "patching_rect" : [ 742.0, 516.0, 62.0, 16.0 ], "presentation" : 1, - "presentation_rect" : [ -1.0, 37.0, 39.999999642372131, 15.0 ], + "presentation_rect" : [ -1.0, 37.0, 52.999999642372131, 15.0 ], "saved_attribute_attributes" : { "valueof" : { "parameter_enum" : [ "Off", "On" ], @@ -344,7 +434,7 @@ "parameter_enable" : 0, "patching_rect" : [ 377.5, 263.0, 41.0, 19.0 ], "presentation" : 1, - "presentation_rect" : [ 86.0, 0.0, 42.0, 19.0 ], + "presentation_rect" : [ 120.0, 0.0, 50.0, 19.0 ], "text" : "Browse" } @@ -353,7 +443,7 @@ "box" : { "fontsize" : 9.0, "id" : "obj-76", - "items" : [ "patch", ",", "patch_sm", ",", "field", ",", "petal", ",", "pod", ",", "versio", ",", "bluemchen", ",", "nehcmeulb" ], + "items" : [ "patch", ",", "patch_init", ",", "field", ",", "petal", ",", "petal_125b_sm", ",", "pod", ",", "versio", ",", "bluemchen", ",", "nehcmeulb" ], "maxclass" : "umenu", "numinlets" : 1, "numoutlets" : 3, @@ -361,7 +451,7 @@ "parameter_enable" : 0, "patching_rect" : [ 330.5, 315.0, 100.0, 19.0 ], "presentation" : 1, - "presentation_rect" : [ 38.0, 0.0, 50.0, 19.0 ] + "presentation_rect" : [ 38.0, 0.0, 83.0, 19.0 ] } } @@ -377,13 +467,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 613.0, 269.0, 918.0, 472.0 ], + "rect" : [ 421.0, 260.0, 918.0, 472.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -418,7 +508,7 @@ "numinlets" : 1, "numoutlets" : 3, "outlettype" : [ "", "", "bang" ], - "patching_rect" : [ 523.0, 253.0, 40.0, 22.0 ], + "patching_rect" : [ 511.0, 251.0, 40.0, 22.0 ], "text" : "t l l b" } @@ -427,11 +517,11 @@ "box" : { "id" : "obj-29", "maxclass" : "newobj", - "numinlets" : 9, - "numoutlets" : 9, - "outlettype" : [ "", "", "", "", "", "", "", "", "" ], - "patching_rect" : [ 17.0, 97.0, 387.0, 22.0 ], - "text" : "routepass patch patch_sm field petal pod versio bluemchen nehcmeulb" + "numinlets" : 10, + "numoutlets" : 10, + "outlettype" : [ "", "", "", "", "", "", "", "", "", "" ], + "patching_rect" : [ 17.0, 97.0, 471.0, 22.0 ], + "text" : "routepass patch patch_init field petal petal_125b_sm pod versio bluemchen nehcmeulb" } } @@ -441,7 +531,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 465.0, 59.0, 62.0, 20.0 ], + "patching_rect" : [ 548.0, 55.0, 62.0, 20.0 ], "text" : "browse" } @@ -455,7 +545,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 431.0, 58.0, 30.0, 30.0 ] + "patching_rect" : [ 514.0, 54.0, 30.0, 30.0 ] } } @@ -466,7 +556,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "malconformed_path" ], - "patching_rect" : [ 641.0, 251.0, 121.0, 22.0 ], + "patching_rect" : [ 629.0, 251.0, 121.0, 22.0 ], "text" : "t malconformed_path" } @@ -478,7 +568,7 @@ "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "bang", "" ], - "patching_rect" : [ 641.0, 224.0, 34.0, 22.0 ], + "patching_rect" : [ 629.0, 224.0, 34.0, 22.0 ], "text" : "sel 0" } @@ -490,7 +580,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 431.0, 214.0, 81.0, 22.0 ], + "patching_rect" : [ 419.0, 214.0, 81.0, 22.0 ], "text" : "prepend error" } @@ -501,7 +591,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 431.0, 238.0, 32.0, 22.0 ], + "patching_rect" : [ 419.0, 238.0, 32.0, 22.0 ], "text" : "print" } @@ -513,7 +603,7 @@ "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "", "" ], - "patching_rect" : [ 431.0, 166.0, 111.0, 22.0 ], + "patching_rect" : [ 419.0, 166.0, 111.0, 22.0 ], "text" : "routepass notfound" } @@ -525,7 +615,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 431.0, 136.0, 77.0, 22.0 ], + "patching_rect" : [ 419.0, 136.0, 77.0, 22.0 ], "text" : "absolutepath", "varname" : "example[4]" } @@ -538,7 +628,7 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "int" ], - "patching_rect" : [ 523.0, 194.0, 137.0, 22.0 ], + "patching_rect" : [ 511.0, 193.0, 137.0, 22.0 ], "text" : "conformpath native boot" } @@ -550,7 +640,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 533.5, 287.0, 96.0, 22.0 ], + "patching_rect" : [ 521.5, 287.0, 96.0, 22.0 ], "text" : "prepend append" } @@ -562,7 +652,7 @@ "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], - "patching_rect" : [ 431.0, 97.0, 103.0, 22.0 ], + "patching_rect" : [ 514.0, 97.0, 103.0, 22.0 ], "text" : "opendialog JSON" } @@ -570,13 +660,13 @@ , { "box" : { "id" : "obj-2", - "linecount" : 2, + "linecount" : 3, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 544.0, 329.0, 372.0, 35.0 ], - "text" : "clear, append patch, append patch_sm, append field, append petal, append pod, append versio, append bluemchen, append nehcmeulb" + "patching_rect" : [ 532.0, 323.0, 369.0, 49.0 ], + "text" : "clear, append patch, append patch_init, append field, append petal, append petal_125b_sm, append pod, append versio, append bluemchen, append nehcmeulb" } } @@ -642,7 +732,7 @@ , { "patchline" : { "destination" : [ "obj-74", 0 ], - "midpoints" : [ 553.5, 380.0, 26.5, 380.0 ], + "midpoints" : [ 541.5, 380.0, 26.5, 380.0 ], "source" : [ "obj-2", 0 ] } @@ -755,7 +845,7 @@ , { "patchline" : { "destination" : [ "obj-37", 0 ], - "midpoints" : [ 532.5, 280.5, 26.5, 280.5 ], + "midpoints" : [ 520.5, 280.5, 26.5, 280.5 ], "source" : [ "obj-31", 0 ] } @@ -778,7 +868,7 @@ , { "patchline" : { "destination" : [ "obj-74", 0 ], - "midpoints" : [ 543.0, 327.5, 26.5, 327.5 ], + "midpoints" : [ 531.0, 327.5, 26.5, 327.5 ], "source" : [ "obj-53", 0 ] } @@ -1001,7 +1091,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -1191,7 +1281,7 @@ "parameter_enable" : 0, "patching_rect" : [ 371.0, 690.0, 114.0, 58.0 ], "presentation" : 1, - "presentation_rect" : [ 0.0, 48.0, 129.0, 80.0 ], + "presentation_rect" : [ 0.0, 48.0, 170.0, 124.0 ], "readonly" : 1, "rounded" : 0.0, "separator" : "newline", @@ -1307,7 +1397,7 @@ "numinlets" : 2, "numoutlets" : 2, "outlettype" : [ "", "" ], - "patching_rect" : [ 580.0, 522.0, 102.0, 22.0 ], + "patching_rect" : [ 580.0, 525.0, 102.0, 22.0 ], "text" : "route terminated" } @@ -1382,7 +1472,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -1610,27 +1700,17 @@ } , { "patchline" : { - "destination" : [ "obj-13", 1 ], - "midpoints" : [ 380.5, 551.5, 672.5, 551.5 ], - "order" : 0, - "source" : [ "obj-2", 0 ] + "destination" : [ "obj-42", 0 ], + "source" : [ "obj-2", 1 ] } } , { "patchline" : { - "destination" : [ "obj-35", 0 ], - "order" : 1, + "destination" : [ "obj-60", 0 ], "source" : [ "obj-2", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-42", 0 ], - "source" : [ "obj-2", 1 ] - } - } , { "patchline" : { @@ -1921,6 +2001,13 @@ "source" : [ "obj-57", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-23", 1 ], + "source" : [ "obj-58", 0 ] + } + } , { "patchline" : { @@ -1928,6 +2015,37 @@ "source" : [ "obj-6", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "midpoints" : [ 380.5, 646.0, 549.5, 646.0, 549.5, 572.0, 672.5, 572.0 ], + "order" : 0, + "source" : [ "obj-60", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "order" : 1, + "source" : [ "obj-60", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-65", 0 ], + "source" : [ "obj-60", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 0 ], + "source" : [ "obj-61", 0 ] + } + } , { "patchline" : { @@ -1935,6 +2053,13 @@ "source" : [ "obj-62", 1 ] } + } +, { + "patchline" : { + "destination" : [ "obj-58", 0 ], + "source" : [ "obj-65", 0 ] + } + } , { "patchline" : { @@ -1985,14 +2110,14 @@ , "dependency_cache" : [ { "name" : "oopsy.snoop.js", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 } , { "name" : "oopsy.node4max.js", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 diff --git a/source/seed.bluemchen.json b/source/bluemchen.json similarity index 97% rename from source/seed.bluemchen.json rename to source/bluemchen.json index 05546f5..3d9c7e2 100644 --- a/source/seed.bluemchen.json +++ b/source/bluemchen.json @@ -1,5 +1,6 @@ { "name":"bluemchen", + "som": "seed", "max_apps": 8, "defines": { "OOPSY_TARGET_HAS_MIDI_INPUT": 1 diff --git a/source/component_defs.json b/source/component_defs.json new file mode 100644 index 0000000..762b004 --- /dev/null +++ b/source/component_defs.json @@ -0,0 +1,1467 @@ +{ + "Switch": { + "map_init": "{name}.Init(som.GetPin({pin}), som.AudioCallbackRate(), {type}, {polarity}, {pull});", + "typename": "daisy::Switch", + "direction": "in", + "pin": "a", + "type": "daisy::Switch::TYPE_MOMENTARY", + "polarity": "daisy::Switch::POLARITY_INVERTED", + "pull": "daisy::Switch::PULL_UP", + "process": "{name}.Debounce();", + "updaterate": "{name}.SetUpdateRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Pressed()?1.f:0.f)", + "range": [ + 0, + 1 + ], + "bool": false + }, + { + "name": "{name}_press", + "get": "({class_name}.{name}.Pressed()?1.f:0.f)", + "range": [ + 0, + 1 + ], + "bool": false + }, + { + "name": "{name}_seconds", + "get": "({class_name}.{name}.TimeHeldMs()*0.001f)", + "bool": false + } + ] + }, + "Switch3": { + "map_init": "{name}.Init(som.GetPin({pin_a}), som.GetPin({pin_b}));", + "typename": "daisy::Switch3", + "direction": "in", + "pin": "a,b", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Read()*0.5f+0.5f)", + "range": [ + 0, + 2 + ], + "bool": false + } + ] + }, + "Encoder": { + "map_init": "{name}.Init(som.GetPin({pin_a}), som.GetPin({pin_b}), som.GetPin({pin_click}), som.AudioCallbackRate());", + "typename": "daisy::Encoder", + "direction": "in", + "pin": "a,b,click", + "process": "{name}.Debounce();", + "updaterate": "{name}.SetUpdateRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Increment())", + "range": [ + -1, + 1 + ], + "bool": false + }, + { + "name": "{name}_press", + "get": "({class_name}.{name}.Pressed()?1.f:0.f)", + "range": [ + 0, + 1 + ], + "bool": false + }, + { + "name": "{name}_rise", + "get": "({class_name}.{name}.RisingEdge()?1.f:0.f)", + "range": [ + 0, + 1 + ], + "bool": true + }, + { + "name": "{name}_fall", + "get": "({class_name}.{name}.FallingEdge()?1.f:0.f)", + "range": [ + 0, + 1 + ], + "bool": true + }, + { + "name": "{name}_seconds", + "get": "({class_name}.{name}.TimeHeldMs()*0.001f)", + "bool": false + } + ] + }, + "GateIn": { + "map_init": "dsy_gpio_pin {name}_pin = som.GetPin({pin});\n {name}.Init(&{name}_pin, {invert});", + "typename": "daisy::GateIn", + "direction": "in", + "pin": "a", + "invert": "true", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.State()?1.f:0.f)", + "range": [ + 0, + 1 + ], + "bool": false + }, + { + "name": "{name}_trig", + "get": "({class_name}.{name}.Trig()?1.f:0.f)", + "range": [ + 0, + 1 + ], + "bool": true + } + ] + }, + "AnalogControl": { + "init_single": "cfg[{i}].InitSingle(som.GetPin({pin}));", + "map_init": "{name}.Init(som.adc.GetPtr({i}), som.AudioCallbackRate(), {flip}, {invert});", + "typename": "daisy::AnalogControl", + "direction": "in", + "pin": "a", + "flip": "false", + "invert": "false", + "slew": "1.0/som.AudioCallbackRate()", + "process": "{name}.Process();", + "updaterate": "{name}.SetSampleRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Value())", + "range": [ + 0, + 1 + ], + "bool": false + } + ] + }, + "Led": { + "map_init": "{name}.Init(som.GetPin({pin}), {invert});\n {name}.Set(0.0f);", + "typename": "daisy::Led", + "direction": "out", + "pin": "a", + "invert": "true", + "postprocess": "{name}.Update();", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.{name}.Set({value});" + } + ] + }, + "RgbLed": { + "map_init": "{name}.Init(som.GetPin({pin_r}), som.GetPin({pin_g}), som.GetPin({pin_b}), {invert});\n {name}.Set(0.0f, 0.0f, 0.0f);", + "typename": "daisy::RgbLed", + "direction": "out", + "pin": "r,g,b", + "invert": "true", + "postprocess": "{name}.Update();", + "mapping": [ + { + "name": "{name}_red", + "set": "{class_name}.{name}.SetRed({value});" + }, + { + "name": "{name}_green", + "set": "{class_name}.{name}.SetGreen({value});" + }, + { + "name": "{name}_blue", + "set": "{class_name}.{name}.SetBlue({value});" + }, + { + "name": "{name}", + "set": "{class_name}.{name}.Set(clamp(-{value}, 0.f, 1.f), 0.f, clamp({value}, 0.f, 1.f));" + }, + { + "name": "{name}_white", + "set": "{class_name}.{name}.Set({value},{value},{value});" + } + ] + }, + "GateOut": { + "map_init": "{name}.pin = som.GetPin({pin});\n {name}.mode = {mode};\n {name}.pull = {pull};\n dsy_gpio_init(&{name});", + "typename": "dsy_gpio", + "direction": "out", + "pin": "a", + "mode": "DSY_GPIO_MODE_OUTPUT_PP", + "pull": "DSY_GPIO_NOPULL", + "mapping": [ + { + "name": "{name}", + "set": "dsy_gpio_write(&{class_name}.{name}, {value});" + } + ] + }, + "CVOuts": { + "map_init": "{name}.bitdepth = {bitdepth};\n {name}.buff_state = {buff_state};\n {name}.mode = {mode};\n {name}.chn = {channel};\n som.dac.Init({name});\n som.dac.WriteValue({channel}, 0);", + "typename": "daisy::DacHandle::Config", + "direction": "out", + "pin": "", + "bitdepth": "daisy::DacHandle::BitDepth::BITS_12", + "buff_state": "daisy::DacHandle::BufferState::ENABLED", + "mode": "daisy::DacHandle::Mode::POLLING", + "channel": "daisy::DacHandle::Channel::BOTH", + "mapping": [ + { + "name": "{name}1", + "set": "{class_name}.som.dac.WriteValue(daisy::DacHandle::Channel::ONE, {value} * 4095);", + "where": "main" + }, + { + "name": "{name}2", + "set": "{class_name}.som.dac.WriteValue(daisy::DacHandle::Channel::TWO, {value} * 4095);", + "where": "main" + } + ] + }, + "i2c": { + "map_init": "{name}.Init({{{peripheral}, {{som.GetPin({pin_scl}), som.GetPin({pin_sda})}}, {speed}, {mode}}});", + "typename": "daisy::I2CHandle", + "pin": "scl,sda", + "peripheral": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_1MHZ", + "mode": "daisy::I2CHandle::Config::Mode::I2C_MASTER", + "mapping": [] + }, + "PCA9685": { + "map_init": "{name}.Init({parent}, {address}, {name}_dma_buffer_a, {name}_dma_buffer_b);", + "typename": "daisy::LedDriverPca9685<{driver_count}, true>", + "non_class_decl": "daisy::LedDriverPca9685<{driver_count}, true>::DmaBuffer DMA_BUFFER_MEM_SECTION {name}_dma_buffer_a, {name}_dma_buffer_b;", + "driver_count": 1, + "address": "{0x00}", + "parent": "", + "pin": "", + "loopprocess": "{name}.SwapBuffersAndTransmit();", + "mapping": [] + }, + "PCA9685Led": { + "map_init": "", + "pin": "", + "typename": "", + "parent": "", + "direction": "out", + "index": 0, + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.{parent}.SetLed({index}, {value});" + } + ] + }, + "PCA9685RgbLed": { + "map_init": "", + "typename": "", + "direction": "out", + "parent": "", + "pin": "", + "index": { + "red": 0, + "green": 1, + "blue": 2 + }, + "mapping": [ + { + "name": "{name}_red", + "set": "{class_name}.{parent}.SetLed({index_red}, {value});" + }, + { + "name": "{name}_green", + "set": "{class_name}.{parent}.SetLed({index_green}, {value});" + }, + { + "name": "{name}_blue", + "set": "{class_name}.{parent}.SetLed({index_blue}, {value});" + }, + { + "name": "{name}", + "set": "{class_name}.{parent}.SetLed({index_red}, {value});\n {class_name}.{parent}.SetLed({index_green}, {value});\n {class_name}.{parent}.SetLed({index_blue}, {value});" + }, + { + "name": "{name}_white", + "set": "{class_name}.{parent}.SetLed({index_red}, {value});\n {class_name}.{parent}.SetLed({index_green}, {value});\n {class_name}.{parent}.SetLed({index_blue}, {value});" + } + ] + }, + "CD4021": { + "map_init": "{name}.Init({{ som.GetPin({pin_clk}), som.GetPin({pin_cs}), {{ som.GetPin({pin_data}) }} }});", + "typename": "daisy::ShiftRegister4021<{driver_count}>", + "non_class_decl": "uint8_t {name}_debounced[8*{driver_count}];", + "driver_count": 1, + "pin": "clk,cs,data", + "postprocess": "{name}.Update();", + "mapping": [] + }, + "CD4021Switch": { + "map_init": "", + "typename": "", + "direction": "in", + "parent": "", + "index": 0, + "postprocess": "{parent}_debounced[{index}] = {parent}.State({index}) | ({parent}_debounced[{index}] << 1);", + "mapping": [ + { + "name": "{name}", + "get": "(json2daisy::{parent}_debounced[{index}] != 0xFF)", + "bool": false + }, + { + "name": "{name}_rise", + "get": "(json2daisy::{parent}_debounced[{index}] == 0xFE)", + "bool": true + }, + { + "name": "{name}_fall", + "get": "(json2daisy::{parent}_debounced[{index}] == 0x7F)", + "bool": true + } + ] + }, + "CD4051": { + "init_single": "size_t {name}_index = {i};\n cfg[{name}_index].InitMux(som.GetPin({pin_adc}), {mux_count}, som.GetPin({pin_sel0}), som.GetPin({pin_sel1}), som.GetPin({pin_sel2}));", + "typename": "", + "mux_count": 1, + "pin": "adc,sel0,sel1,sel2", + "mapping": [] + }, + "CD4051AnalogControl": { + "map_init": "{name}.Init(som.adc.GetMuxPtr({parent}_index, {index}), som.AudioCallbackRate(), {flip}, {invert});", + "parent": "", + "index": 0, + "typename": "daisy::AnalogControl", + "direction": "in", + "flip": "false", + "invert": "false", + "slew": "1.0/som.AudioCallbackRate()", + "process": "{name}.Process();", + "updaterate": "{name}.SetSampleRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Value())", + "range": [ + 0, + 1 + ], + "bool": false + } + ] + }, + "AnalogControlBipolar": { + "init_single": "cfg[{i}].InitSingle(som.GetPin({pin}));", + "map_init": "{name}.InitBipolarCv(som.adc.GetPtr({i}), som.AudioCallbackRate());", + "typename": "daisy::AnalogControl", + "direction": "in", + "pin": "a", + "slew": "1.0/som.AudioCallbackRate()", + "process": "{name}.Process();", + "updaterate": "{name}.SetSampleRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Value())", + "range": [ + -1, + 1 + ], + "bool": false + } + ] + }, + "MotorShield": { + "map_init": "daisy::Pca9685::Config {name}_pca_config;\n {name}_pca_config.address = {address};\n {name}_pca_config.periph = {periph};\n {name}_pca_config.speed = {speed};\n {name}_pca_config.scl = som.GetPin({pin_scl});\n {name}_pca_config.sda = som.GetPin({pin_sda});\n daisy::Adafruit_MotorShield::Config {name}_config;\n {name}_config.pca9685_config = {name}_pca_config;\n {name}_config.frequency = {frequency};\n {name}.Init({name}_config);", + "typename": "daisy::Adafruit_MotorShield", + "direction": "out", + "pin": "scl,sda", + "address": "daisy::Pca9685::PCA9685_I2C_BASE_ADDRESS", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "frequency": "1600", + "mapping": [] + }, + "StepperMotor": { + "map_init": "{name} = {parent}.GetStepper({steps}, {index});\n {name}->SetSpeed({speed});", + "typename": "daisy::Adafruit_MotorShield::Adafruit_StepperMotor*", + "direction": "out", + "parent": "", + "steps": 48, + "index": 1, + "speed": 60, + "loopprocess": "{name}->Process();", + "mapping": [ + { + "name": "{name}", + "set": "if ({value} > 0)\n {class_name}.{name}->StepNonblocking({value}, daisy::Adafruit_MotorShield::FORWARD);\n else if ({value} < 0)\n {class_name}.{name}->StepNonblocking(-{value}, daisy::Adafruit_MotorShield::BACKWARD);" + }, + { + "name": "{name}_release", + "set": "if ({value})\n {class_name}.{name}->Release();" + } + ] + }, + "DcMotor": { + "map_init": "{name} = {parent}.GetMotor({index});\n {name}->SetSpeedFine({speed} * 4095);", + "typename": "daisy::Adafruit_MotorShield::Adafruit_DCMotor*", + "direction": "out", + "parent": "", + "index": 1, + "speed": 0.25, + "mapping": [ + { + "name": "{name}", + "set": "if ({value} > 0)\n {class_name}.{name}->Run(daisy::Adafruit_MotorShield::FORWARD);\n else if ({value} < 0)\n {class_name}.{name}->Run(daisy::Adafruit_MotorShield::BACKWARD);\n else\n {class_name}.{name}->FullOff();", + "permit_scale": false + } + ] + }, + "Bme280": { + "map_init": "daisy::Bme280I2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n {name}_config.address = {address};\n daisy::Bme280I2C::Config {name}_config_main;\n {name}_config_main.transport_config = {name}_config;\n {name}.Init({name}_config_main);", + "typename": "daisy::Bme280I2C", + "direction": "in", + "pin": "scl,sda", + "address": "daisy::Pca9685::PCA9685_I2C_BASE_ADDRESS", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "pressure": 1013, + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.ReadTemperature()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_temp", + "get": "{class_name}.{name}.ReadTemperature()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_hum", + "get": "{class_name}.{name}.ReadHumidity()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_press", + "get": "{class_name}.{name}.ReadPressure()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_alt", + "get": "{class_name}.{name}.ReadAltitude({pressure})", + "where": "main", + "permit_scale": false + } + ] + }, + "HallSensor": { + "map_init": "daisy::HallSensor::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.pin = som.GetPin({pin});\n {name}.Init({name}_config);", + "typename": "daisy::HallSensor", + "direction": "in", + "pin": 14, + "periph": "daisy::HallSensor::Config::Peripheral::TIM_4", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetState()" + }, + { + "name": "{name}_count", + "get": "{class_name}.{name}.GetCount()", + "permit_scale": false + } + ] + }, + "Tlv493d": { + "map_init": "daisy::Tlv493dI2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n daisy::Tlv493dI2C::Config {name}_main_conf;\n {name}_main_conf.transport_config = {name}_config;\n {name}_main_conf.address = {address};\n {name}.Init({name}_main_conf);", + "typename": "daisy::Tlv493dI2C", + "direction": "in", + "pin": "scl,sda", + "address": "TLV493D_ADDRESS1", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "loopprocess": "{name}.UpdateData();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetAmount()", + "permit_scale": false + }, + { + "name": "{name}_x", + "get": "{class_name}.{name}.GetX()", + "permit_scale": false + }, + { + "name": "{name}_y", + "get": "{class_name}.{name}.GetY()", + "permit_scale": false + }, + { + "name": "{name}_z", + "get": "{class_name}.{name}.GetZ()", + "permit_scale": false + }, + { + "name": "{name}_amount", + "get": "{class_name}.{name}.GetAmount()", + "permit_scale": false + }, + { + "name": "{name}_azimuth", + "get": "{class_name}.{name}.GetAzimuth()", + "permit_scale": false + }, + { + "name": "{name}_polar", + "get": "{class_name}.{name}.GetPolar()", + "permit_scale": false + } + ] + }, + "Mpr121": { + "map_init": "daisy::Mpr121I2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n {name}_config.dev_addr = {address};\n daisy::Mpr121I2C::Config {name}_main_conf;\n {name}_main_conf.transport_config = {name}_config;\n {name}_main_conf.touch_threshold = {touch_threshold};\n {name}_main_conf.release_threshold = {release_threshold};\n {name}.Init({name}_main_conf);", + "typename": "daisy::Mpr121I2C", + "direction": "in", + "pin": "scl,sda", + "address": "MPR121_I2CADDR_DEFAULT", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "touch_threshold": "MPR121_TOUCH_THRESHOLD_DEFAULT", + "release_threshold": "MPR121_RELEASE_THRESHOLD_DEFAULT", + "mapping": [ + { + "name": "{name}", + "get": "(({class_name}.{name}.Touched() & 0x001) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch0", + "get": "(({class_name}.{name}.Touched() & 0x001) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch1", + "get": "(({class_name}.{name}.Touched() & 0x002) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch2", + "get": "(({class_name}.{name}.Touched() & 0x004) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch3", + "get": "(({class_name}.{name}.Touched() & 0x008) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch4", + "get": "(({class_name}.{name}.Touched() & 0x010) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch5", + "get": "(({class_name}.{name}.Touched() & 0x020) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch6", + "get": "(({class_name}.{name}.Touched() & 0x040) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch7", + "get": "(({class_name}.{name}.Touched() & 0x080) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch8", + "get": "(({class_name}.{name}.Touched() & 0x100) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch9", + "get": "(({class_name}.{name}.Touched() & 0x200) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch10", + "get": "(({class_name}.{name}.Touched() & 0x400) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch11", + "get": "(({class_name}.{name}.Touched() & 0x800) ? 1.0f : 0.f)", + "where": "main" + }, + { + "name": "{name}_ch0_raw", + "get": "{class_name}.{name}.FilteredData(0)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch1_raw", + "get": "{class_name}.{name}.FilteredData(1)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch2_raw", + "get": "{class_name}.{name}.FilteredData(2)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch3_raw", + "get": "{class_name}.{name}.FilteredData(3)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch4_raw", + "get": "{class_name}.{name}.FilteredData(4)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch5_raw", + "get": "{class_name}.{name}.FilteredData(5)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch6_raw", + "get": "{class_name}.{name}.FilteredData(6)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch7_raw", + "get": "{class_name}.{name}.FilteredData(7)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch8_raw", + "get": "{class_name}.{name}.FilteredData(8)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch9_raw", + "get": "{class_name}.{name}.FilteredData(9)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch10_raw", + "get": "{class_name}.{name}.FilteredData(10)", + "where": "main", + "range": [ + 0, + 1023 + ] + }, + { + "name": "{name}_ch11_raw", + "get": "{class_name}.{name}.FilteredData(11)", + "where": "main", + "range": [ + 0, + 1023 + ] + } + ] + }, + "Apds9960": { + "map_init": "daisy::Apds9960I2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n daisy::Apds9960I2C::Config {name}_main_conf;\n {name}_main_conf.transport_config = {name}_config;\n {name}.Init({name}_main_conf);", + "typename": "daisy::Apds9960I2C", + "direction": "in", + "pin": "scl,sda", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.ReadGesture()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_gest", + "get": "{class_name}.{name}.ReadGesture()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_prox", + "get": "{class_name}.{name}.ReadProximity()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_red", + "get": "{class_name}.{name}.GetColorDataRed()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_green", + "get": "{class_name}.{name}.GetColorDataGreen()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_blue", + "get": "{class_name}.{name}.GetColorDataBlue()", + "where": "main", + "permit_scale": false + }, + { + "name": "{name}_clear", + "get": "{class_name}.{name}.GetColorDataClear()", + "where": "main", + "permit_scale": false + } + ] + }, + "Bmp390": { + "map_init": "daisy::Bmp390I2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n daisy::Bmp390I2C::Config {name}_config_main;\n {name}_config_main.transport_config = {name}_config;\n {name}.Init({name}_config_main);", + "typename": "daisy::Bmp390I2C", + "direction": "in", + "pin": "scl,sda", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "pressure": 1013, + "loopprocess": "{name}.Process();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.ReadTemperature()", + "permit_scale": false + }, + { + "name": "{name}_temp", + "get": "{class_name}.{name}.ReadTemperature()", + "permit_scale": false + }, + { + "name": "{name}_press", + "get": "{class_name}.{name}.ReadPressure()", + "permit_scale": false + }, + { + "name": "{name}_alt", + "get": "{class_name}.{name}.ReadAltitude({pressure})", + "permit_scale": false + } + ] + }, + "Vl53l1x": { + "map_init": "daisy::Vl53l1xI2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n {name}_config.dev_addr = {address};\n daisy::Vl53l1xI2C::Config {name}_main_conf;\n {name}_main_conf.transport_config = {name}_config;\n {name}_main_conf.xShut = som.GetPin({pin_xshut});\n {name}.Init({name}_main_conf);\n {name}.StartRanging();\n {name}.StartTemperatureUpdate();", + "typename": "daisy::Vl53l1xI2C", + "direction": "in", + "pin": "scl,sda,xshut", + "address": 82, + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "loopprocess": "{name}.Process();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetDistance()", + "permit_scale": false + }, + { + "name": "{name}_dist", + "get": "{class_name}.{name}.GetDistance()", + "permit_scale": false + }, + { + "name": "{name}_sig_per_spad", + "get": "{class_name}.{name}.GetSignalPerSpad()", + "permit_scale": false + }, + { + "name": "{name}_amb_per_spad", + "get": "{class_name}.{name}.GetAmbientPerSpad()", + "permit_scale": false + }, + { + "name": "{name}_sig_rate", + "get": "{class_name}.{name}.GetSignalRate()", + "permit_scale": false + }, + { + "name": "{name}_amb_rate", + "get": "{class_name}.{name}.GetAmbientRate()", + "permit_scale": false + }, + { + "name": "{name}_spad_nb", + "get": "{class_name}.{name}.GetSpadNb()", + "permit_scale": false + } + ] + }, + "Vl53l0x": { + "map_init": "daisy::Adafruit_VL53L0X::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n {name}_config.dev_addr = {address};\n {name}_config.vl_config = {vl_config};\n {name}.Init({name}_config);", + "typename": "daisy::Adafruit_VL53L0X", + "direction": "in", + "pin": "scl,sda", + "address": "VL53L0X_I2C_ADDR", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "vl_config": "daisy::Adafruit_VL53L0X::VL53L0X_Sense_config_t::VL53L0X_SENSE_DEFAULT", + "loopprocess": "{name}.Process();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetRangeMilliMeter()", + "permit_scale": false + } + ] + }, + "NeoTrellis": { + "map_init": "daisy::NeoTrellisI2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n {name}_config.address = {address};\n daisy::NeoTrellisI2C::Config {name}_main_conf;\n {name}_main_conf.transport_config = {name}_config;\n {name}.Init({name}_main_conf);", + "typename": "daisy::NeoTrellisI2C", + "direction": "in", + "pin": "scl,sda", + "address": "NEO_TRELLIS_ADDR", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "loopprocess": "{name}.Process();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetRising(0)", + "bool": true + }, + { + "name": "{name}_0", + "get": "{class_name}.{name}.GetRising(0)", + "bool": true + }, + { + "name": "{name}_1", + "get": "{class_name}.{name}.GetRising(1)", + "bool": true + }, + { + "name": "{name}_2", + "get": "{class_name}.{name}.GetRising(2)", + "bool": true + }, + { + "name": "{name}_3", + "get": "{class_name}.{name}.GetRising(3)", + "bool": true + }, + { + "name": "{name}_4", + "get": "{class_name}.{name}.GetRising(4)", + "bool": true + }, + { + "name": "{name}_5", + "get": "{class_name}.{name}.GetRising(5)", + "bool": true + }, + { + "name": "{name}_6", + "get": "{class_name}.{name}.GetRising(6)", + "bool": true + }, + { + "name": "{name}_7", + "get": "{class_name}.{name}.GetRising(7)", + "bool": true + }, + { + "name": "{name}_8", + "get": "{class_name}.{name}.GetRising(8)", + "bool": true + }, + { + "name": "{name}_9", + "get": "{class_name}.{name}.GetRising(9)", + "bool": true + }, + { + "name": "{name}_10", + "get": "{class_name}.{name}.GetRising(10)", + "bool": true + }, + { + "name": "{name}_11", + "get": "{class_name}.{name}.GetRising(11)", + "bool": true + }, + { + "name": "{name}_12", + "get": "{class_name}.{name}.GetRising(12)", + "bool": true + }, + { + "name": "{name}_13", + "get": "{class_name}.{name}.GetRising(13)", + "bool": true + }, + { + "name": "{name}_14", + "get": "{class_name}.{name}.GetRising(14)", + "bool": true + }, + { + "name": "{name}_15", + "get": "{class_name}.{name}.GetRising(15)", + "bool": true + }, + { + "name": "{name}_0_falling", + "get": "{class_name}.{name}.GetFalling(0)", + "bool": true + }, + { + "name": "{name}_1_falling", + "get": "{class_name}.{name}.GetFalling(1)", + "bool": true + }, + { + "name": "{name}_2_falling", + "get": "{class_name}.{name}.GetFalling(2)", + "bool": true + }, + { + "name": "{name}_3_falling", + "get": "{class_name}.{name}.GetFalling(3)", + "bool": true + }, + { + "name": "{name}_4_falling", + "get": "{class_name}.{name}.GetFalling(4)", + "bool": true + }, + { + "name": "{name}_5_falling", + "get": "{class_name}.{name}.GetFalling(5)", + "bool": true + }, + { + "name": "{name}_6_falling", + "get": "{class_name}.{name}.GetFalling(6)", + "bool": true + }, + { + "name": "{name}_7_falling", + "get": "{class_name}.{name}.GetFalling(7)", + "bool": true + }, + { + "name": "{name}_8_falling", + "get": "{class_name}.{name}.GetFalling(8)", + "bool": true + }, + { + "name": "{name}_9_falling", + "get": "{class_name}.{name}.GetFalling(9)", + "bool": true + }, + { + "name": "{name}_10_falling", + "get": "{class_name}.{name}.GetFalling(10)", + "bool": true + }, + { + "name": "{name}_11_falling", + "get": "{class_name}.{name}.GetFalling(11)", + "bool": true + }, + { + "name": "{name}_12_falling", + "get": "{class_name}.{name}.GetFalling(12)", + "bool": true + }, + { + "name": "{name}_13_falling", + "get": "{class_name}.{name}.GetFalling(13)", + "bool": true + }, + { + "name": "{name}_14_falling", + "get": "{class_name}.{name}.GetFalling(14)", + "bool": true + }, + { + "name": "{name}_15_falling", + "get": "{class_name}.{name}.GetFalling(15)", + "bool": true + }, + { + "name": "{name}_0_state", + "get": "({class_name}.{name}.GetState(0) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_1_state", + "get": "({class_name}.{name}.GetState(1) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_2_state", + "get": "({class_name}.{name}.GetState(2) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_3_state", + "get": "({class_name}.{name}.GetState(3) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_4_state", + "get": "({class_name}.{name}.GetState(4) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_5_state", + "get": "({class_name}.{name}.GetState(5) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_6_state", + "get": "({class_name}.{name}.GetState(6) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_7_state", + "get": "({class_name}.{name}.GetState(7) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_8_state", + "get": "({class_name}.{name}.GetState(8) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_9_state", + "get": "({class_name}.{name}.GetState(9) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_10_state", + "get": "({class_name}.{name}.GetState(10) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_11_state", + "get": "({class_name}.{name}.GetState(11) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_12_state", + "get": "({class_name}.{name}.GetState(12) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_13_state", + "get": "({class_name}.{name}.GetState(13) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_14_state", + "get": "({class_name}.{name}.GetState(14) ? 1.0f : 0.0f)" + }, + { + "name": "{name}_15_state", + "get": "({class_name}.{name}.GetState(15) ? 1.0f : 0.0f)" + } + ] + }, + "NeoTrellisLeds": { + "map_init": "", + "parent": "", + "direction": "out", + "loopprocess": "{parent}.Show();", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.{parent}.SetPixelColor(0, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_0", + "set": "{class_name}.{parent}.SetPixelColor(0, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_1", + "set": "{class_name}.{parent}.SetPixelColor(1, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_2", + "set": "{class_name}.{parent}.SetPixelColor(2, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_3", + "set": "{class_name}.{parent}.SetPixelColor(3, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_4", + "set": "{class_name}.{parent}.SetPixelColor(4, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_5", + "set": "{class_name}.{parent}.SetPixelColor(5, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_6", + "set": "{class_name}.{parent}.SetPixelColor(6, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_7", + "set": "{class_name}.{parent}.SetPixelColor(7, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_8", + "set": "{class_name}.{parent}.SetPixelColor(8, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_9", + "set": "{class_name}.{parent}.SetPixelColor(9, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_10", + "set": "{class_name}.{parent}.SetPixelColor(10, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_11", + "set": "{class_name}.{parent}.SetPixelColor(11, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_12", + "set": "{class_name}.{parent}.SetPixelColor(12, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_13", + "set": "{class_name}.{parent}.SetPixelColor(13, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_14", + "set": "{class_name}.{parent}.SetPixelColor(14, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + }, + { + "name": "{name}_15", + "set": "{class_name}.{parent}.SetPixelColor(15, {class_name}.{parent}.pixels.Color({value}, {value}, {value}));", + "where": "main" + } + ] + }, + "Bno055": { + "map_init": "daisy::Bno055I2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n {name}_config.address = {address};\n daisy::Bno055I2C::Config {name}_main_conf;\n {name}_main_conf.transport_config = {name}_config;\n {name}.Init({name}_main_conf);", + "typename": "daisy::Bno055I2C", + "direction": "in", + "pin": "scl,sda", + "address": "BNO055_ADDRESS_A", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "loopprocess": "{name}.Process();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetVectorAccelerometer().x", + "permit_scale": false + }, + { + "name": "{name}_accel_x", + "get": "{class_name}.{name}.GetVectorAccelerometer().x", + "permit_scale": false + }, + { + "name": "{name}_accel_y", + "get": "{class_name}.{name}.GetVectorAccelerometer().y", + "permit_scale": false + }, + { + "name": "{name}_accel_z", + "get": "{class_name}.{name}.GetVectorAccelerometer().z", + "permit_scale": false + }, + { + "name": "{name}_magnet_x", + "get": "{class_name}.{name}.GetVectorMagnetometer().x", + "permit_scale": false + }, + { + "name": "{name}_magnet_y", + "get": "{class_name}.{name}.GetVectorMagnetometer().y", + "permit_scale": false + }, + { + "name": "{name}_magnet_z", + "get": "{class_name}.{name}.GetVectorMagnetometer().z", + "permit_scale": false + }, + { + "name": "{name}_gyro_x", + "get": "{class_name}.{name}.GetVectorGyroscope().x", + "permit_scale": false + }, + { + "name": "{name}_gyro_y", + "get": "{class_name}.{name}.GetVectorGyroscope().y", + "permit_scale": false + }, + { + "name": "{name}_gyro_z", + "get": "{class_name}.{name}.GetVectorGyroscope().z", + "permit_scale": false + }, + { + "name": "{name}_euler_x", + "get": "{class_name}.{name}.GetVectorEuler().x", + "permit_scale": false + }, + { + "name": "{name}_euler_y", + "get": "{class_name}.{name}.GetVectorEuler().y", + "permit_scale": false + }, + { + "name": "{name}_euler_z", + "get": "{class_name}.{name}.GetVectorEuler().z", + "permit_scale": false + }, + { + "name": "{name}_linear_accel_x", + "get": "{class_name}.{name}.GetVectorLinearAccel().x", + "permit_scale": false + }, + { + "name": "{name}_linear_accel_y", + "get": "{class_name}.{name}.GetVectorLinearAccel().y", + "permit_scale": false + }, + { + "name": "{name}_linear_accel_z", + "get": "{class_name}.{name}.GetVectorLinearAccel().z", + "permit_scale": false + }, + { + "name": "{name}_grav_x", + "get": "{class_name}.{name}.GetVectorGravity().x", + "permit_scale": false + }, + { + "name": "{name}_grav_y", + "get": "{class_name}.{name}.GetVectorGravity().y", + "permit_scale": false + }, + { + "name": "{name}_grav_z", + "get": "{class_name}.{name}.GetVectorGravity().z", + "permit_scale": false + }, + { + "name": "{name}_quat_x", + "get": "{class_name}.{name}.GetQuat().x", + "permit_scale": false + }, + { + "name": "{name}_quat_y", + "get": "{class_name}.{name}.GetQuat().y", + "permit_scale": false + }, + { + "name": "{name}_quat_z", + "get": "{class_name}.{name}.GetQuat().z", + "permit_scale": false + }, + { + "name": "{name}_quat_w", + "get": "{class_name}.{name}.GetQuat().w", + "permit_scale": false + } + ] + }, + "Icm20948": { + "map_init": "daisy::Icm20948I2CTransport::Config {name}_config;\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n {name}_config.address = {address};\n daisy::Icm20948I2C::Config {name}_main_conf;\n {name}_main_conf.transport_config = {name}_config;\n {name}.Init({name}_main_conf);", + "typename": "daisy::Icm20948I2C", + "direction": "in", + "pin": "scl,sda", + "address": "ICM20948_I2CADDR_DEFAULT", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "loopprocess": "{name}.Process();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetAccelVect().x", + "permit_scale": false + }, + { + "name": "{name}_accel_x", + "get": "{class_name}.{name}.GetAccelVect().x", + "permit_scale": false + }, + { + "name": "{name}_accel_y", + "get": "{class_name}.{name}.GetAccelVect().y", + "permit_scale": false + }, + { + "name": "{name}_accel_z", + "get": "{class_name}.{name}.GetAccelVect().z", + "permit_scale": false + }, + { + "name": "{name}_magnet_x", + "get": "{class_name}.{name}.GetMagVect().x", + "permit_scale": false + }, + { + "name": "{name}_magnet_y", + "get": "{class_name}.{name}.GetMagVect().y", + "permit_scale": false + }, + { + "name": "{name}_magnet_z", + "get": "{class_name}.{name}.GetMagVect().z", + "permit_scale": false + }, + { + "name": "{name}_gyro_x", + "get": "{class_name}.{name}.GetGyroVect().x", + "permit_scale": false + }, + { + "name": "{name}_gyro_y", + "get": "{class_name}.{name}.GetGyroVect().y", + "permit_scale": false + }, + { + "name": "{name}_gyro_z", + "get": "{class_name}.{name}.GetGyroVect().z", + "permit_scale": false + } + ] + }, + "Dps310": { + "map_init": "daisy::Dps310I2CTransport::Config {name}_config;\n {name}_config.address = {address};\n {name}_config.periph = {periph};\n {name}_config.speed = {speed};\n {name}_config.scl = som.GetPin({pin_scl});\n {name}_config.sda = som.GetPin({pin_sda});\n daisy::Dps310I2C::Config {name}_config_main;\n {name}_config_main.transport_config = {name}_config;\n {name}.Init({name}_config_main);", + "typename": "daisy::Dps310I2C", + "direction": "in", + "pin": "scl,sda", + "periph": "daisy::I2CHandle::Config::Peripheral::I2C_1", + "speed": "daisy::I2CHandle::Config::Speed::I2C_400KHZ", + "address": "DPS310_I2CADDR_DEFAULT", + "pressure": 1013, + "loopprocess": "{name}.Process();", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{name}.GetTemperature()", + "permit_scale": false + }, + { + "name": "{name}_temp", + "get": "{class_name}.{name}.GetTemperature()", + "permit_scale": false + }, + { + "name": "{name}_press", + "get": "{class_name}.{name}.GetPressure()", + "permit_scale": false + }, + { + "name": "{name}_alt", + "get": "{class_name}.{name}.GetAltitude({pressure})", + "permit_scale": false + } + ] + }, + "CodeClass": { + "map_init": "{name}.Init(&som);", + "typename": "", + "process": "", + "loopprocess": "", + "header_path": "", + "mapping": [] + }, + "CodeInput": { + "direction": "out", + "typename": "", + "parent": "", + "setter": "", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.{parent}.{setter}({value});", + "permit_scale": false + } + ] + }, + "CodeOutput": { + "direction": "in", + "typename": "", + "parent": "", + "getter": "", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{parent}.{getter}()", + "permit_scale": false + } + ] + } +} \ No newline at end of file diff --git a/source/component_defs_patchsm.json b/source/component_defs_patchsm.json new file mode 100644 index 0000000..7c12383 --- /dev/null +++ b/source/component_defs_patchsm.json @@ -0,0 +1,262 @@ +{ + "Switch": { + "map_init": "{name}.Init(daisy::patch_sm::DaisyPatchSM::{pin}, som.AudioCallbackRate(), {type}, {polarity}, {pull});", + "typename": "daisy::Switch", + "direction": "in", + "pin": "a", + "type": "daisy::Switch::TYPE_MOMENTARY", + "polarity": "daisy::Switch::POLARITY_INVERTED", + "pull": "daisy::Switch::PULL_UP", + "process": "{name}.Debounce();", + "updaterate": "{name}.SetUpdateRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Pressed()?1.f:0.f)", + "range": [0, 1], + "bool": false + }, + { + "name": "{name}_press", + "get": "({class_name}.{name}.Pressed()?1.f:0.f)", + "range": [0, 1], + "bool": false + }, + { + "name": "{name}_seconds", + "get": "({class_name}.{name}.TimeHeldMs()*0.001f)", + "bool": false + } + ] + }, + "Switch3": { + "map_init": "{name}.Init(daisy::patch_sm::DaisyPatchSM::{pin_a}, daisy::patch_sm::DaisyPatchSM::{pin_b}));", + "typename": "daisy::Switch3", + "direction": "in", + "pin": "a,b", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Read()*0.5f+0.5f)", + "range": [0, 2], + "bool": false + } + ] + }, + "Encoder": { + "map_init": "{name}.Init(daisy::patch_sm::DaisyPatchSM::{pin_a}, daisy::patch_sm::DaisyPatchSM::{pin_b}, daisy::patch_sm::DaisyPatchSM::{pin_click}, som.AudioCallbackRate());", + "typename": "daisy::Encoder", + "direction": "in", + "pin": "a,b,click", + "process": "{name}.Debounce();", + "updaterate": "{name}.SetUpdateRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{name}.Increment())", + "range": [-1, 1], + "bool": false + }, + { + "name": "{name}_press", + "get": "({class_name}.{name}.Pressed()?1.f:0.f)", + "range": [0, 1], + "bool": false + }, + { + "name": "{name}_rise", + "get": "({class_name}.{name}.RisingEdge()?1.f:0.f)", + "range": [0, 1], + "bool": true + }, + { + "name": "{name}_fall", + "get": "({class_name}.{name}.FallingEdge()?1.f:0.f)", + "range": [0, 1], + "bool": true + }, + { + "name": "{name}_seconds", + "get": "({class_name}.{name}.TimeHeldMs()*0.001f)", + "range": null, + "bool": false + } + ] + }, + "GateIn": { + "map_init": "{name}.Init(&daisy::patch_sm::DaisyPatchSM::{pin});", + "typename": "daisy::GateIn", + "direction": "in", + "pin": "a", + "default_prefix": "som.", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.{default_prefix}{name}.State()?1.f:0.f)", + "range": [0, 1], + "bool": false + }, + { + "name": "{name}_trig", + "get": "({class_name}.{default_prefix}{name}.Trig()?1.f:0.f)", + "range": [0, 1], + "bool": true + } + ] + }, + "AnalogControl": { + "init_single": "cfg[{i}].InitSingle(daisy::patch_sm::DaisyPatchSM::{pin});", + "map_init": "{name}.Init(som.adc.GetPtr({i}), som.AudioCallbackRate(), {flip}, {invert});", + "typename": "daisy::AnalogControl", + "direction": "in", + "pin": "a", + "flip": "false", + "invert": "false", + "slew": "1.0/som.AudioCallbackRate()", + "process": "{name}.Process();", + "updaterate": "{name}.SetSampleRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.som.GetAdcValue((int)daisy::patch_sm::{name_upper}))", + "range": [0, 1], + "bool": false + } + ] + }, + "AnalogControlBipolar": { + "init_single": "cfg[{i}].InitSingle(daisy::patch_sm::DaisyPatchSM::{pin});", + "map_init": "{name}.Init(som.adc.GetPtr({i}), som.AudioCallbackRate(), {flip}, {invert});", + "typename": "daisy::AnalogControl", + "direction": "in", + "pin": "a", + "flip": "false", + "invert": "false", + "slew": "1.0/som.AudioCallbackRate()", + "process": "{name}.Process();", + "updaterate": "{name}.SetSampleRate(som.AudioCallbackRate());", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.som.GetAdcValue((int)daisy::patch_sm::{name_upper}))", + "range": [-1, 1], + "bool": false + } + ] + }, + "Led": { + "map_init": "{name}.Init(daisy::patch_sm::DaisyPatchSM::{pin}, {invert});\n\t\t{name}.Set(0.0f);", + "typename": "daisy::Led", + "direction": "out", + "pin": "a", + "invert": "true", + "postprocess": "{name}.Update();", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.{name}.Set({value});" + } + ] + }, + "RgbLed": { + "map_init": "{name}.Init(daisy::patch_sm::DaisyPatchSM::{pin_r}, daisy::patch_sm::DaisyPatchSM::{pin_g}, daisy::patch_sm::DaisyPatchSM::{pin_b}, {invert});\n\t\t{name}.Set(0.0f, 0.0f, 0.0f);", + "typename": "daisy::RgbLed", + "direction": "out", + "pin": "r,g,b", + "invert": "true", + "postprocess": "{name}.Update();", + "mapping": [ + { + "name": "{name}_red", + "set": "{class_name}.{name}.SetRed({value});" + }, + { + "name": "{name}_green", + "set": "{class_name}.{name}.SetGreen({value});" + }, + { + "name": "{name}_blue", + "set": "{class_name}.{name}.SetBlue({value});" + }, + { + "name": "{name}", + "set": "{class_name}.{name}.Set(clamp(-{value}, 0.f, 1.f), 0.f, clamp({value}, 0.f, 1.f));" + }, + { + "name": "{name}_white", + "set": "{class_name}.{name}.Set({value},{value},{value});" + } + ] + }, + "GateOut": { + "map_init": "{name}.pin = daisy::patch_sm::DaisyPatchSM::{pin};\n\t\t{name}.mode = {mode};\n\t\t{name}.pull = {pull};\n\t\tdsy_gpio_init(&{name});", + "typename": "dsy_gpio", + "direction": "out", + "pin": "a", + "default_prefix": "som.", + "mode": "DSY_GPIO_MODE_OUTPUT_PP", + "pull": "DSY_GPIO_NOPULL", + "mapping": [ + { + "name": "{name}", + "set": "dsy_gpio_write(&{class_name}.{default_prefix}{name}, {value});" + } + ] + }, + "CVOuts": { + "map_init": "{name}.bitdepth = {bitdepth};\n\t\t{name}.buff_state = {buff_state};\n\t\t{name}.mode = {mode};\n\t\t{name}.chn = {channel};\n\t\tsom.dac.Init({name});\n\t\tsom.dac.WriteValue({channel}, 0);", + "typename": "daisy::DacHandle::Config", + "direction": "out", + "pin": "", + "bitdepth": "daisy::DacHandle::BitDepth::BITS_12", + "buff_state": "daisy::DacHandle::BufferState::ENABLED", + "mode": "daisy::DacHandle::Mode::POLLING", + "channel": "daisy::DacHandle::Channel::BOTH", + "mapping": [ + { + "name": "{name}1", + "set": "{class_name}.som.WriteCvOut(daisy::patch_sm::CV_OUT_1, {value} * 5.f);", + "where": "main" + }, + { + "name": "{name}2", + "set": "{class_name}.som.WriteCvOut(daisy::patch_sm::CV_OUT_2, {value} * 5.f);", + "where": "main" + } + ] + }, + "CodeClass": { + "map_init": "{name}.Init(&som);", + "typename": "", + "process": "", + "loopprocess": "", + "header_path": "", + "mapping": [] + }, + "CodeInput": { + "direction": "out", + "typename": "", + "parent": "", + "setter": "", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.{parent}.{setter}({value});", + "permit_scale": false + } + ] + }, + "CodeOutput": { + "direction": "in", + "typename": "", + "parent": "", + "getter": "", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{parent}.{getter}()", + "permit_scale": false + } + ] + } +} diff --git a/source/component_defs_petalsm.json b/source/component_defs_petalsm.json new file mode 100644 index 0000000..a40141a --- /dev/null +++ b/source/component_defs_petalsm.json @@ -0,0 +1,154 @@ +{ + "Switch": { + "map_init": "", + "typename": "", + "direction": "in", + "index": 1, + "updaterate": "", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.som.footswitch{index}.Pressed()?1.f:0.f)", + "range": [0, 1], + "bool": false + }, + { + "name": "{name}_press", + "get": "({class_name}.som.footswitch{index}.Pressed()?1.f:0.f)", + "range": [0, 1], + "bool": false + }, + { + "name": "{name}_seconds", + "get": "({class_name}.som.footswitch{index}.TimeHeldMs()*0.001f)", + "bool": false + } + ] + }, + "Switch3": { + "map_init": "", + "typename": "", + "direction": "in", + "index": 0, + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.som.toggle[{index}].Read()*0.5f+0.5f)", + "range": [0, 2], + "bool": false + } + ] + }, + "AnalogControl": { + "init_single": "", + "map_init": "", + "typename": "", + "direction": "in", + "index": 0, + "updaterate": "", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.som.knob[{index}].Value())", + "range": [0, 1], + "bool": false + } + ] + }, + "Expression": { + "direction": "in", + "mapping": [ + { + "name": "{name}", + "get": "({class_name}.som.GetExpressionValue())" + } + ] + }, + "Led": { + "map_init": "", + "typename": "", + "direction": "out", + "index": 2, + "postprocess": "", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.som.led[{index}].Set({value});" + } + ] + }, + "RgbLed": { + "map_init": "", + "typename": "", + "direction": "out", + "index": "r,g,b", + "mapping": [ + { + "name": "{name}_red", + "set": "{class_name}.som.led[{index_r}].Set({value});" + }, + { + "name": "{name}_green", + "set": "{class_name}.som.led[{index_g}].Set({value});" + }, + { + "name": "{name}_blue", + "set": "{class_name}.som.led[{index_b}].Set({value});" + }, + { + "name": "{name}", + "set": "{class_name}.som.led[{index_r}].Set(clamp(-{value}, 0.f, 1.f)); \n{class_name}.som.led[{index_g}].Set(0); \n{class_name}.som.led[{index_b}].Set(clamp({value}, 0.f, 1.f));" + }, + { + "name": "{name}_white", + "set": "{class_name}.som.led[{index_r}].Set({value}); \n{class_name}.som.led[{index_g}].Set({value}); \n{class_name}.som.led[{index_b}].Set({value});" + } + ] + }, + "Relay": { + "map_init": "", + "typename": "", + "direction": "out", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.som.SetBypassState({value});" + } + ] + }, + "CodeClass": { + "map_init": "{name}.Init(&som);", + "typename": "", + "process": "", + "loopprocess": "", + "header_path": "", + "mapping": [] + }, + "CodeInput": { + "direction": "out", + "typename": "", + "parent": "", + "setter": "", + "mapping": [ + { + "name": "{name}", + "set": "{class_name}.{parent}.{setter}({value});", + "permit_scale": false + } + ] + }, + "CodeOutput": { + "direction": "in", + "typename": "", + "parent": "", + "getter": "", + "mapping": [ + { + "name": "{name}", + "get": "{class_name}.{parent}.{getter}()", + "permit_scale": false + } + ] + } +} + diff --git a/source/daisy.field.json b/source/daisy.field.json deleted file mode 100644 index c508e8b..0000000 --- a/source/daisy.field.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "max_apps":8, - "defines": { - "OOPSY_TARGET_FIELD": 1, - "OOPSY_TARGET_HAS_OLED": 1, - "OOPSY_TARGET_HAS_MIDI_INPUT": 1, - "OOPSY_TARGET_HAS_MIDI_OUTPUT": 1 - }, - "inserts": [ - { "where": "header", "code": "#include \"daisy_field.h\"" }, - { "where": "header", "code": "typedef daisy::DaisyField Daisy;" } - ], - "labels": { - "params": { - "knob1": "kn1", - "knob2": "kn2", - "knob3": "kn3", - "knob4": "kn4", - "knob5": "kn5", - "knob6": "kn6", - "knob7": "kn7", - "knob8": "kn8", - "keyA1": "kB1", - "keyA2": "kB2", - "keyA3": "kB3", - "keyA4": "kB4", - "keyA5": "kB5", - "keyA6": "kB6", - "keyA7": "kB7", - "keyA8": "kB8", - "keyB1": "kA1", - "keyB2": "kA2", - "keyB3": "kA3", - "keyB4": "kA4", - "keyB5": "kA5", - "keyB6": "kA6", - "keyB7": "kA7", - "keyB8": "kA8", - "sw1": "sw1", - "sw2": "sw2", - "cv1": "cv1", - "cv2": "cv2", - "cv3": "cv3", - "cv4": "cv4", - "gate1": "gt1", - - "key1": "kA1", - "key2": "kA2", - "key3": "kA3", - "key4": "kA4", - "key5": "kA5", - "key6": "kA6", - "key7": "kA7", - "key8": "kA8", - "key9": "kB1", - "key10": "kB2", - "key11": "kB3", - "key12": "kB4", - "key13": "kB5", - "key14": "kB6", - "key15": "kB7", - "key16": "kB8", - "ctrl1": "kn1", - "ctrl2": "kn2", - "ctrl3": "kn3", - "ctrl4": "kn4", - "ctrl5": "kn5", - "ctrl6": "kn6", - "ctrl7": "kn7", - "ctrl8": "kn8", - "switch1": "sw1", - "switch2": "sw2", - - "knob": "kn", - "key": "kA1", - "ctrl": "kn", - "cv": "cv1", - "gate": "gt1", - "switch": "sw1" - }, - "outs": { - "cv": "cvout1", - "cv1": "cvout1", - "cv2": "cvout2", - "gate": "gateout1", - "gate1": "gateout1" - }, - "datas": { - "leds": "dsy_leds" - } - }, - "inputs": { - "kn1": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_1);" - }, - "kn2": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_2);" - }, - "kn3": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_3);" - }, - "kn4": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_4);" - }, - "kn5": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_5);" - }, - "kn6": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_6);" - }, - "kn7": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_7);" - }, - "kn8": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_8);" - }, - "kA1": { - "code": "(hardware.KeyboardState(0)?1.f:0.f);" - }, - "kA2": { - "code": "(hardware.KeyboardState(1)?1.f:0.f);" - }, - "kA3": { - "code": "(hardware.KeyboardState(2)?1.f:0.f);" - }, - "kA4": { - "code": "(hardware.KeyboardState(3)?1.f:0.f);" - }, - "kA5": { - "code": "(hardware.KeyboardState(4)?1.f:0.f);" - }, - "kA6": { - "code": "(hardware.KeyboardState(5)?1.f:0.f);" - }, - "kA7": { - "code": "(hardware.KeyboardState(6)?1.f:0.f);" - }, - "kA8": { - "code": "(hardware.KeyboardState(7)?1.f:0.f);" - }, - "kB1": { - "code": "(hardware.KeyboardState(8)?1.f:0.f);" - }, - "kB2": { - "code": "(hardware.KeyboardState(9)?1.f:0.f);" - }, - "kB3": { - "code": "(hardware.KeyboardState(10)?1.f:0.f);" - }, - "kB4": { - "code": "(hardware.KeyboardState(11)?1.f:0.f);" - }, - "kB5": { - "code": "(hardware.KeyboardState(12)?1.f:0.f);" - }, - "kB6": { - "code": "(hardware.KeyboardState(13)?1.f:0.f);" - }, - "kB7": { - "code": "(hardware.KeyboardState(14)?1.f:0.f);" - }, - "kB8": { - "code": "(hardware.KeyboardState(15)?1.f:0.f);" - }, - "sw1": { - "code": "(hardware.GetSwitch(0)->Pressed()?1.f:0.f);" - }, - "sw2": { - "code": "(hardware.GetSwitch(1)->Pressed()?1.f:0.f);" - }, - "cv1": { - "code": "hardware.GetCvValue(0);" - }, - "cv2": { - "code": "hardware.GetCvValue(1);" - }, - "cv3": { - "code": "hardware.GetCvValue(2);" - }, - "cv4": { - "code": "hardware.GetCvValue(3);" - }, - "gt1": { - "code": "(hardware.gate_in.State()?1.f:0.f);" - } - }, - "outputs": { - "cvout1": { - "where":"main", - "code": "hardware.SetCvOut1($ * 4095);" - }, - "cvout2": { - "where":"main", - "code": "hardware.SetCvOut2($ * 4095);" - }, - "gateout1": { - "where":"audio", - "code": "dsy_gpio_write(&hardware.gate_out, $ > 0.f);" - } - }, - "datahandlers": { - "dsy_leds": { - "where":"display", - "code": "daisy.setFieldLedsFromData($);" - } - } -} diff --git a/source/daisy.patch.json b/source/daisy.patch.json deleted file mode 100644 index 4e3fc0b..0000000 --- a/source/daisy.patch.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "max_apps":8, - "defines": { - "OOPSY_TARGET_PATCH": 1, - "OOPSY_TARGET_HAS_OLED": 1, - "OOPSY_IO_COUNT": 4, - "OOPSY_TARGET_HAS_MIDI_INPUT": 1, - "OOPSY_TARGET_HAS_MIDI_OUTPUT": 1, - "OOPSY_HAS_ENCODER": 1 - }, - "inserts": [ - { "where": "header", "code": "#include \"daisy_patch.h\"" }, - { "where": "header", "code": "typedef daisy::DaisyPatch Daisy;" } - ], - "labels": { - "params": { - "knob1": "kn1", - "knob2": "kn2", - "knob3": "kn3", - "knob4": "kn4", - "gate1": "gt1", - "gate2": "gt2", - - "knob": "kn1", - "cv": "kn1", - "cv1": "kn1", - "cv2": "kn2", - "cv3": "kn3", - "cv4": "kn4", - "ctrl": "kn1", - "ctrl1": "kn1", - "ctrl2": "kn2", - "ctrl3": "kn3", - "ctrl4": "kn4", - "gate": "gt1" - }, - "outs": { - "cv1": "cvout1", - "cv2": "cvout2", - "gate1": "gateout1", - - "cv": "cvout1", - "gate": "gateout1" - }, - "datas": { - "midi": "dsy_midi_out" - } - }, - "inputs": { - "kn1": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.CTRL_1);" - }, - "kn2": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.CTRL_2);" - }, - "kn3": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.CTRL_3);" - }, - "kn4": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.CTRL_4);" - }, - "gt1": { - "code": "(hardware.gate_input[hardware.GATE_IN_1].State()?1.f:0.f);" - }, - "gt2": { - "code": "(hardware.gate_input[hardware.GATE_IN_2].State()?1.f:0.f);" - } - }, - "outputs": { - "cvout1": { - "where": "main", - "code": "hardware.seed.dac.WriteValue(daisy::DacHandle::Channel::ONE, $ * 4095);" - }, - "cvout2": { - "where": "main", - "code": "hardware.seed.dac.WriteValue(daisy::DacHandle::Channel::TWO, $ * 4095);" - }, - "gateout1": { - "where": "audio", - "code": "dsy_gpio_write(&hardware.gate_output, $ > 0.f);" - } - }, - "datahandlers": { - "dsy_midi_out": { - "where":"main", - "init": "daisy.midi_nullData($)", - "code": "daisy.midi_fromData($);" - } - } -} diff --git a/source/daisy.patch_sm.json b/source/daisy.patch_sm.json deleted file mode 100644 index 44167a3..0000000 --- a/source/daisy.patch_sm.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "max_apps":8, - "defines": { - "OOPSY_TARGET_PATCH_SM": 1, - "OOPSY_IO_COUNT": 2 - }, - "inserts": [ - { "where": "header", "code": "#include \"daisy_patch_sm.h\"" }, - { "where": "header", "code": "typedef daisy::patch_sm::DaisyPatchSM Daisy;" }, - { "where": "header", "code": "daisy::Switch sw_class;" }, - { "where": "init", "code": "sw_class.Init(oopsy::daisy.hardware.B8, 1000);"}, - { "where": "audio", "code": "sw_class.Debounce();" }, - - { "where": "header", "code": "daisy::Switch button_class;" }, - { "where": "init", "code": "button_class.Init(oopsy::daisy.hardware.B7, 1000);"}, - { "where": "audio", "code": "button_class.Debounce();" } - ], - "labels": { - "params": { - "knob1": "kn1", - "knob2": "kn2", - "knob3": "kn3", - "knob4": "kn4", - "gate1": "gt1", - "gate2": "gt2", - - "sw": "sw", - "sw1": "sw", - "sw2": "button", - "button": "button", - "press": "button", - - "knob": "kn1", - "cv": "kn1", - "cv1": "kn1", - "cv2": "kn2", - "cv3": "kn3", - "cv4": "kn4", - "cv5": "cv5", - "cv6": "cv6", - "cv7": "cv7", - "cv8": "cv8", - - "ctrl": "kn1", - "ctrl1": "kn1", - "ctrl2": "kn2", - "ctrl3": "kn3", - "ctrl4": "kn4", - - "gate": "gt1", - - "CV_1": "kn1", - "CV_2": "kn2", - "CV_3": "kn3", - "CV_4": "kn4", - "CV_5": "cv5", - "CV_6": "cv6", - "CV_7": "cv7", - "CV_8": "cv8", - - "B7": "button", - "B8": "sw", - - "B10": "gt1", - "B9": "gt2", - "gate_in_1": "gt1", - "gate_in_2": "gt2" - }, - "outs": { - "cvout1": "cvout1", - "cvout2": "cvout2", - - "cv1": "cvout1", - "cv2": "cvout2", - "gate1": "gateout1", - "gate2": "gateout2", - - "cv": "cvout1", - "led": "cvout2", - "gate": "gateout1", - - "CV_OUT_1": "cvout1", - "C10": "cvout1", - "CV_OUT_2": "cvout2", - - "B5": "gateout1", - "B6": "gateout2", - "gate_out_1": "gateout1", - "gate_out_2": "gateout2" - }, - "datas": {} - }, - "inputs": { - "kn1": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_1);" - }, - "kn2": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_2);" - }, - "kn3": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_3);" - }, - "kn4": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_4);" - }, - "cv5": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_5);" - }, - "cv6": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_6);" - }, - "cv7": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_7);" - }, - "cv8": { - "automap": true, - "code": "hardware.GetAdcValue(daisy::patch_sm::CV_8);" - }, - "gt1": { - "code": "(hardware.gate_in_1.State()?1.f:0.f);" - }, - "gt2": { - "code": "(hardware.gate_in_2.State()?1.f:0.f);" - }, - "button": { - "code": "(button_class.Pressed() ? 1.f : 0.f);" - }, - "sw": { - "code": "(sw_class.Pressed() ? 1.f : 0.f);" - } - }, - "outputs": { - "cvout1": { - "where": "main", - "code": "hardware.WriteCvOut(daisy::patch_sm::CV_OUT_1, $ * 5.f);" - }, - "cvout2": { - "where": "main", - "code": "hardware.WriteCvOut(daisy::patch_sm::CV_OUT_2, $ * 5.f);" - }, - "gateout1": { - "where": "audio", - "code": "dsy_gpio_write(&hardware.gate_out_1, $ > 0.f);" - }, - "gateout2": { - "where": "audio", - "code": "dsy_gpio_write(&hardware.gate_out_2, $ > 0.f);" - } - }, - "datahandlers": {} -} diff --git a/source/daisy.petal.json b/source/daisy.petal.json deleted file mode 100644 index c6eab52..0000000 --- a/source/daisy.petal.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "max_apps":8, - "defines": { - "OOPSY_TARGET_PETAL": 1, - "OOPSY_HAS_ENCODER": 1 - }, - "inserts": [ - { "where": "header", "code": "#include \"daisy_petal.h\"" }, - { "where": "header", "code": "typedef daisy::DaisyPetal Daisy;" } - ], - "labels": { - "params": { - "knob1": "kn1", - "knob2": "kn2", - "knob3": "kn3", - "knob4": "kn4", - "knob5": "kn5", - "knob6": "kn6", - "sw1": "sw1", - "sw2": "sw2", - "sw3": "sw3", - "sw4": "sw4", - "sw5": "sw5", - "sw6": "sw6", - "sw7": "sw7", - "exp1": "exp", - - "ctrl1": "kn1", - "ctrl2": "kn2", - "ctrl3": "kn3", - "ctrl4": "kn4", - "ctrl5": "kn5", - "ctrl6": "kn6", - "switch1": "sw1", - "switch2": "sw2", - "switch3": "sw3", - "switch4": "sw4", - "switch5": "sw5", - "switch6": "sw6", - "switch7": "sw7", - "knob": "kn1", - "ctrl": "kn1", - "switch": "sw1", - "exp": "exp", - "expression": "exp" - }, - "outs": { - "led1": "led1", - "led2": "led2", - "led3": "led3", - "led4": "led4" - }, - "datas": {} - }, - "inputs": { - "kn1": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_1);" - }, - "kn2": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_2);" - }, - "kn3": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_3);" - }, - "kn4": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_4);" - }, - "kn5": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_5);" - }, - "kn6": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_6);" - }, - "sw1": { - "code": "(hardware.switches[0].Pressed()?1.f:0.f);" - }, - "sw2": { - "code": "(hardware.switches[1].Pressed()?1.f:0.f);" - }, - "sw3": { - "code": "(hardware.switches[2].Pressed()?1.f:0.f);" - }, - "sw4": { - "code": "(hardware.switches[3].Pressed()?1.f:0.f);" - }, - "sw5": { - "code": "(hardware.switches[4].Pressed()?1.f:0.f);" - }, - "sw6": { - "code": "(hardware.switches[5].Pressed()?1.f:0.f);" - }, - "sw7": { - "code": "(hardware.switches[6].Pressed()?1.f:0.f);" - }, - "exp": { - "code": "(hardware.GetExpression());" - } - }, - "outputs": { - "led1": { - "where": "display", - "code": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_1, $);" - }, - "led2": { - "where": "display", - "code": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_2, $);" - }, - "led3": { - "where": "display", - "code": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_3, $);" - }, - "led4": { - "where": "display", - "code": "hardware.SetFootswitchLed(daisy::DaisyPetal::FOOTSWITCH_LED_4, $);" - } - }, - "datahandlers": { - } -} \ No newline at end of file diff --git a/source/daisy.pod.json b/source/daisy.pod.json deleted file mode 100644 index 4005887..0000000 --- a/source/daisy.pod.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "max_apps":1, - "defines": { - "OOPSY_TARGET_POD": 1, - "OOPSY_TARGET_HAS_MIDI_INPUT": 1, - "OOPSY_HAS_ENCODER": 1 - }, - "inserts": [ - { "where": "header", "code": "#include \"daisy_pod.h\"" }, - { "where": "header", "code": "typedef daisy::DaisyPod Daisy;" }, - { "where": "post_audio", "code": "hardware.UpdateLeds();" } - ], - "labels": { - "params": { - "knob1": "kn1", - "knob2": "kn2", - "sw1": "sw1", - "sw2": "sw2", - "sw3": "enp", - "encoder": "enc", - - "ctrl1": "kn1", - "ctrl2": "kn2", - "switch1": "sw1", - "switch2": "sw2", - "switch3": "enp", - "knob": "kn1", - "ctrl": "kn1", - "switch": "sw1", - "press": "enp" - }, - "outs": { - "led1": "led1", - "led2": "led2", - - "led": "led1" - }, - "datas": {} - }, - "inputs": { - "kn1": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_1);" - }, - "kn2": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_2);" - }, - "sw1": { - "code": "(hardware.button1.Pressed()?1.f:0.f);" - }, - "sw2": { - "code": "(hardware.button2.Pressed()?1.f:0.f);" - }, - "enc": { - "code": "(hardware.encoder.Increment()*0.5f+0.5f);" - }, - "enp": { - "code": "(hardware.encoder.Pressed());" - } - }, - "outputs": { - "led1": { - "where": "audio", - "code": "hardware.led1.Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f);" - }, - "led2": { - "where": "audio", - "code": "hardware.led2.Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f);" - } - }, - "datahandlers": {} -} \ No newline at end of file diff --git a/source/daisy.versio.json b/source/daisy.versio.json deleted file mode 100644 index 9f0a7bb..0000000 --- a/source/daisy.versio.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "max_apps":1, - "defines": { - "OOPSY_TARGET_VERSIO": 1 - }, - "inserts": [ - { "where": "header", "code": "#include \"daisy_versio.h\"" }, - { "where": "header", "code": "typedef daisy::DaisyVersio Daisy;" }, - { "where": "post_audio", "code": "hardware.UpdateLeds();" } - ], - "labels": { - "params": { - "knob1": "kn1", - "knob2": "kn2", - "knob3": "kn3", - "knob4": "kn4", - "knob5": "kn5", - "knob6": "kn6", - "knob7": "kn7", - "button1": "bt1", - "sw1": "sw1", - "sw2": "sw2", - "gate1": "gt1", - - "cv1": "kn1", - "cv2": "kn2", - "cv3": "kn3", - "cv4": "kn4", - "cv5": "kn5", - "cv6": "kn6", - "cv7": "kn7", - "ctrl1": "kn1", - "ctrl2": "kn2", - "ctrl3": "kn3", - "ctrl4": "kn4", - "ctrl5": "kn5", - "ctrl6": "kn6", - "ctrl7": "kn7", - "switch1": "sw1", - "switch2": "sw2", - - "knob": "kn1", - "button": "bt1", - "ctrl": "kn1", - "cv": "kn1", - "switch": "sw1", - "gate": "gt1", - - "tap": "bt1", - "fsu": "bt1", - "abc": "sw1", - "xyz": "sw2" - }, - "outs": { - "led1": "led1", - "led2": "led2", - "led3": "led3", - "led4": "led4" - }, - "datas": {} - }, - "inputs": { - "kn1": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_0);" - }, - "kn2": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_1);" - }, - "kn3": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_2);" - }, - "kn4": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_3);" - }, - "kn5": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_4);" - }, - "kn6": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_5);" - }, - "kn7": { - "automap": true, - "code": "hardware.GetKnobValue(hardware.KNOB_6);" - }, - "sw1": { - "code": "(hardware.sw[0].Read()/2.f);" - }, - "sw2": { - "code": "(hardware.sw[1].Read()/2.f);" - }, - "bt1": { - "code": "(hardware.tap.Pressed()?1.f:0.f);", - "update": { - "where": "audio", - "code": "hardware.tap.Debounce();" - } - }, - "gt1": { - "code": "(hardware.Gate()?1.f:0.f);" - } - }, - "outputs": { - "led1": { - "where": "audio", - "code": "hardware.leds[0].Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f);" - }, - "led2": { - "where": "audio", - "code": "hardware.leds[1].Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f);" - }, - "led3": { - "where": "audio", - "code": "hardware.leds[2].Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f);" - }, - "led4": { - "where": "audio", - "code": "hardware.leds[3].Set(clamp(-$, 0.f, 1.f), clamp($, 0.f, 1.f), 0.f);" - } - }, - "datahandlers": {} -} \ No newline at end of file diff --git a/source/daisy_glue.js b/source/daisy_glue.js new file mode 100644 index 0000000..f751471 --- /dev/null +++ b/source/daisy_glue.js @@ -0,0 +1,255 @@ +const assert = require("assert"); + +function stringFormatMap(template, formatMap) +{ + if (typeof template === 'undefined') + return ''; + const format_match = /{\s*([^{}\s]*)\s*}/g; + const open_curly = /{{/g; + const close_curly = /}}/g; + let pass1 = template.replace(open_curly, () => { + return '{' + }); + let pass2 = pass1.replace(close_curly, () => { + return '}' + }); + let pass3 = pass2.replace(format_match, (substring, value, index) => { + return value in formatMap ? formatMap[value] : ''; + }); + return pass3; +} + +// .filter for objects that returns object +Object.filter = (obj, predicate) => + Object.keys(obj).filter(key => predicate(obj[key])) + .map(key => obj[key]); + +function filter_match(sequence, key, match, key_exclude = null, match_exclude = null) +{ + if (key_exclude !== null && match_exclude !== null) + { + return Object.filter(sequence, item => key in item && item[key] == match && ((item[key_exclude] || null) != match_exclude)); + } + else + return Object.filter(sequence, item => key in item && item[key] == match); +} + +function verify_param_exists(name, original_name, components, input=true) +{ + for (let comp of components) + { + if (comp.component == 'CVOuts') + { + if (name == comp.name) + { + assert(!input, `Parameter ${original_name} cannot be used as an ${input ? 'input' : 'output'}`); + return; + } + } + else + { + let variants = comp.mapping.map(item => stringFormatMap(item.name, comp)); + if (variants.includes(name)) + { + assert((input && comp.direction == 'input') || (!input && comp.direction == 'output'), + `Parameter ${original_name} cannot be used as an ${input ? 'input' : 'output'}`); + return; + } + } + } + assert(false, `Unkown parameter ${original_name}`); +} + +function verify_param_direction(name, components) +{ + for (let comp of components) + { + if (comp.component == 'CVOuts') + { + if (name == comp.name) + return true; + } + else + { + let variants = comp.mapping.map(item => stringFormatMap(item.name, comp)); + if (variants.includes(name)) + return true; + } + } + return false; +} + +function get_root_component(variant, original_name, components) +{ + for (let comp of components) + { + if (comp.component == 'CVOuts') + { + if (variant == comp.name) + return variant; + } + else + { + let variants = comp.mapping.map(item => stringFormatMap(item.name, comp)); + if (variants.includes(variant)) + return comp.name; + } + } + assert(false, `Unkown parameter ${original_name}`); +} + +function get_component_mapping(component_variant, original_name, component, components) +{ + for (let variant of component.mapping) + { + if (component.component == 'CVOuts') + { + let stripped = stringFormatMap(variant.name, {name: ''}); + if (component.name.includes(stripped)) + return variant; + } + else if (stringFormatMap(variant.name, component) == component_variant) + return variant; + } + assert(false, `Unkown parameter ${original_name}`); +} + + +function verify_param_used(component, params_in, params_out, params_in_original_name, params_out_original_name, components) +{ + // Exclude parents, since they don't have 1-1 i/o mapping + if (component.is_parent || false) + return true; + + let combined_params; + Object.assign(combined_params, params_in, params_out); + let combined_names; + Object.assign(combined_names, params_in_original_name, params_out_original_name); + for (let param in combined_params) + { + let root = get_root_component(param, combined_names[param], components); + if (root == component.name) + return true; + } + return false; +} + +function de_alias(name, aliases, components) +{ + let low = name.toLowerCase(); + // simple case + if (aliases.includes(low)) + return aliases[low]; + // aliased variant + let potential_aliases = Object.filter(aliases, item => low.includes(item)); + for (let alias of potential_aliases) + { + target_component = filter_match(components, 'name', aliases[alias])[0] || undefined; + if (typeof target_component === 'undefined') + continue; + if (target_component.component != 'CVOuts') + { + for (let mapping of target_component.mapping) + { + if (stringFormatMap(mapping.name, {name: alias}) == low) + return stringFormatMap(mapping.name, {name: aliases[alias]}); + } + } + } + // otherwise, it's a direct parameter or unkown one + return low; +} + +// Parses the `parameters` passed from oopsy and generates getters and setters +// according to the info in `components`. The `aliases` help disambiguate parameters +// and the `object_name` sets the identifier for the generated Daisy hardware class. +exports.parse_parameters = function parse_parameters(parameters, components, aliases, object_name) +{ + // Verify that the params are valid and remove unused components + let replacements = {}; + + let params_in = {}; + let params_in_original_names = {}; + for (property in parameters.in) + { + let de_aliased = de_alias(property, aliases, components); + params_in[de_aliased] = parameters.in[property]; + params_in_original_names[de_aliased] = property; + } + + let params_out = {}; + let params_out_original_names = {}; + for (property in parameters.out) + { + let de_aliased = de_alias(property, aliases, components); + params_out[de_aliased] = parameters.out[property]; + params_out_original_names[de_aliased] = property; + } + + for (property in params_in) + verify_param_exists(property, params_in_original_names[property], components, input=true); + for (property in params_out) + verify_param_exists(property, params_out_original_names[property], components, input=false); + + for (let i = components.length - 1; i > -1; i--) + { + let used = verify_param_used(components[i], params_in, params_out, + params_in_original_names, params_out_original_names, components); + if (!used) + components.splice(i, 1); + } + + let out_idx = 0; + replacements.parameters = []; + replacements.output_parameters = []; + replacements.callback_write_out = []; + replacements.loop_write_out = ''; + replacements.callback_write_in = []; + + for (let param_name in params_in) + { + root = get_root_component(param_name, params_in_original_names[param_name], components); + let component = filter_match(components, 'name', root)[0]; + let param_struct = { + name: root, + type: component.component.toUpperCase() + }; + replacements.parameters.push(param_struct); + let mapping = get_component_mapping(param_name, params_in_original_names[param_name], component, components); + + let component_info; + Object.assign(component_info, component); + component_info.name = root; + component_info.class_name = object_name; + component_info.name_upper = root.toUpperCase(); + component_info.value = `output_data[${out_idx}]`; + component_info.default_prefix = (component.is_default || false) ? component.default_prefix || '' : ''; + let process = stringFormatMap(mapping.get, component_info); + replacements.callback_write_in.push({process: process, bool: mapping.bool}); + } + + for (let param_name in params_out) + { + root = get_root_component(param_name, params_in_original_names[param_name], components); + let component = filter_match(components, 'name', root)[0]; + let param_struct = { + name: root, + index: out_idx + }; + replacements.output_parameters.push(param_struct); + let mapping = get_component_mapping(param_name, params_out_original_names[param_name], component, components); + let write_location = (mapping.where || 'callback') == 'callback' ? 'callback_write_out' : 'loop_write_out'; + let component_info; + Object.assign(component_info, component); + component_info.name = root; + component_info.class_name = object_name; + component_info.value = `output_data[${out_idx}]`; + component_info.default_prefix = (component.is_default || false) ? component.default_prefix || '' : ''; + let write = stringFormatMap(mapping.set, component_info); + replacements[write_location] += `\n ${write}`; + } + + replacements.output_comps = replacements.output_parameters.length; + + return replacements; +} \ No newline at end of file diff --git a/source/field.json b/source/field.json new file mode 100644 index 0000000..72f93cb --- /dev/null +++ b/source/field.json @@ -0,0 +1,399 @@ +{ + "name": "field", + "som": "seed", + "defines": { + "OOPSY_TARGET_FIELD": 1, + "OOPSY_TARGET_HAS_OLED": 1, + "OOPSY_TARGET_HAS_MIDI_INPUT": 1, + "OOPSY_TARGET_HAS_MIDI_OUTPUT": 1 + }, + "max_apps": 8, + "display": {}, + "audio": { + "channels": 2 + }, + "parents": { + "i2c": { + "component": "i2c", + "pin": { + "scl": 11, + "sda": 12 + } + }, + "led_driver": { + "component": "PCA9685", + "address": "{0x00, 0x02}", + "parent": "i2c", + "driver_count": 2 + }, + "pad_shift": { + "component": "CD4021", + "driver_count": 2, + "pin": { + "clk": 28, + "cs": 27, + "data": 26 + } + }, + "pot_mux": { + "component": "CD4051", + "mux_count": 8, + "pin": { + "adc": 16, + "sel0": 21, + "sel1": 20, + "sel2": 19 + } + } + }, + "components": { + "sw1": { + "component": "Switch", + "pin": 30 + }, + "sw2": { + "component": "Switch", + "pin": 29 + }, + "cv1": { + "component": "AnalogControlBipolar", + "pin": 17 + }, + "cv2": { + "component": "AnalogControlBipolar", + "pin": 18 + }, + "cv3": { + "component": "AnalogControlBipolar", + "pin": 25 + }, + "cv4": { + "component": "AnalogControlBipolar", + "pin": 24 + }, + "knob1": { + "component": "CD4051AnalogControl", + "index": 0, + "parent": "pot_mux" + }, + "knob2": { + "component": "CD4051AnalogControl", + "index": 3, + "parent": "pot_mux" + }, + "knob3": { + "component": "CD4051AnalogControl", + "index": 1, + "parent": "pot_mux" + }, + "knob4": { + "component": "CD4051AnalogControl", + "index": 4, + "parent": "pot_mux" + }, + "knob5": { + "component": "CD4051AnalogControl", + "index": 2, + "parent": "pot_mux" + }, + "knob6": { + "component": "CD4051AnalogControl", + "index": 5, + "parent": "pot_mux" + }, + "knob7": { + "component": "CD4051AnalogControl", + "index": 6, + "parent": "pot_mux" + }, + "knob8": { + "component": "CD4051AnalogControl", + "index": 7, + "parent": "pot_mux" + }, + "cvout": { + "component": "CVOuts" + }, + "gatein": { + "component": "GateIn", + "pin": 0 + }, + "gateout": { + "component": "GateOut", + "pin": 15 + }, + "pada1": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 15 + }, + "pada2": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 14 + }, + "pada3": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 13 + }, + "pada4": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 12 + }, + "pada5": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 11 + }, + "pada6": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 10 + }, + "pada7": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 9 + }, + "pada8": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 8 + }, + "padb1": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 7 + }, + "padb2": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 6 + }, + "padb3": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 5 + }, + "padb4": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 4 + }, + "padb5": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 3 + }, + "padb6": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 2 + }, + "padb7": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 1 + }, + "padb8": { + "component": "CD4021Switch", + "parent": "pad_shift", + "index": 0 + }, + "led_key_b1": { + "component": "PCA9685Led", + "index": 15, + "parent": "led_driver" + }, + "led_key_b2": { + "component": "PCA9685Led", + "index": 14, + "parent": "led_driver" + }, + "led_key_b3": { + "component": "PCA9685Led", + "index": 13, + "parent": "led_driver" + }, + "led_key_b4": { + "component": "PCA9685Led", + "index": 12, + "parent": "led_driver" + }, + "led_key_b5": { + "component": "PCA9685Led", + "index": 11, + "parent": "led_driver" + }, + "led_key_b6": { + "component": "PCA9685Led", + "index": 10, + "parent": "led_driver" + }, + "led_key_b7": { + "component": "PCA9685Led", + "index": 9, + "parent": "led_driver" + }, + "led_key_b8": { + "component": "PCA9685Led", + "index": 8, + "parent": "led_driver" + }, + "led_key_a1": { + "component": "PCA9685Led", + "index": 0, + "parent": "led_driver" + }, + "led_key_a2": { + "component": "PCA9685Led", + "index": 1, + "parent": "led_driver" + }, + "led_key_a3": { + "component": "PCA9685Led", + "index": 2, + "parent": "led_driver" + }, + "led_key_a4": { + "component": "PCA9685Led", + "index": 3, + "parent": "led_driver" + }, + "led_key_a5": { + "component": "PCA9685Led", + "index": 4, + "parent": "led_driver" + }, + "led_key_a6": { + "component": "PCA9685Led", + "index": 5, + "parent": "led_driver" + }, + "led_key_a7": { + "component": "PCA9685Led", + "index": 6, + "parent": "led_driver" + }, + "led_key_a8": { + "component": "PCA9685Led", + "index": 7, + "parent": "led_driver" + }, + "led_knob_1": { + "component": "PCA9685Led", + "index": 16, + "parent": "led_driver" + }, + "led_knob_2": { + "component": "PCA9685Led", + "index": 17, + "parent": "led_driver" + }, + "led_knob_3": { + "component": "PCA9685Led", + "index": 18, + "parent": "led_driver" + }, + "led_knob_4": { + "component": "PCA9685Led", + "index": 19, + "parent": "led_driver" + }, + "led_knob_5": { + "component": "PCA9685Led", + "index": 20, + "parent": "led_driver" + }, + "led_knob_6": { + "component": "PCA9685Led", + "index": 21, + "parent": "led_driver" + }, + "led_knob_7": { + "component": "PCA9685Led", + "index": 22, + "parent": "led_driver" + }, + "led_knob_8": { + "component": "PCA9685Led", + "index": 23, + "parent": "led_driver" + } + }, + "aliases": { + "cvout": "cvout1", + "gate": "gatein", + "gate1": "gatein", + "gateout1": "gateout", + "switch": "sw1", + "button": "sw1", + "switch1": "sw1", + "button1": "sw1", + "switch2": "sw2", + "button2": "sw2", + "encswitch": "encoder_rise", + "enp": "encoder_press", + "switch3": "encoder_rise", + "press": "encoder_press", + "knob": "knob1", + "ctrl": "knob1", + "ctrl1": "knob1", + "ctrl2": "knob2", + "ctrl3": "knob3", + "ctrl4": "knob4", + "ctrl5": "knob5", + "ctrl6": "knob6", + "ctrl7": "knob7", + "ctrl8": "knob8", + "led": "led1", + "keyA1": "pada1", + "keyA2": "pada2", + "keyA3": "pada3", + "keyA4": "pada4", + "keyA5": "pada5", + "keyA6": "pada6", + "keyA7": "pada7", + "keyA8": "pada8", + "keyB1": "padb1", + "keyB2": "padb2", + "keyB3": "padb3", + "keyB4": "padb4", + "keyB5": "padb5", + "keyB6": "padb6", + "keyB7": "padb7", + "keyB8": "padb8", + "key1": "pada1", + "key2": "pada2", + "key3": "pada3", + "key4": "pada4", + "key5": "pada5", + "key6": "pada6", + "key7": "pada7", + "key8": "pada8", + "key9": "padb1", + "key10": "padb2", + "key11": "padb3", + "key12": "padb4", + "key13": "padb5", + "key14": "padb6", + "key15": "padb7", + "key16": "padb8", + "leds": "dsy_leds" + }, + "datahandlers": { + "dsy_leds": { + "where": "display", + "code": "daisy.setFieldLedsFromData($);" + } + }, + "labels": { + "datas": { + "leds": "dsy_leds" + }, + "params": {}, + "outs": {} + } +} diff --git a/source/genlib_daisy.h b/source/genlib_daisy.h index 527c7f7..7be7646 100644 --- a/source/genlib_daisy.h +++ b/source/genlib_daisy.h @@ -39,6 +39,15 @@ static uint32_t rx_size = 0; static bool update = false; #endif +// A temproary measure to preserve Field compatibility +#ifdef OOPSY_TARGET_FIELD +#include "daisy_field.h" +#endif + +#ifdef OOPSY_TARGET_PETAL +#include "petal_led_hardcode.h" +#endif + ////////////////////////// DAISY EXPORT INTERFACING ////////////////////////// #define OOPSY_MIDI_BUFFER_SIZE (1024) @@ -46,7 +55,7 @@ static bool update = false; #define OOPSY_SUPER_LONG_PRESS_MS (20000) #define OOPSY_DISPLAY_PERIOD_MS 10 #define OOPSY_SCOPE_MAX_ZOOM (8) -static const uint32_t OOPSY_SRAM_SIZE = 512 * 1024; +static const uint32_t OOPSY_SRAM_SIZE = 512 * 1024; static const uint32_t OOPSY_SDRAM_SIZE = 64 * 1024 * 1024; // Added dedicated global SDFile to replace old global from libDaisy @@ -61,7 +70,10 @@ namespace oopsy { void init() { if (!sram_pool) sram_pool = (char *)malloc(OOPSY_SRAM_SIZE); - sram_usable = OOPSY_SRAM_SIZE; + // There's no guarantee the allocation will actually be + // of size "OOPSY_SRAM_SIZE," so this just clamps the + // usable space to what it really is. + sram_usable = (0x24080000 - 1024) - ((size_t) sram_pool); sram_used = 0; sdram_usable = OOPSY_SDRAM_SIZE; sdram_used = 0; @@ -149,10 +161,18 @@ namespace oopsy { struct GenDaisy { Daisy hardware; - #ifdef OOPSY_TARGET_PATCH_SM - Daisy *sub_board = &hardware; + #ifdef OOPSY_SOM_PETAL_SM + daisy::Petal125BSM *som = &hardware.som; #else - daisy::DaisySeed *sub_board = &hardware.seed; + #ifdef OOPSY_SOM_PATCH_SM + daisy::patch_sm::DaisyPatchSM *som = &hardware.som; + #else + #ifdef OOPSY_OLD_JSON + daisy::DaisySeed *som = &hardware.seed; + #else + daisy::DaisySeed *som = &hardware.som; + #endif + #endif #endif AppDef * appdefs = nullptr; @@ -397,7 +417,7 @@ namespace oopsy { mainloopCallback = nullMainloopCallback; displayCallback = nullMainloopCallback; nullAudioCallbackRunning = false; - sub_board->ChangeAudioCallback(nullAudioCallback); + som->ChangeAudioCallback(nullAudioCallback); while (!nullAudioCallbackRunning) daisy::System::Delay(1); // reset memory oopsy::init(); @@ -411,9 +431,9 @@ namespace oopsy { paramCallback = newapp.staticParamCallback; #endif - sub_board->ChangeAudioCallback(newapp.staticAudioCallback); + som->ChangeAudioCallback(newapp.staticAudioCallback); log("gen~ %s", appdefs[app_selected].name); - log("SR %dkHz / %dHz", (int)(sub_board->AudioSampleRate()/1000), (int)sub_board->AudioCallbackRate()); + log("SR %dkHz / %dHz", (int)(som->AudioSampleRate()/1000), (int)som->AudioCallbackRate()); { log("%d%s/%dKB+%d%s/%dMB", oopsy::sram_used > 1024 ? oopsy::sram_used/1024 : oopsy::sram_used, @@ -458,9 +478,9 @@ namespace oopsy { mode = 0; #ifdef OOPSY_USE_USB_SERIAL_INPUT - sub_board->usb.Init(daisy::UsbHandle::FS_INTERNAL); + som->usb.Init(daisy::UsbHandle::FS_INTERNAL); daisy::System::Delay(500); - sub_board->usb.SetReceiveCallback(UsbCallback, daisy::UsbHandle::FS_INTERNAL); + som->usb.SetReceiveCallback(UsbCallback, daisy::UsbHandle::FS_INTERNAL); #endif #ifdef OOPSY_USE_LOGGING @@ -483,8 +503,7 @@ namespace oopsy { console_line = console_rows-1; #endif - sub_board->adc.Start(); - sub_board->StartAudio(nullAudioCallback); + som->StartAudio(nullAudioCallback); mainloopCallback = nullMainloopCallback; displayCallback = nullMainloopCallback; @@ -524,7 +543,9 @@ namespace oopsy { t = t1; // pulse seed LED for status according to CPU usage: - sub_board->SetLed((t % 1000)/10 <= uint32_t(audioCpuUsage)); + #ifndef OOPSY_SOM_PETAL_SM + som->SetLed((t % 1000)/10 <= uint32_t(audioCpuUsage)); + #endif if (app_load_scheduled) { app_load_scheduled = 0; @@ -552,7 +573,7 @@ namespace oopsy { if (uitimer.ready(dt)) { #ifdef OOPSY_USE_LOGGING - sub_board->PrintLine("the time is"FLT_FMT3"", FLT_VAR3(t/1000.f)); + som->PrintLine("the time is"FLT_FMT3"", FLT_VAR3(t/1000.f)); #endif #ifdef OOPSY_USE_USB_SERIAL_INPUT if(update && rx_size > 0) { @@ -567,7 +588,7 @@ namespace oopsy { hardware.display.Fill(false); #endif #ifdef OOPSY_TARGET_PETAL - hardware.ClearLeds(); + hardware.led_driver.SetAllTo((uint8_t) 0); #endif if (menu_button_held_ms > OOPSY_LONG_PRESS_MS) { @@ -582,7 +603,8 @@ namespace oopsy { #endif for(int i = 0; i < 8; i++) { float white = (i == app_selecting || menu_button_released); - hardware.SetRingLed((daisy::DaisyPetal::RingLed)i, + + SetRingLed(&hardware.led_driver, (daisy::DaisyPetal::RingLed)i, (i == app_selected || white) * 1.f, white * 1.f, (i < app_count) * 0.3f + white * 1.f @@ -590,22 +612,22 @@ namespace oopsy { } #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 + // #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 // Handle encoder increment actions: if (is_mode_selecting) { @@ -797,7 +819,7 @@ namespace oopsy { } break; case SCOPEOPTION_ZOOM: { // each pixel is zoom samples; zoom/samplerate seconds - float scope_duration = OOPSY_OLED_DISPLAY_WIDTH*(1000.f*zoomlevel/sub_board->AudioSampleRate()); + float scope_duration = OOPSY_OLED_DISPLAY_WIDTH*(1000.f*zoomlevel/som->AudioSampleRate()); int offset = snprintf(scope_label, console_cols, "%dx %dms", zoomlevel, (int)ceilf(scope_duration)); hardware.display.SetCursor(0, h - font.FontHeight); hardware.display.WriteString(scope_label, font, true); @@ -839,7 +861,7 @@ namespace oopsy { #endif //OOPSY_TARGET_HAS_OLED #if (OOPSY_TARGET_PETAL) - hardware.UpdateLeds(); + hardware.led_driver.SwapBuffersAndTransmit(); #endif //(OOPSY_TARGET_PETAL) } // uitimer.ready @@ -868,9 +890,9 @@ namespace oopsy { if (hardware.menu_click) menu_button_released = hardware.menu_click; #elif defined(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; + menu_button_incr += hardware.sw2.FallingEdge(); + menu_button_held_ms = hardware.sw1.TimeHeldMs(); + if (hardware.sw1.FallingEdge()) menu_button_released = 1; #elif defined(OOPSY_TARGET_VERSIO) // menu_button_held = hardware.tap.Pressed(); // menu_button_incr += hardware.GetKnobValue(6) * app_count; @@ -1032,16 +1054,18 @@ namespace oopsy { } #endif //OOPSY_TARGET_USES_MIDI_UART + // TODO -- need better way to handle this to avoid hardcoding #if (OOPSY_TARGET_FIELD) void setFieldLedsFromData(Data& data) { for(long i = 0; i < daisy::DaisyField::LED_LAST && i < data.dim; i++) { // LED indices run A1..8, B8..1, Knob1..8 // switch here to re-order the B8-1 to B1-8 long idx=i; - if (idx > 7 && idx < 16) idx = 23-i; + if (idx > 7 && idx < 16) + idx = 23 - i; hardware.led_driver.SetLed(idx, data.read(i, 0)); } - hardware.led_driver.SwapBuffersAndTransmit(); + // hardware.led_driver.SwapBuffersAndTransmit(); // now handled by hardware class }; #endif @@ -1087,7 +1111,7 @@ namespace oopsy { daisy.audio_postperform(buffers, size); // convert elapsed time (us) to CPU percentage (0-100) of available processing time // 100 (%) * (0.000001 * used_us) * callbackrateHz - float percent = (daisy::System::GetUs() - start)*0.0001f*daisy.sub_board->AudioCallbackRate(); + float percent = (daisy::System::GetUs() - start)*0.0001f*daisy.som->AudioCallbackRate(); percent = percent > 100.f ? 100.f : percent; // with a falling-only slew to capture spikes, since we care most about worst-case performance daisy.audioCpuUsage = (percent > daisy.audioCpuUsage) ? percent diff --git a/source/json2daisy.js b/source/json2daisy.js new file mode 100644 index 0000000..35e3ca8 --- /dev/null +++ b/source/json2daisy.js @@ -0,0 +1,608 @@ +#!/usr/bin/env node + +// TODO -- we'll reimplement the filter / map stuff here if just for the exclusion capabilities + +const assert = require("assert"); +const path = require("path"); +const seed_defs = require(path.join(__dirname, "component_defs.json")); +const patchsm_defs = require(path.join(__dirname, "component_defs_patchsm.json")); +const petalsm_defs = require(path.join(__dirname, "component_defs_petalsm.json")); + +var global_definitions; + +// .filter for objects that returns array +Object.filter = (obj, predicate) => + Object.keys(obj).filter(key => predicate(obj[key])) + .map(key => obj[key]); + +function generateCodecs(external_codecs) +{ + codec_string = ` + // External Codec Initialization + daisy::SaiHandle::Config sai_config[${1 + external_codecs.length}]; + + // Internal Codec + if(som.CheckBoardVersion() == daisy::DaisySeed::BoardVersion::DAISY_SEED_1_1) + { + sai_config[0].pin_config.sa = {DSY_GPIOE, 6}; + sai_config[0].pin_config.sb = {DSY_GPIOE, 3}; + sai_config[0].a_dir = daisy::SaiHandle::Config::Direction::RECEIVE; + sai_config[0].b_dir = daisy::SaiHandle::Config::Direction::TRANSMIT; + } + else + { + sai_config[0].pin_config.sa = {DSY_GPIOE, 6}; + sai_config[0].pin_config.sb = {DSY_GPIOE, 3}; + sai_config[0].a_dir = daisy::SaiHandle::Config::Direction::TRANSMIT; + sai_config[0].b_dir = daisy::SaiHandle::Config::Direction::RECEIVE; + } + sai_config[0].periph = daisy::SaiHandle::Config::Peripheral::SAI_1; + sai_config[0].sr = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ; + sai_config[0].bit_depth = daisy::SaiHandle::Config::BitDepth::SAI_24BIT; + sai_config[0].a_sync = daisy::SaiHandle::Config::Sync::MASTER; + sai_config[0].b_sync = daisy::SaiHandle::Config::Sync::SLAVE; + sai_config[0].pin_config.fs = {DSY_GPIOE, 4}; + sai_config[0].pin_config.mclk = {DSY_GPIOE, 2}; + sai_config[0].pin_config.sck = {DSY_GPIOE, 5}; + ` + + for (let i = 0; i < external_codecs.length; i++) + { + codec_string += ` + sai_config[${i + 1}].periph = daisy::SaiHandle::Config::Peripheral::${external_codecs[i].periph}; + sai_config[${i + 1}].sr = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ; + sai_config[${i + 1}].bit_depth = daisy::SaiHandle::Config::BitDepth::SAI_24BIT; + sai_config[${i + 1}].a_sync = daisy::SaiHandle::Config::Sync::${external_codecs[i].a_sync}; + sai_config[${i + 1}].b_sync = daisy::SaiHandle::Config::Sync::${external_codecs[i].b_sync}; + sai_config[${i + 1}].a_dir = daisy::SaiHandle::Config::Direction::${external_codecs[i].a_dir}; + sai_config[${i + 1}].b_dir = daisy::SaiHandle::Config::Direction::${external_codecs[i].b_dir}; + sai_config[${i + 1}].pin_config.fs = som.GetPin(${external_codecs[i].pin.fs}); + sai_config[${i + 1}].pin_config.mclk = som.GetPin(${external_codecs[i].pin.mclk}); + sai_config[${i + 1}].pin_config.sck = som.GetPin(${external_codecs[i].pin.sck}); + sai_config[${i + 1}].pin_config.sa = som.GetPin(${external_codecs[i].pin.sa}); + sai_config[${i + 1}].pin_config.sb = som.GetPin(${external_codecs[i].pin.sb}); + `; + } + + codec_string += ` + daisy::SaiHandle sai_handle[${external_codecs.length + 1}]; + sai_handle[0].Init(sai_config[0]); + `; + + for (let i = 0; i < external_codecs.length; i++) + { + codec_string += ` + sai_handle[${i + 1}].Init(sai_config[${i + 1}]); + `; + } + + codec_string += ` + dsy_gpio_pin codec_reset_pin = som.GetPin(29); + daisy::Ak4556::Init(codec_reset_pin); + + daisy::AudioHandle::Config cfg; + cfg.blocksize = 48; + cfg.samplerate = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ; + cfg.postgain = 0.5f; + som.audio_handle.Init( + cfg, + sai_handle[0]`; + + for (let i = 0; i < external_codecs.length; i++) + { + codec_string += ",\n "; + codec_string += `sai_handle[${i + 1}]`; + } + + codec_string += ` + ); + `; + + return codec_string; +} + +function stringFormatMap(template, formatMap) +{ + if (typeof template === 'undefined') + return ''; + const format_match = /{\s*([^{}\s]*)\s*}/g; + const open_curly = /{{/g; + const close_curly = /}}/g; + let pass1 = template.replace(open_curly, () => { + return '{' + }); + let pass2 = pass1.replace(close_curly, () => { + return '}' + }); + let pass3 = pass2.replace(format_match, (substring, value, index) => { + return value in formatMap ? formatMap[value] : ''; + }); + return pass3; +} + +exports.format_map = stringFormatMap; + +function map_load(key, item) +{ + item.name = key; + assert(item.component in global_definitions, `Undefined component kind "${item.component}"`); + component = global_definitions[item.component]; + + for (property in component) + { + if (!(property in item)) + item[property] = component[property]; + } + + return item; +} + +function filter_match(sequence, key, match, key_exclude = null, match_exclude = null) +{ + if (key_exclude !== null && match_exclude !== null) + { + return Object.filter(sequence, item => key in item && item[key] == match && ((item[key_exclude] || null) != match_exclude)); + } + else + return Object.filter(sequence, item => key in item && item[key] == match); +} + +function filter_matches(sequence, key, matches, key_exclude=null, match_exclude=null) +{ + if (key_exclude !== null && match_exclude !== null) + { + return Object.filter(sequence, item => { + let items_key = item[key] || ''; + let items_key_exclude = item[key_exclude] || ''; + return matches.includes(items_key) && items_key_exclude != match_exclude; + }); + } + else + { + return Object.filter(sequence, item => { + let items_key = item[key] || ''; + return matches.includes(items_key); + }); + } +} + +function filter_has(sequence, key, key_exclude=null, match_exclude=null) +{ + if (key_exclude !== null && match_exclude !== null) + { + return Object.filter(sequence, item => { + let items_key_exclude = item[key_exclude] || ''; + return key in item && items_key_exclude != match_exclude; + }); + } + else + { + return Object.filter(sequence, item => key in item); + } +} + +function filter_map_init(set, key, match, key_exclude=null, match_exclude=null) +{ + filtered = filter_match(set, key, match, key_exclude, match_exclude); + return filtered.map(item => stringFormatMap(item.map_init, item)).join("\n "); +} + +function filter_map_set(set, key, match, key_exclude=null, match_exclude=null) +{ + filtered = filter_match(set, key, match, key_exclude, match_exclude); + return filtered.map(item => stringFormatMap(stringFormatMap(item.mapping[0].set, item.mapping[0].name, item))).join("\n "); +} + +function filter_map_ctrl(set, key, matches, init_key, key_exclude=null, match_exclude=null) +{ + set = filter_matches(set, key, matches, key_exclude, match_exclude); + set = set.map((item, i) => Object.assign(item, item, {i: i})); + return set.map(item => stringFormatMap(item[init_key], item)).join("\n "); +} + +function filter_map_template(set, name, key_exclude=null, match_exclude=null) +{ + filtered = filter_has(set, name, key_exclude, match_exclude); + return filtered.map(item => stringFormatMap(item[name], item)).join("\n "); +} + +function flatten_pin_dicts(comp) +{ + flattened = {}; + Object.assign(flattened, comp); // maybe not actually necessary to copy + if ('pin' in comp && typeof comp.pin === 'object') + { + for (property in comp.pin) + { + flattened[`pin_${property}`] = comp.pin[property]; + } + } + return flattened; +} + +function flatten_index_dicts(comp) +{ + flattened = {}; + Object.assign(flattened, comp); // maybe not actually necessary to copy + if ('index' in comp && typeof comp.index === 'object') + { + for (property in comp.index) + { + flattened[`index_${property}`] = comp.index[property]; + } + } + return flattened; +} + +exports.generate_header = function generate_header(board_description_object, target_path) +{ + let target = board_description_object; + + let components = target.components; + let parents = target.parents || {}; + + for (let comp in parents) + { + parents[comp].is_parent = true; + } + Object.assign(components, components, parents); + + som = target.som || 'seed'; + + let temp_defs = { + seed: seed_defs, + patch_sm: patchsm_defs, + petal_125b_sm: petalsm_defs, + }; + + assert(som in temp_defs, `Unkown som "${som}"`); + + definitions = temp_defs[som]; + global_definitions = definitions; + + for (let comp in components) + { + components[comp] = map_load(comp, components[comp]); + components[comp] = flatten_pin_dicts(components[comp]); + components[comp] = flatten_index_dicts(components[comp]); + } + + target.components = components; + target.name = target.name || ''; // For now we'll allow it to be nothing + target.aliases = target.aliases || {}; + + if ("display" in target) + { + // shouldn't this only be done if the display property is empty? + target.display = { + driver: "daisy::SSD130x4WireSpi128x64Driver", + config: [], + dim: [128, 64], + }; + + target.defines.OOPSY_TARGET_HAS_OLED = 1; + target.defines.OOPSY_OLED_DISPLAY_WIDTH = target.display.dim[0] + target.defines.OOPSY_OLED_DISPLAY_HEIGHT = target.display.dim[1] + } + + let has_display = target.defines.OOPSY_TARGET_HAS_OLED || false; + + let replacements = {} + replacements.name = target.name; + replacements.som = som; + replacements.external_codecs = target.external_codecs || []; + + const classes = { + seed: 'daisy::DaisySeed', + patch_sm: 'daisy::patch_sm::DaisyPatchSM', + petal_125b_sm: 'daisy::Petal125BSM' + }; + + replacements.som_class = classes[som]; + + replacements.target_name = target.name; // TODO -- redundant? + replacements.init = filter_map_template(components, 'init', 'is_default', true); + + replacements.cd4021 = filter_map_init(components, 'component', 'CD4021', key_exclude='is_default', match_exclude=true); + replacements.i2c = filter_map_init(components, 'component', 'i2c', key_exclude='is_default', match_exclude=true); + replacements.pca9685 = filter_map_init(components, 'component', 'PCA9685', key_exclude='is_default', match_exclude=true); + replacements.switch = filter_map_init(components, 'component', 'Switch', key_exclude='is_default', match_exclude=true); + replacements.gatein = filter_map_init(components, 'component', 'GateIn', key_exclude='is_default', match_exclude=true); + replacements.encoder = filter_map_init(components, 'component', 'Encoder', key_exclude='is_default', match_exclude=true); + replacements.switch3 = filter_map_init(components, 'component', 'Switch3', key_exclude='is_default', match_exclude=true); + replacements.analogcount = filter_matches(components, 'component', ['AnalogControl', 'AnalogControlBipolar', 'CD4051'], key_exclude='is_default', match_exclude=true).length; + + replacements.init_single = filter_map_ctrl(components, 'component', ['AnalogControl', 'AnalogControlBipolar', 'CD4051'], 'init_single', key_exclude='is_default', match_exclude=true); + replacements.ctrl_init = filter_map_ctrl(components, 'component', ['AnalogControl', 'AnalogControlBipolar'], 'map_init', key_exclude='is_default', match_exclude=true); + + replacements.ctrl_mux_init = filter_map_init(components, 'component', 'CD4051AnalogControl', key_exclude='is_default', match_exclude=true); + + replacements.led = filter_map_init(components, 'component', 'Led', key_exclude='is_default', match_exclude=true); + replacements.rgbled = filter_map_init(components, 'component', 'RgbLed', key_exclude='is_default', match_exclude=true); + replacements.gateout = filter_map_init(components, 'component', 'GateOut', key_exclude='is_default', match_exclude=true); + replacements.dachandle = filter_map_init(components, 'component', 'CVOuts', key_exclude='is_default', match_exclude=true); + + replacements.MotorShield = filter_map_init(components, 'component', 'MotorShield', key_exclude='is_default', match_exclude=true); + replacements.StepperMotor = filter_map_init(components, 'component', 'StepperMotor', key_exclude='is_default', match_exclude=true); + replacements.DcMotor = filter_map_init(components, 'component', 'DcMotor', key_exclude='is_default', match_exclude=true); + replacements.Bme280 = filter_map_init(components, 'component', 'Bme280', key_exclude='is_default', match_exclude=true); + replacements.HallSensor = filter_map_init(components, 'component', 'HallSensor', key_exclude='is_default', match_exclude=true); + replacements.Tlv493d = filter_map_init(components, 'component', 'Tlv493d', key_exclude='is_default', match_exclude=true); + replacements.Mpr121 = filter_map_init(components, 'component', 'Mpr121', key_exclude='is_default', match_exclude=true); + replacements.Apds9960 = filter_map_init(components, 'component', 'Apds9960', key_exclude='is_default', match_exclude=true); + replacements.Bmp390 = filter_map_init(components, 'component', 'Bmp390', key_exclude='is_default', match_exclude=true); + replacements.Vl53l1x = filter_map_init(components, 'component', 'Vl53l1x', key_exclude='is_default', match_exclude=true); + replacements.Vl53l0x = filter_map_init(components, 'component', 'Vl53l0x', key_exclude='is_default', match_exclude=true); + replacements.NeoTrellis = filter_map_init(components, 'component', 'NeoTrellis', key_exclude='is_default', match_exclude=true); + replacements.NeoTrellisLeds = filter_map_init(components, 'component', 'NeoTrellisLeds', key_exclude='is_default', match_exclude=true); + replacements.Bno055 = filter_map_init(components, 'component', 'Bno055', key_exclude='is_default', match_exclude=true); + replacements.Icm20948 = filter_map_init(components, 'component', 'Icm20948', key_exclude='is_default', match_exclude=true); + replacements.Dps310 = filter_map_init(components, 'component', 'Dps310', key_exclude='is_default', match_exclude=true); + + replacements.CodeClass = filter_map_init(components, 'component', 'CodeClass', key_exclude='is_default', match_exclude=true); + + replacements.display = !(has_display) ? '' : ` + daisy::OledDisplay<${target.display.driver}>::Config display_config; + display_config.driver_config.transport_config.Defaults(); + display.Init(display_config); + display.Fill(0); + display.Update(); + `; + + // mangle CodeClass process calls into the correct syntax + let process_fields = ['process', 'loopprocess', 'postprocess', 'display']; + for (let component in components) + { + let comp_obj = components[component]; + if (comp_obj.component == 'CodeClass') + { + for (let field of process_fields) + { + if (field in comp_obj && comp_obj[field]) + comp_obj[field] = `{name}.${comp_obj[field]}();`; + } + } + } + + // Provide default getters and setters for CodeInput and CodeOutput components + for (let component in components) + { + let comp_obj = components[component]; + if (comp_obj.component == 'CodeInput') + { + if (!comp_obj.setter) + comp_obj.setter = component; + } + else if (comp_obj.component == 'CodeOutput') + { + if (!comp_obj.getter) + comp_obj.getter = component; + } + } + + replacements.process = filter_map_template(components, 'process', key_exclude='is_default', match_exclude=true); + // There's also this after {process}. I don't see any meta in the defaults json at this time. Is this needed? + // ${components.filter((e) => e.meta).map((e) => e.meta.map(m=>`${template(m, e)}`).join("")).join("")} + replacements.loopprocess = filter_map_template(components, 'loopprocess', key_exclude='is_default', match_exclude=true); + + replacements.postprocess = filter_map_template(components, 'postprocess', key_exclude='is_default', match_exclude=true); + replacements.displayprocess = filter_map_template(components, 'display', key_exclude='is_default', match_exclude=true); + replacements.hidupdaterates = filter_map_template(components, 'updaterate', key_exclude='is_default', match_exclude=true); + + component_decls = Object.filter(components, item => !(item.is_default || false)); + component_decls = component_decls.filter(item => 'typename' in item && item.typename != ""); + replacements.comps = component_decls.map(item => `${stringFormatMap(item.typename, item)} ${item.name}`).join(";\n ") + ';'; + non_class_decls = component_decls.filter(item => 'non_class_decl' in item); + replacements.non_class_declarations = non_class_decls.map(item => stringFormatMap(item.non_class_decl, item)).join("\n"); + + headers = Object.filter(components, item => 'header' in item); + abs_headers = headers.map(item => path.isAbsolute(item.header) ? item.header : + path.normalize(path.join(path.dirname(target_path), item.header))); + include_paths = abs_headers.map(item => path.dirname(item)); + replacements.headers = abs_headers.map(item => `#include "${path.basename(item)}"`).join("\n"); + + replacements.dispdec = 'display' in target ? `daisy::OledDisplay<${target.display.driver}> display;` : ""; + + let header = ` +#ifndef __JSON2DAISY_${replacements.name.toUpperCase()}_H__ +#define __JSON2DAISY_${replacements.name.toUpperCase()}_H__ + +#include "daisy_${replacements.som}.h" +${replacements.som == 'seed' ? '#include "dev/codec_ak4556.h"' : ''} +${has_display ? '#include "dev/oled_ssd130x.h"' : ''} +${replacements.headers} + +#define ANALOG_COUNT ${replacements.analogcount} + +namespace json2daisy { + +${replacements.non_class_declarations} + +${replacements.name != '' ? `struct Daisy${replacements.name[0].toUpperCase()}${replacements.name.slice(1)} {` + : `struct Daisy {`} + + /** Initializes the board according to the JSON board description + * \\param boost boosts the clock speed from 400 to 480 MHz + */ + void Init(bool boost=true) + { + ${replacements.som == 'seed' ? `som.Configure(); + som.Init(boost);` : `som.Init();`} + ${replacements.init} + ${replacements.i2c != '' ? '// i2c\n ' + replacements.i2c : ''} + ${replacements.pca9685 != '' ? '// LED Drivers\n ' + replacements.pca9685 : ''} + ${replacements.switch != '' ? '// Switches\n ' + replacements.switch : ''} + ${replacements.switch3 != '' ? '// SPDT Switches\n ' + replacements.switch3 : ''} + ${replacements.cd4021 != '' ? '// Muxes\n ' + replacements.cd4021 : ''} + ${replacements.gatein != '' ? '// Gate ins\n ' + replacements.gatein : ''} + ${replacements.encoder != '' ? '// Rotary encoders\n ' + replacements.encoder : ''} + ${replacements.init_single != '' ? '// Single channel ADC initialization\n ' + replacements.init_single : ''} + ${replacements.som == 'seed' && replacements.analogcount ? 'som.adc.Init(cfg, ANALOG_COUNT);' : ''} + ${replacements.ctrl_init != '' ? '// AnalogControl objects\n ' + replacements.ctrl_init : ''} + ${replacements.ctrl_mux_init != '' ? '// Multiplexed AnlogControl objects\n ' + replacements.ctrl_mux_init : ''} + ${replacements.led != '' ? '// LEDs\n ' + replacements.led : ''} + ${replacements.rgbled != '' ? '// RBG LEDs \n ' + replacements.rgbled : ''} + ${replacements.gateout != '' ? '// Gate outs\n ' + replacements.gateout : ''} + ${replacements.dachandle != '' ? '// DAC\n ' + replacements.dachandle : ''} + ${replacements.display != '' ? '// Display\n ' + replacements.display : ''} + + ${replacements.MotorShield != '' ? '// Motor Shield\n ' + replacements.MotorShield : ''} + ${replacements.StepperMotor != '' ? '// Stepper Motor\n ' + replacements.StepperMotor : ''} + ${replacements.DcMotor != '' ? '// DC Motor\n ' + replacements.DcMotor : ''} + ${replacements.Bme280 != '' ? '// BME sensor\n ' + replacements.Bme280 : ''} + ${replacements.HallSensor != '' ? '// Hall Effect Sensor\n ' + replacements.HallSensor : ''} + ${replacements.Tlv493d != '' ? '// TLV Sensor\n ' + replacements.Tlv493d : ''} + ${replacements.Mpr121 != '' ? '// MPR Sensor\n ' + replacements.Mpr121 : ''} + ${replacements.Apds9960 != '' ? '// APDS Sensor\n ' + replacements.Apds9960 : ''} + ${replacements.Bmp390 != '' ? '// BMP Sensor\n ' + replacements.Bmp390 : ''} + ${replacements.Vl53l1x != '' ? '// VL53L1X Sensor\n ' + replacements.Vl53l1x : ''} + ${replacements.Vl53l0x != '' ? '// VL53L0X Sensor\n ' + replacements.Vl53l0x : ''} + ${replacements.NeoTrellis != '' ? '// Neo Trellis\n ' + replacements.NeoTrellis : ''} + ${replacements.NeoTrellisLeds != '' ? '// NeoTrellis LEDs\n ' + replacements.NeoTrellisLeds : ''} + ${replacements.Bno055 != '' ? '// BNO Sensor\n ' + replacements.Bno055 : ''} + ${replacements.Icm20948 != '' ? '// Icm20948 Sensor\n ' + replacements.Icm20948 : ''} + ${replacements.Dps310 != '' ? '// Dps310 Sensor\n ' + replacements.Dps310 : ''} + + ${replacements.CodeClass != '' ? '// Custom classes\n ' + replacements.CodeClass : ''} + + ${replacements.external_codecs.length == 0 ? '' : generateCodecs(replacements.external_codecs)} + + ${replacements.som == 'seed' ? 'som.adc.Start();' : ''} + } + + /** Handles all the controls processing that needs to occur at the block rate + * + */ + void ProcessAllControls() + { + ${replacements.process} + ${replacements.som == 'patch_sm' || replacements.som == 'petal_125b_sm' ? 'som.ProcessAllControls();' : ''} + } + + /** Handles all the maintenance processing. This should be run last within the audio callback. + * + */ + void PostProcess() + { + ${replacements.postprocess} + ${replacements.som == 'petal_125b_sm' ? 'som.UpdateLeds();' : ''} + } + + /** Handles processing that shouldn't occur in the audio block, such as blocking transfers + * + */ + void LoopProcess() + { + ${replacements.loopprocess} + } + + /** Handles display-related processing + * + */ + void Display() + { + + } + + /** Sets the audio sample rate + * \\param sample_rate the new sample rate in Hz + */ + void SetAudioSampleRate(size_t sample_rate) + { + ${som == 'patch_sm' ? 'som.SetAudioSampleRate(sample_rate);' : + `daisy::SaiHandle::Config::SampleRate enum_rate; + if (sample_rate >= 96000) + enum_rate = daisy::SaiHandle::Config::SampleRate::SAI_96KHZ; + else if (sample_rate >= 48000) + enum_rate = daisy::SaiHandle::Config::SampleRate::SAI_48KHZ; + else if (sample_rate >= 32000) + enum_rate = daisy::SaiHandle::Config::SampleRate::SAI_32KHZ; + else if (sample_rate >= 16000) + enum_rate = daisy::SaiHandle::Config::SampleRate::SAI_16KHZ; + else + enum_rate = daisy::SaiHandle::Config::SampleRate::SAI_8KHZ; + som.SetAudioSampleRate(enum_rate); + `} + ${replacements.hidupdaterates} + } + + /** Sets the audio sample rate + * \\param sample_rate the new sample rate as an enum + */ + void SetAudioSampleRate(daisy::SaiHandle::Config::SampleRate sample_rate) + { + ${som == 'seed' || som == 'petal_125b_sm' ? 'som.SetAudioSampleRate(sample_rate);' : + `size_t hz_rate; + switch (sample_rate) + { + case (daisy::SaiHandle::Config::SampleRate::SAI_96KHZ): + hz_rate = 96000; + break; + default: + case (daisy::SaiHandle::Config::SampleRate::SAI_48KHZ): + hz_rate = 48000; + break; + case (daisy::SaiHandle::Config::SampleRate::SAI_32KHZ): + hz_rate = 32000; + break; + case (daisy::SaiHandle::Config::SampleRate::SAI_16KHZ): + hz_rate = 16000; + break; + case (daisy::SaiHandle::Config::SampleRate::SAI_8KHZ): + hz_rate = 8000; + break; + } + som.SetAudioSampleRate(hz_rate); + `} + ${replacements.hidupdaterates} + } + + /** Sets the audio block size + * \\param block_size the new block size in words + */ + inline void SetAudioBlockSize(size_t block_size) + { + som.SetAudioBlockSize(block_size); + } + + /** Starts up the audio callback process with the given callback + * + */ + inline void StartAudio(daisy::AudioHandle::AudioCallback cb) + { + som.StartAudio(cb); + } + + /** This is the board's "System On Module" + */ + ${replacements.som_class} som; + ${replacements.som == 'seed' ? 'daisy::AdcChannelConfig cfg[ANALOG_COUNT];' : ''} + + // I/O Components + ${replacements.comps} + ${replacements.dispdec} + + // Menu variables + int menu_click = 0, menu_hold = 0, menu_rotate = 0; +}; + +} // namespace json2daisy + +#endif // __JSON2DAISY_${replacements.name.toUpperCase()}_H__ +`; + + let audio_info = target.audio || null; + let audio_channels = audio_info != null ? audio_info.channels || 2 : 2; + + let board_info = { + header: header, + name: target.name, + components: components, + aliases: target.aliases, + channels: audio_channels, + includes: include_paths, + }; + + return board_info; + +} \ No newline at end of file diff --git a/source/libdaisy b/source/libdaisy index 121074f..b65a1ba 160000 --- a/source/libdaisy +++ b/source/libdaisy @@ -1 +1 @@ -Subproject commit 121074f7fb4503fc4f81b0f4cf112208991c15ea +Subproject commit b65a1bad880f5d6ca5194d7162652757c6f4fcc5 diff --git a/source/seed.nehcmeulb.json b/source/nehcmeulb.json similarity index 97% rename from source/seed.nehcmeulb.json rename to source/nehcmeulb.json index e23524e..5cc86d0 100644 --- a/source/seed.nehcmeulb.json +++ b/source/nehcmeulb.json @@ -1,5 +1,6 @@ { "name":"nehcmeulb", + "som": "seed", "max_apps": 8, "defines": { "OOPSY_TARGET_HAS_MIDI_OUTPUT": 1 diff --git a/source/oopsy.js b/source/oopsy.js index cead987..bcc4722 100755 --- a/source/oopsy.js +++ b/source/oopsy.js @@ -27,7 +27,7 @@ - configure a "gen" object representing features in the .cpp patch The general idea here is that there is a list of named "nodes" making a graph - most nodes are sources, + most nodes are sources, they may have a list of `to` destinations they may have a `src` field naming another node they map from some nodes are sinks, and have a list of 'from' sources @@ -39,6 +39,9 @@ const fs = require("fs"), assert = require("assert"); const {exec, execSync, spawn} = require("child_process"); +const json2daisy = require(path.join(__dirname, "json2daisy.js")); +const daisy_glue = require(path.join(__dirname, "daisy_glue.js")); + // returns the path `str` with posix path formatting: function posixify_path(str) { return str.split(path.sep).join(path.posix.sep); @@ -80,6 +83,15 @@ function asCppNumber(n, type="float") { } } +function node_scale(node) { + if (node.permit_scale == false) + return `${node.varname} = (${node.type})(${node.src}); + ` + else + return `${node.varname} = (${node.type})(${node.src}*${asCppNumber(node.range)} + ${asCppNumber(node.min + (node.type == "int" || node.type == "bool" ? 0.5 : 0))}); + ` +} + let build_tools_path; let has_dfu_util; function checkBuildEnvironment() { @@ -95,7 +107,7 @@ function checkBuildEnvironment() { console.warn(`oopsy can't find the ARM GCC build tools, will not be able to upload binary to the Daisy. Please check https://github.com/electro-smith/DaisyWiki/wiki/1e.-Getting-Started-With-Oopsy-(Gen~-Integration) for installation instructions.`) process.exit(-1); } - + } else { // OSX: let locations = ["/opt/homebrew/bin", "/usr/local/bin"] @@ -111,7 +123,7 @@ function checkBuildEnvironment() { process.exit(-1); } if (fs.existsSync(`${build_tools_path}/dfu-util`)) { - has_dfu_util = true; + has_dfu_util = true; } else { console.warn(`oopsy can't find the dfu-util binary in ${build_tools_path}, will not be able to upload binary to the Daisy. Please check https://github.com/electro-smith/DaisyWiki/wiki/1e.-Getting-Started-With-Oopsy-(Gen~-Integration) for installation instructions.`) } @@ -124,8 +136,8 @@ const help = ` cmds: up/upload = (default) generate & upload gen/generate = generate only -target: path to a JSON for the hardware config, - or simply "patch", "patch_sm", "field", "petal", "pod" etc. +target: path to a JSON for the hardware config, + or simply "patch", "patch_sm", "field", "petal", "pod" etc. Defaults to "daisy.patch.json" 32kHz, 48kHz, "96kHz" will set the sampling rate of the binary @@ -140,7 +152,7 @@ nooled will disable code generration for OLED (it will be blank) cpps: paths to the gen~ exported cpp files first item will be the default app - + watch: script will not terminate actions will be re-run each time any of the cpp files are modified ` @@ -153,7 +165,7 @@ const component_defs = { polarity: "daisy::Switch::POLARITY_INVERTED", pull: "daisy::Switch::PULL_UP", process: "${name}.Debounce();", - updaterate: "${name}.SetUpdateRate(seed.AudioCallbackRate());", + updaterate: "${name}.SetUpdateRate(som.AudioCallbackRate());", mapping: [ { name: "${name}", get: "(hardware.${name}.Pressed()?1.f:0.f)", range: [0, 1] }, { @@ -184,11 +196,11 @@ const component_defs = { typename: "daisy::Encoder", pin: "a,b,click", process: "${name}.Debounce();", - updaterate: "${name}.SetUpdateRate(seed.AudioCallbackRate());", + updaterate: "${name}.SetUpdateRate(som.AudioCallbackRate());", mapping: [ { name: "${name}", - get: "(hardware.${name}.Increment()*0.5f+0.5f)", + get: "hardware.${name}.Increment()", range: [-1, 1] }, { @@ -226,9 +238,9 @@ const component_defs = { pin: "a", flip: false, invert: false, - slew: "1.0/seed.AudioCallbackRate()", + slew: "1.0/som.AudioCallbackRate()", process: "${name}.Process();", - updaterate: "${name}.SetSampleRate(seed.AudioCallbackRate());", + updaterate: "${name}.SetSampleRate(som.AudioCallbackRate());", mapping: [{ name: "${name}", get: "(hardware.${name}.Value())", range: [0, 1] }] }, Led: { @@ -270,161 +282,18 @@ const component_defs = { mapping: [ { name: "${name}1", - set: "hardware.seed.dac.WriteValue(daisy::DacHandle::Channel::ONE, $ * 4095);", + set: "hardware.som.dac.WriteValue(daisy::DacHandle::Channel::ONE, $ * 4095);", where: "main" }, { name: "${name}2", - set: "hardware.seed.dac.WriteValue(daisy::DacHandle::Channel::TWO, $ * 4095);", + set: "hardware.som.dac.WriteValue(daisy::DacHandle::Channel::TWO, $ * 4095);", where: "main" } ] } }; -// generate the struct -function generate_target_struct(target) { - - // flesh out target components: - let components = Object.entries(target.components) - .sort((a, b) => - a[1].component < b[1].component - ? -1 - : a[1].component > b[1].component - ? 1 - : 0 - ) - .map((pair) => { - let [name, def] = pair; - def.name = name; - let component = component_defs[def.component]; - if (component) { - // copy component defaults into the def - // TODO this should be recursive for object structures... - for (let k of Object.keys(component)) { - if (def[k] == undefined) def[k] = component[k]; - } - } else { - throw new Error("undefined component kind: " + def.component); - } - return def; - }); - target.components = components; - target.name = target.name || "custom" - - if (target.display) { - // apply defaults: - target.display = Object.assign({ - driver: "daisy::SSD130x4WireSpi128x64Driver", - config: [], - dim: [128, 64] - }, target.display) - target.defines.OOPSY_TARGET_HAS_OLED = 1 - target.defines.OOPSY_OLED_DISPLAY_WIDTH = target.display.dim[0] - target.defines.OOPSY_OLED_DISPLAY_HEIGHT = target.display.dim[1] - } - - return ` -#include "daisy_seed.h" -${target.display ? `#include "dev/oled_ssd130x.h"` : ""} -// name: ${target.name} -struct Daisy { - - void Init(bool boost = false) { - seed.Configure(); - seed.Init(boost); - ${components.filter((e) => e.init) - .map((e) => ` - ${template(e.init, e)}` - ).join("")} - ${components.filter((e) => e.typename == "daisy::Switch") - .map((e, i) => ` - ${e.name}.Init(seed.GetPin(${e.pin}), seed.AudioCallbackRate(), ${e.type}, ${e.polarity}, ${e.pull});` - ).join("")} - ${components.filter((e) => e.typename == "daisy::Switch3").map((e, i) => ` - ${e.name}.Init(seed.GetPin(${e.pin.a}), seed.GetPin(${e.pin.b}));` - ).join("")} - ${components.filter((e) => e.typename == "daisy::GateIn").map((e, i) => ` - dsy_gpio_pin ${e.name}_pin = seed.GetPin(${e.pin}); - ${e.name}.Init(&${e.name}_pin);` - ).join("")} - ${components.filter((e) => e.typename == "daisy::Encoder").map((e, i) => ` - ${e.name}.Init(seed.GetPin(${e.pin.a}), seed.GetPin(${e.pin.b}), seed.GetPin(${e.pin.click}), seed.AudioCallbackRate());` - ).join("")} - static const int ANALOG_COUNT = ${ - components.filter((e) => e.typename == "daisy::AnalogControl").length}; - daisy::AdcChannelConfig cfg[ANALOG_COUNT]; - ${components.filter((e) => e.typename == "daisy::AnalogControl").map((e, i) => ` - cfg[${i}].InitSingle(seed.GetPin(${e.pin}));`).join("")} - seed.adc.Init(cfg, ANALOG_COUNT); - ${components.filter((e) => e.typename == "daisy::AnalogControl").map((e, i) => ` - ${e.name}.Init(seed.adc.GetPtr(${i}), seed.AudioCallbackRate(), ${e.flip}, ${e.invert});`).join("")} - ${components.filter((e) => e.typename == "daisy::Led").map((e, i) => ` - ${e.name}.Init(seed.GetPin(${e.pin}), ${e.invert}); - ${e.name}.Set(0.0f);`).join("")} - ${components.filter((e) => e.typename == "daisy::RgbLed").map((e, i) => ` - ${e.name}.Init(seed.GetPin(${e.pin.r}), seed.GetPin(${e.pin.g}), seed.GetPin(${e.pin.b}), ${e.invert}); - ${e.name}.Set(0.0f, 0.0f, 0.0f);`).join("")} - ${components.filter((e) => e.typename == "daisy::dsy_gpio").map((e, i) => ` - ${e.name}.pin = seed.GetPin(${e.pin}); - ${e.name}.mode = ${e.mode}; - ${e.name}.pull = ${e.pull}; - dsy_gpio_init(&${e.name});`).join("")} - ${components.filter((e) => e.typename == "daisy::DacHandle::Config").map((e, i) => ` - ${e.name}.bitdepth = ${e.bitdepth}; - ${e.name}.buff_state = ${e.buff_state}; - ${e.name}.mode = ${e.mode}; - ${e.name}.chn = ${e.channel}; - seed.dac.Init(${e.name}); - seed.dac.WriteValue(${e.channel}, 0);`).join("")} - ${target.display ? ` - daisy::OledDisplay<${target.display.driver}>::Config display_config; - display_config.driver_config.transport_config.Defaults(); ${(target.display.config || []).map(e=>` - ${e}`).join("")} - display.Init(display_config);`:`// no display`} - } - - void ProcessAllControls() { - ${components.filter((e) => e.process).map((e) => ` - ${template(e.process, e)}`).join("")} - ${components.filter((e) => e.meta).map((e) => e.meta.map(m=>` - ${template(m, e)}`).join("")).join("")} - } - - void PostProcess() { - ${components.filter((e) => e.postprocess).map((e) => ` - ${template(e.postprocess, e)}`).join("")} - } - - void Display() { - ${components.filter((e) => e.display).map((e) => ` - ${template(e.display, e)}`).join("")} - } - - void SetAudioSampleRate(daisy::SaiHandle::Config::SampleRate samplerate) { - seed.SetAudioSampleRate(samplerate); - SetHidUpdateRates(); - } - - void SetAudioBlockSize(size_t size) { - seed.SetAudioBlockSize(size); - SetHidUpdateRates(); - } - - void SetHidUpdateRates() { - ${components.filter((e) => e.updaterate).map((e) => ` - ${template(e.updaterate, e)}`).join("")} - } - - daisy::DaisySeed seed; - ${components.map((e) => ` - ${e.typename} ${e.name};`).join("")} - ${target.display ? `daisy::OledDisplay<${target.display.driver}> display;`:`// no display`} - int menu_click = 0, menu_hold = 0, menu_rotate = 0; - -};`; -} - let watchers = [] // the script can be invoked directly as a command-line program, @@ -447,7 +316,7 @@ function run() { let options = {} checkBuildEnvironment(); - + if (args.length == 0) { console.log(help) return; @@ -461,20 +330,21 @@ function run() { case "upload": case "up": action="upload"; break; - case "pod": - case "field": - case "petal": - case "patch": - case "patch_sm": - case "versio": target = arg; break; - case "bluemchen": target_path = path.join(__dirname, "seed.bluemchen.json"); break; - case "nehcmeulb": target_path = path.join(__dirname, "seed.nehcmeulb.json"); break; + case "versio": target_path = path.join(__dirname, "versio.json"); break; + case "bluemchen": target_path = path.join(__dirname, "bluemchen.json"); break; + case "nehcmeulb": target_path = path.join(__dirname, "nehcmeulb.json"); break; + case "pod": target_path = path.join(__dirname, "pod.json"); break; + case "patch_init": target_path = path.join(__dirname, "patch_init.json"); break; + case "field": target_path = path.join(__dirname, "field.json"); break; + case "petal": target_path = path.join(__dirname, "petal.json"); break; + case "petal_125b_sm": target_path = path.join(__dirname, "petal_125b_sm.json"); break; + case "patch": target_path = path.join(__dirname, "patch.json"); break; case "watch": watch=true; break; - case "96kHz": - case "48kHz": - case "32kHz": samplerate = +(arg.match(/(\d+)kHz/)[1]); break; + case "96kHz": + case "48kHz": + case "32kHz": samplerate = +(arg.match(/(\d+)kHz/)[1]); break; case "block1": case "block2": @@ -485,15 +355,15 @@ function run() { case "block16": case "block24": case "block32": - case "block48": - case "block64": - case "block96": + case "block48": + case "block64": + case "block96": case "block128": case "block256": blocksize = +(arg.match(/block(\d+)/)[1]); break; case "writejson": - case "nooled": - case "boost": + case "nooled": + case "boost": case "fastmath": options[arg] = true; break; default: { @@ -505,10 +375,10 @@ function run() { 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") + .filter(s => path.parse(s).ext == ".cpp") .map(s => path.join(arg, s)) ) - } else { + } else { let p = path.parse(arg); switch(p.ext) { case ".json": {target_path = arg; target = ""}; break; @@ -536,23 +406,45 @@ function run() { let OOPSY_TARGET_SEED = 0 + let valid_soms = ['seed', 'patch_sm', 'petal_125b_sm']; + let valid_app_type = ['BOOT_NONE', 'BOOT_SRAM', 'BOOT_QPSI']; + let som = 'seed'; + + let old_json = false; + // configure target: if (!target && !target_path) target = "patch"; if (!target_path) { target_path = path.join(__dirname, `daisy.${target}.json`); + old_json = true; } else { - OOPSY_TARGET_SEED = 1 + // TODO -- should a seed target even really exist? Custom boards + // (and even prototypes / breadboards) should really be defined with a JSON file + // OOPSY_TARGET_SEED = 1 target = path.parse(target_path).name.replace(".", "_") + // som_match = path.parse(target_path).name.match(/([A-Za-z_0-9\-]+)\./) + // assert(som_match != null, `Daisy SOM undefined. Provide the SOM as in the following: "som.MyBoard.json"`); + // assert(valid_soms.includes(som_match[1]), `unkown SOM ${som_match[1]}. Valid SOMs: ${valid_soms.join(', ')}`); + // som = som_match[1]; } 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")); hardware.max_apps = hardware.max_apps || 1 + // hardware.som = som; + + // Ensure som is valid + assert(valid_soms.includes(hardware.som), `unkown SOM ${hardware.som}. Valid SOMs: ${valid_soms.join(', ')}`); + + // ensure app type is valid + hardware.app_type = hardware.app_type || "BOOT_NONE"; + assert(valid_app_type.includes(hardware.app_type), `unkown app type ${hardware.app_type}. Valid types: ${valid_app_type.join(', ')}`); // The following is compatibility code, so that the new JSON structure will generate the old JSON structure // At the point that the old one can be retired (because e.g. Patch, Petal etc can be defined in the new format) // this script should be revised to eliminate the old workflow { + hardware.som = hardware.som || "seed"; hardware.inputs = hardware.inputs || {} hardware.outputs = hardware.outputs || {} hardware.datahandlers = hardware.datahandlers || {} @@ -565,33 +457,47 @@ function run() { hardware.defines = hardware.defines || {} hardware.struct = ""; + let tempname = hardware.name; + hardware.name = ''; + let board_info = json2daisy.generate_header(hardware, target_path); + hardware.name = tempname; + + hardware.struct = board_info.header; + hardware.components = board_info.components; + hardware.aliases = board_info.aliases; + hardware.includes = board_info.includes; + if (hardware.components) { - hardware.struct = generate_target_struct(hardware); // generate IO - for (let component of hardware.components) { - + for (let comp in hardware.components) { + let component = hardware.components[comp]; // meta-elements are handled separately if (component.meta) { - + } else { // else it is available for gen mapping: for (let mapping of component.mapping) { - let name = template(mapping.name, component); + // let name = template(mapping.name, component); + component.class_name = 'hardware'; + component.name_upper = component.name.toUpperCase(); + let name = json2daisy.format_map(mapping.name, component); + component.value = name; if (mapping.get) { // an input hardware.inputs[name] = { - code: template(mapping.get, component), + code: json2daisy.format_map(mapping.get, component), automap: component.automap && name == component.name, range: mapping.range, - where: mapping.where + where: mapping.where, + permit_scale: mapping.permit_scale != undefined ? mapping.permit_scale : true } hardware.labels.params[name] = name } if (mapping.set) { // an output hardware.outputs[name] = { - code: template(mapping.set, component), + code: json2daisy.format_map(mapping.set, component), automap: component.automap && name == component.name, range: mapping.range, where: mapping.where || "audio" @@ -603,6 +509,9 @@ function run() { } } + if (old_json) + hardware.defines.OOPSY_OLD_JSON = 1 + for (let alias in hardware.aliases) { let map = hardware.aliases[alias] if (hardware.labels.params[map]) hardware.labels.params[alias] = map @@ -615,7 +524,10 @@ function run() { // consolidate hardware definition: hardware.samplerate = samplerate - if (hardware.defines.OOPSY_IO_COUNT == undefined) hardware.defines.OOPSY_IO_COUNT = 2 + if (hardware.audio) + hardware.defines.OOPSY_IO_COUNT = hardware.audio.channels || 2; + else if (!hardware.defines.OOPSY_IO_COUNT) + hardware.defines.OOPSY_IO_COUNT = 2; if (!hardware.max_apps) hardware.max_apps = 1; hardware.defines.OOPSY_SAMPLERATE = samplerate * 1000 @@ -642,6 +554,7 @@ function run() { // configure build path: const build_path = path.join(__dirname, `build_${build_name}_${target}`) + console.log(`build_path ${path.join(build_path, 'build')}`) console.log(`Building to ${build_path}`) // ensure build path exists: fs.mkdirSync(build_path, {recursive: true}); @@ -681,15 +594,28 @@ function run() { if (options.fastmath) { hardware.defines.GENLIB_USE_FASTMATH = 1; } + if (hardware.som == 'patch_sm') { + hardware.defines.OOPSY_SOM_PATCH_SM = 1; + } + else if (hardware.som == 'petal_125b_sm') { + hardware.defines.OOPSY_SOM_PETAL_SM = 1; + } 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`); + const includes = hardware.includes.map( + item => `-I"${posixify_path(path.relative(build_path, item))}"`); + fs.writeFileSync(makefile_path, ` # Project Name TARGET = ${build_name} +# App type +APP_TYPE = ${hardware.app_type} # Sources -- note, won't work with paths with spaces -CPP_SOURCES = ${posixify_path(path.relative(build_path, maincpp_path).replace(" ", "\\ "))} +CPP_SOURCES = ${posixify_path(path.relative(build_path, maincpp_path).replace(" ", "\\ "))} \\ +${posixify_path(path.relative(build_path, path.join(__dirname, "petal_sm", "daisy_petal_125b_sm.cpp")))} +${includes.length > 0 ? `C_INCLUDES = ${includes.join('\\\n')}` : ``} # Library Locations LIBDAISY_DIR = ${(posixify_path(path.relative(build_path, path.join(__dirname, "libdaisy"))).replace(" ", "\\ "))} ${hardware.defines.OOPSY_TARGET_USES_SDMMC ? `USE_FATFS = 1`:``} @@ -699,7 +625,8 @@ OPT = -O3 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+=-I"${posixify_path(path.relative(build_path, path.join(__dirname, "gen_dsp")))}" \\ +-I${posixify_path(path.relative(build_path, path.join(__dirname, "petal_sm")))} # 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 @@ -710,7 +637,7 @@ CPPFLAGS+=-O3 -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-var console.log(`\t${maincpp_path}`) console.log(`\t${makefile_path}`) console.log(`\t${bin_path}`) - + // add watcher if (watch && watchers.length < 1) { watchers = cpps.map(cpp_path => fs.watch(cpp_path, (event, filepath)=>{ @@ -727,7 +654,7 @@ CPPFLAGS+=-O3 -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-var //if (options.writejson) fs.writeFileSync(path.join(build_path, `${build_name}_${target}.json`), JSON.stringify(config,null," "),"utf8"); const cppcode = ` -/* +/* This code was generated by Oopsy (https://github.com/electro-smith/oopsy) on ${new Date().toString()} @@ -746,6 +673,8 @@ ${Object.keys(hardware.defines).map(k=>` #define ${k} (${hardware.defines[k]})`).join("")} ${hardware.struct} +using json2daisy::Daisy; + ${hardware.inserts.filter(o => o.where == "header").map(o => o.code).join("\n")} #include "../genlib_daisy.h" #include "../genlib_daisy.cpp" @@ -763,11 +692,7 @@ oopsy::AppDef appdefs[] = { }; int main(void) { - #ifdef OOPSY_TARGET_PATCH_SM - oopsy::daisy.hardware.Init(); - #else - oopsy::daisy.hardware.Init(${options.boost|false}); - #endif + oopsy::daisy.hardware.Init(${hardware.som == 'seed' ? options.boost|false : ''}); oopsy::daisy.hardware.SetAudioSampleRate(daisy::SaiHandle::Config::SampleRate::SAI_${hardware.samplerate}KHZ); oopsy::daisy.hardware.SetAudioBlockSize(${hardware.defines.OOPSY_BLOCK_SIZE}); ${hardware.inserts.filter(o => o.where == "init").map(o => o.code).join("\n\t")} @@ -775,7 +700,7 @@ int main(void) { return oopsy::daisy.run(appdefs, ${apps.length}); } ` - fs.writeFileSync(maincpp_path, cppcode, "utf-8"); + fs.writeFileSync(maincpp_path, cppcode, "utf-8"); console.log("oopsy generated code") @@ -797,7 +722,7 @@ int main(void) { // if successful, try to upload to hardware: if (has_dfu_util && action=="upload") { console.log("oopsy flashing...") - + exec(`make program-dfu`, { cwd: build_path }, (err, stdout, stderr)=>{ console.log("stdout", stdout) console.log("stderr", stderr) @@ -887,7 +812,7 @@ function analyze_cpp(cpp, hardware, cpp_path) { // search for history outs: // i.e. any history with "_out" on its name histories: (cpp.match(/t_sample\s+(m_([\w]+)_out_\d+);/gm) || []).map(s=>{ - + const match = /t_sample\s+(m_([\w]+)_out_\d+);/gm.exec(s); let cname = match[1] let name = match[2]; @@ -902,19 +827,19 @@ function analyze_cpp(cpp, hardware, cpp_path) { result.midi_type = "note"; result.midi_num = midimatch[1] !== "" && midimatch[1] !== undefined ? +midimatch[1] : 1; result.midi_notetype = midimatch[3] || "pitch" - } else + } else if (midimatch = /midi_(program|cc|vel|drum)(\d*)(_ch(\d+))?/g.exec(name)) { result.midi_type = midimatch[1]; result.midi_num = midimatch[2] !== "" && midimatch[2] !== undefined ? +midimatch[2] : 1; result.midi_chan = +midimatch[4] || 1; - } else + } else if (midimatch = /midi_(bend|press)(_ch(\d+))?/g.exec(name)) { result.midi_type = midimatch[1]; result.midi_chan = +midimatch[3] || 1; - } else + } else if (midimatch = /midi_(clock|stop|start|continue|sense|reset)?/g.exec(name)) { result.midi_type = midimatch[1]; - } + } // find the initializer: result.default = constexpr( new RegExp(`\\s${cname}\\s+=\\s+([^;]+);`, "gm").exec(cpp)[1] ); @@ -932,7 +857,7 @@ function analyze_cpp(cpp, hardware, cpp_path) { cname: null, } if (type == "GENLIB_PARAMTYPE_FLOAT") { - param.cname = /pi->defaultvalue\s+=\s+self->([^;]+)/gm.exec(s)[1]; + param.cname = /pi->defaultvalue\s+=\s+self->([^;]+)/gm.exec(s)[1]; param.min = +(/pi->outputmin\s+=\s+([^;]+)/gm.exec(s)[1]) param.max = +(/pi->outputmax\s+=\s+([^;]+)/gm.exec(s)[1]) //param.default = +new RegExp(`\\s${param.cname}\\s+=\\s+\\(\\(\\w+\\)([^\\)]+)`, "gm").exec(cpp)[1] @@ -993,7 +918,7 @@ function analyze_cpp(cpp, hardware, cpp_path) { console.log(`[data ${param.name}] has possible source: ${path.resolve( wavpath )}`) wavname = param.name+".wav"; //wavpath = path.resolve( wavpath ) - } + } } if (wavname) { param.wavname = wavname @@ -1011,6 +936,7 @@ function analyze_cpp(cpp, hardware, cpp_path) { function generate_daisy(hardware, nodes) { let daisy = { + som: hardware.som, // DEVICE INPUTS: device_inputs: Object.keys(hardware.inputs).map(v => { let name = v @@ -1060,7 +986,7 @@ function generate_daisy(hardware, nodes) { } daisy.audio_outs.push(name); } - + if (hardware.defines.OOPSY_TARGET_HAS_MIDI_INPUT) { let name = `dsy_midi_in` nodes[name] = { @@ -1148,7 +1074,7 @@ function generate_app(app, hardware, target, config) { } app.audio_outs.push(src); } - + let node = { name: name, // label: label, @@ -1173,7 +1099,7 @@ function generate_app(app, hardware, target, config) { if (map) { label = maplabel } else { - // else it is audio data + // else it is audio data nodes[src].src = src; } nodes[name].label = label @@ -1191,7 +1117,7 @@ function generate_app(app, hardware, target, config) { let node = Object.assign({ varname: varname, }, history); - + if (node.midi_type) { if (node.midi_type == "note") { let id = node.midi_num-1 @@ -1213,13 +1139,13 @@ function generate_app(app, hardware, target, config) { // } } else { - + app.midi_outs.push(node) node.setter_src = "gen."+node.cname if (node.midi_type == "cc") { app.has_midi_out = true; let statusbyte = 176+((node.midi_chan)-1)%16; - node.setter = `daisy.midi_message3(${statusbyte}, ${(node.midi_num)%128}, ((uint8_t)(${node.varname}*127.f)) & 0x7F);`; + node.setter = `daisy.midi_message3(${statusbyte}, ${(node.midi_num)%128}, ((uint8_t)(${node.varname}*127.f)) & 0x7F);`; node.type = "float"; node.midi_throttle = true; node.midi_only_when_changed = true; @@ -1227,7 +1153,7 @@ function generate_app(app, hardware, target, config) { } else if (node.midi_type == "press") { app.has_midi_out = true; let statusbyte = 208+((node.midi_chan)-1)%16; - node.setter = `daisy.midi_message2(${statusbyte}, ((uint8_t)(${node.varname}*127.f)) & 0x7F);`; + node.setter = `daisy.midi_message2(${statusbyte}, ((uint8_t)(${node.varname}*127.f)) & 0x7F);`; node.type = "float"; node.midi_throttle = true; node.midi_only_when_changed = true; @@ -1238,7 +1164,7 @@ function generate_app(app, hardware, target, config) { let float = `((${node.varname}+1.f)*64.f)`; let lsb = `((uint8_t)(${float}*128.f)) & 0x7F`; let msb = `((uint8_t)${float}) & 0x7F`; - node.setter = `daisy.midi_message3(${statusbyte}, ${lsb}, ${msb});`; + node.setter = `daisy.midi_message3(${statusbyte}, ${lsb}, ${msb});`; node.type = "float"; node.midi_throttle = true; node.midi_only_when_changed = true; @@ -1246,20 +1172,20 @@ function generate_app(app, hardware, target, config) { } else if (node.midi_type == "program") { app.has_midi_out = true; let statusbyte = 192+((node.midi_chan)-1)%16; - node.setter = `daisy.midi_message2(${statusbyte}, ${node.varname} & 0x7F);`; + node.setter = `daisy.midi_message2(${statusbyte}, ${node.varname} & 0x7F);`; node.type = "uint8_t"; nodes[name] = node; } else if (node.midi_type == "drum") { app.has_midi_out = true; node.setter = `daisy.midi_message3(153, ${(node.midi_num)%128}, ((uint8_t)(${node.varname}*127.f)) & 0x7F);`; node.type = "float"; - nodes[name] = node + nodes[name] = node } else if (node.midi_type == "vel") { app.has_midi_out = true; let statusbyte = 144+((node.midi_chan)-1)%16; node.setter = `daisy.midi_message3(${statusbyte}, ${(node.midi_num)%128}, ((uint8_t)(${node.varname}*127.f)) & 0x7F);`; node.type = "float"; - nodes[name] = node + nodes[name] = node } else if (node.midi_type == "clock" || node.midi_type == "stop" || node.midi_type == "start" @@ -1279,10 +1205,10 @@ function generate_app(app, hardware, target, config) { node.setter = `daisy.midi_message1(254);`; } else if (node.midi_type == "reset") { node.setter = `daisy.midi_message1(255);`; - } + } node.type = "uint8_t"; - nodes[name] = node - } + nodes[name] = node + } } } else { @@ -1299,12 +1225,12 @@ function generate_app(app, hardware, target, config) { // was this history mapped to something? if (map) { - nodes[name] = node + nodes[name] = node node.type = "t_sample"; nodes[map].src = "gen."+node.cname; //from.push(src); // nodes[src].to.push(map) } - + } return name; }) @@ -1335,30 +1261,30 @@ function generate_app(app, hardware, target, config) { node.where = "midi_msg" // need to set "src" to something to prevent this being automapped src = node.where - node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${176+ch}` : `daisy.midi.status/16 == 11`} && daisy.midi.byte[0] == ${cc}) { + node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${176+ch}` : `daisy.midi.status/16 == 11`} && daisy.midi.byte[0] == ${cc}) { ${node.varname} = (daisy.midi.byte[1]/127.f)*${asCppNumber(node.range)} + ${asCppNumber(node.min)}; }`; - } else + } else if (match = (/^midi_press(_(ch)?(\d+))?/g).exec(param.name)) { let ch = match[3] ? ((+match[3])+15)%16 : null; app.has_midi_in = true; node.where = "midi_msg" // need to set "src" to something to prevent this being automapped src = node.where - node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${208+ch}` : `daisy.midi.status/16 == 13`}) { + node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${208+ch}` : `daisy.midi.status/16 == 13`}) { ${node.varname} = (daisy.midi.byte[0]/127.f)*${asCppNumber(node.range)} + ${asCppNumber(node.min)}; }`; - } else + } else if (match = (/^midi_program(_(ch)?(\d+))?/g).exec(param.name)) { let ch = match[3] ? ((+match[3])+15)%16 : null; app.has_midi_in = true; node.where = "midi_msg" // need to set "src" to something to prevent this being automapped src = node.where - node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${192+ch}` : `daisy.midi.status/16 == 12`}) { + node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${192+ch}` : `daisy.midi.status/16 == 12`}) { ${node.varname} = (daisy.midi.byte[0]/127.f)*${asCppNumber(node.range)} + ${asCppNumber(node.min)}; }`; - } else + } else if (match = (/^midi_(vel|drum)(\d+)(_(ch)?(\d+))?/g).exec(param.name)) { let ch = match[5] ? ((+match[5])+15)%16 : (match[1] == "drum" ? 9 : null); let note = (+match[2])%128; @@ -1366,26 +1292,26 @@ function generate_app(app, hardware, target, config) { node.where = "midi_msg" // need to set "src" to something to prevent this being automapped src = node.where - node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `(daisy.midi.status == ${128+ch} || daisy.midi.status == ${144+ch})` : `(daisy.midi.status/16 == 8 || daisy.midi.status/16 == 9)`} && daisy.midi.byte[0] == ${note}) { + node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `(daisy.midi.status == ${128+ch} || daisy.midi.status == ${144+ch})` : `(daisy.midi.status/16 == 8 || daisy.midi.status/16 == 9)`} && daisy.midi.byte[0] == ${note}) { ${node.varname} = (daisy.midi.byte[1]/127.f)*${asCppNumber(node.range)} + ${asCppNumber(node.min)}; }`; - } else + } else if (match = (/^midi_bend(_(ch)?(\d+))?/g).exec(param.name)) { let ch = match[3] ? ((+match[3])+15)%16 : null; app.has_midi_in = true; node.where = "midi_msg" // need to set "src" to something to prevent this being automapped src = node.where - node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${224+ch}` : `daisy.midi.status/16 == 14`}) { + node.code = `if (daisy.midi.lastbyte == 1 && ${ch != null ? `daisy.midi.status == ${224+ch}` : `daisy.midi.status/16 == 14`}) { ${node.varname} = ((daisy.midi.byte[0] + daisy.midi.byte[1]/128.f)/128.f)*${asCppNumber(node.range)} + ${asCppNumber(node.min)}; }`; - } else + } else if (param.name == "midi_clock") { app.has_midi_in = true; node.where = "midi_status" // need to set "src" to something to prevent this being automapped src = node.where - node.code = `if (byte == 248) { + node.code = `if (byte == 248) { ${node.varname} = 1.f; }`; // reset: @@ -1398,9 +1324,9 @@ function generate_app(app, hardware, target, config) { node.where = "midi_status" // need to set "src" to something to prevent this being automapped src = node.where - node.code = `if (byte == 250 || byte == 251) { + node.code = `if (byte == 250 || byte == 251) { ${node.varname} = 1.f; - } else if (byte == 252) { + } else if (byte == 252) { ${node.varname} = 0.f; }`; // reset: @@ -1421,7 +1347,7 @@ function generate_app(app, hardware, target, config) { //type = match[3]; type = match[1] // trim type from label: - //label = (match[2] || "") + (match[5] || "") + //label = (match[2] || "") + (match[5] || "") label = match[3] || label } } @@ -1432,6 +1358,30 @@ function generate_app(app, hardware, target, config) { node.src = src; node.label = label; + // Apply input scaling + if (src in hardware.inputs) + { + let input = hardware.inputs[src]; + node.permit_scale = input.permit_scale; + + // TODO -- we should allow no scaling to occur on certain inputs + if ('range' in input && typeof input.range !== 'undefined') + { + let input_min = input.range[0] || 0; + let input_max = input.range[1] || 1; + + // We ignore this step if the fields are default + if (input_min != 0 || input_max != 1) + { + let new_range = node.range / (input_max - input_min); + node.range = new_range; + + let new_min = node.min - input_min * new_range; + node.min = new_min; + } + } + } + let ideal_steps = 100 // about 4 good twists of the encoder if (node.type == "bool" || node.type == "int") { node.stepsize = 1 @@ -1446,13 +1396,13 @@ function generate_app(app, hardware, target, config) { let power = Math.round(Math.log2(node.range / ideal_steps)) node.stepsize = Math.pow(2, power) } - } + } } if (!node.stepsize) { // general case: node.stepsize = node.range / ideal_steps } - + nodes[varname] = node; if (src && nodes[src]) { nodes[src].to.push(varname) @@ -1506,13 +1456,16 @@ function generate_app(app, hardware, target, config) { // find next param without a src: while (param && !!nodes[param].src) param = gen.params[++upi]; if (param) { - //console.log(name, "map to", param) + // console.log(name, "map to", param) nodes[param].src = name; node.to.push(param); } } }) + // TODO -- This may or may not be implemented any time soon + // let board_glue = daisy_glue.parse_parameters(nodes, hardware.components, hardware.aliases, 'hardware'); + // normal any audio outs from earlier (non cv/gate/midi) audio outs { let available = [] @@ -1527,6 +1480,8 @@ function generate_app(app, hardware, target, config) { }); } + let som_or_seed = hardware.defines.OOPSY_OLD_JSON ? 'seed' : 'som'; + const struct = ` struct App_${name} : public oopsy::App { @@ -1545,15 +1500,11 @@ struct App_${name} : public oopsy::App { float ${node.name};`).join("")} ${app.audio_outs.map(name=>` float ${name}[OOPSY_BLOCK_SIZE];`).join("")} - + void init(oopsy::GenDaisy& daisy) { - #ifdef OOPSY_TARGET_PATCH_SM - daisy.gen = ${name}::create(daisy.hardware.AudioSampleRate(), daisy.hardware.AudioBlockSize()); - #else - daisy.gen = ${name}::create(daisy.hardware.seed.AudioSampleRate(), daisy.hardware.seed.AudioBlockSize()); - #endif + daisy.gen = ${name}::create(daisy.hardware.${som_or_seed}.AudioSampleRate(), daisy.hardware.${som_or_seed}.AudioBlockSize()); ${name}::State& gen = *(${name}::State *)daisy.gen; - + daisy.param_count = ${gen.params.length}; ${(defines.OOPSY_HAS_PARAM_VIEW) ? `daisy.param_selected = ${Math.max(0, gen.params.map(name=>nodes[name].src).indexOf(undefined))};`:``} ${gen.params.map(name=>nodes[name]) @@ -1579,6 +1530,7 @@ struct App_${name} : public oopsy::App { void audioCallback(oopsy::GenDaisy& daisy, daisy::AudioHandle::InputBuffer hardware_ins, daisy::AudioHandle::OutputBuffer hardware_outs, size_t size) { Daisy& hardware = daisy.hardware; ${name}::State& gen = *(${name}::State *)daisy.gen; + ${hardware.som == 'seed' ? "hardware.ProcessAllControls();" : ""} ${app.inserts.concat(hardware.inserts).filter(o => o.where == "audio").map(o => o.code).join("\n\t")} ${daisy.device_inputs.map(name => nodes[name]) .filter(node => node.to.length) @@ -1593,8 +1545,7 @@ struct App_${name} : public oopsy::App { .map(name=>nodes[name]) .filter(node => node.src) .filter(node => node.where == "audio" || node.where == undefined) - .map(node=>` - ${node.varname} = (${node.type})(${node.src}*${asCppNumber(node.range)} + ${asCppNumber(node.min + (node.type == "int" || node.type == "bool" ? 0.5 : 0))});`).join("")} + .map(node_scale).join("")} ${gen.params .map(name=>nodes[name]) .map(node=>` @@ -1606,7 +1557,7 @@ struct App_${name} : public oopsy::App { ${app.has_midi_in ? daisy.midi_ins.map(name=>` float * ${name} = daisy.midi_in_data;`).join("") : ''} // ${gen.audio_ins.map(name=>nodes[name].label).join(", ")}: - float * inputs[] = { ${gen.audio_ins.map(name=>nodes[name].src).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); @@ -1631,13 +1582,13 @@ struct App_${name} : public oopsy::App { if (${node.varname} != (${node.type})${node.setter_src}) { ${node.varname} = ${node.setter_src}; ${node.setter} - }`).join("")} + }`).join("")} ${app.midi_noteouts .filter(note=>note.vel && note.pitch) .map(note=>` - ${note.cname}.update(daisy, - ((uint8_t)(gen.${note.vel.cname}*127.f)) & 0x7F, - ((uint8_t)gen.${note.pitch.cname}) & 0x7F, + ${note.cname}.update(daisy, + ((uint8_t)(gen.${note.vel.cname}*127.f)) & 0x7F, + ((uint8_t)gen.${note.pitch.cname}) & 0x7F, ${note.chan ? `((uint8_t)(gen.${note.chan.cname})-1) % 16` : "0"});`).join("")} // msgs: ${(app.midi_outs.filter(node=>node.midi_throttle).length + app.midi_noteouts.filter(note=>note.press).length)} // rate: ${hardware.defines.OOPSY_BLOCK_RATE/500} @@ -1664,8 +1615,8 @@ struct App_${name} : public oopsy::App { memcpy(${node.name}, ${node.src}, sizeof(float)*size);` : ` memset(${node.name}, 0, sizeof(float)*size);`).join("")} ${app.inserts.concat(hardware.inserts).filter(o => o.where == "post_audio").map(o => o.code).join("\n\t")} - ${hardware.defines.OOPSY_TARGET_SEED ? "hardware.PostProcess();" : ""} - } + ${hardware.som == 'seed' || hardware.som == 'petal_125b_sm' ? "hardware.PostProcess();" : ""} + } void mainloopCallback(oopsy::GenDaisy& daisy, uint32_t t, uint32_t dt) { Daisy& hardware = daisy.hardware; @@ -1692,14 +1643,14 @@ struct App_${name} : public oopsy::App { .concat(`if (byte == 0xFF) { // reset event -> go to bootloader daisy.log("reboot"); daisy::System::ResetToBootloader(); - } + } if (byte <= 240 || byte == 247) { - daisy.midi.status = byte; + daisy.midi.status = byte; daisy.midi.lastbyte = 255; // means 'no bytes received' }`) .join(" else ")} } else { - daisy.midi.lastbyte = !daisy.midi.lastbyte; + daisy.midi.lastbyte = !daisy.midi.lastbyte; daisy.midi.byte[daisy.midi.lastbyte] = byte; ${gen.params .map(name=>nodes[name]) @@ -1720,6 +1671,7 @@ struct App_${name} : public oopsy::App { }` : ""} daisy.midi_in_active = 1; }` : "// no midi input handling"} + hardware.LoopProcess(); } void displayCallback(oopsy::GenDaisy& daisy, uint32_t t, uint32_t dt) { @@ -1736,7 +1688,7 @@ struct App_${name} : public oopsy::App { .filter(node => node.config.where == "display") .map(node=>` ${interpolate(node.config.code, node)}`).join("")} - ${hardware.defines.OOPSY_TARGET_SEED ? "hardware.Display();" : ""} + ${hardware.som == 'seed' ? "hardware.Display();" : ""} } ${defines.OOPSY_HAS_PARAM_VIEW ? ` @@ -1747,7 +1699,7 @@ struct App_${name} : public oopsy::App { .map((node, i)=>` case ${i}: return ${node.varname} = (${node.type})(val > ${asCppNumber(node.max, node.type)}) ? ${asCppNumber(node.max, node.type)} : (val < ${asCppNumber(node.min, node.type)}) ? ${asCppNumber(node.min, node.type)} : val;`).join("")} } - return 0.f; + return 0.f; } ${defines.OOPSY_TARGET_HAS_OLED && defines.OOPSY_HAS_PARAM_VIEW ? ` @@ -1755,13 +1707,13 @@ struct App_${name} : public oopsy::App { switch(idx) { ${gen.params.map(name=>nodes[name]).map((node, i)=>` case ${i}: ${defines.OOPSY_CAN_PARAM_TWEAK ? ` if (tweak) setparam(${i}, ${node.varname} + daisy.menu_button_incr ${node.type == "float" ? '* ' + asCppNumber(node.stepsize, node.type) : ""});` : ""} - ${defines.OOPSY_OLED_DISPLAY_WIDTH < 128 ? `snprintf(label, len, "${node.label.substring(0,5).padEnd(5," ")}" FLT_FMT3 "", FLT_VAR3(${node.varname}) );` : `snprintf(label, len, "${node.src ? - `${node.src.substring(0,3).padEnd(3," ")} ${node.label.substring(0,11).padEnd(11," ")}" FLT_FMT3 ""` - : + ${defines.OOPSY_OLED_DISPLAY_WIDTH < 128 ? `snprintf(label, len, "${node.label.substring(0,5).padEnd(5," ")}" FLT_FMT3 "", FLT_VAR3(${node.varname}) );` : `snprintf(label, len, "${node.src ? + `${node.src.substring(0,3).padEnd(3," ")} ${node.label.substring(0,11).padEnd(11," ")}" FLT_FMT3 ""` + : `%s ${node.label.substring(0,11).padEnd(11," ")}" FLT_FMT3 "", (daisy.param_is_tweaking && ${i} == daisy.param_selected) ? "enc" : " "` }, FLT_VAR3(${node.varname}) );`} break;`).join("")} - } + } } ` : ""} ` : ""} diff --git a/source/patch.json b/source/patch.json new file mode 100644 index 0000000..b8ba9a1 --- /dev/null +++ b/source/patch.json @@ -0,0 +1,94 @@ +{ + "name": "patch", + "som": "seed", + "defines": { + "OOPSY_TARGET_PATCH": 1, + "OOPSY_TARGET_HAS_MIDI_INPUT": 1, + "OOPSY_TARGET_HAS_MIDI_OUTPUT": 1, + "OOPSY_IO_COUNT": 4, + "OOPSY_HAS_ENCODER": 1, + "OOPSY_TARGET_HAS_OLED": 1 + }, + "max_apps": 8, + "display": {}, + "audio": { + "channels": 4 + }, + "external_codecs": [ + { + "periph": "SAI_2", + "a_sync": "SLAVE", + "b_sync": "MASTER", + "a_dir": "TRANSMIT", + "b_dir": "RECEIVE", + "pin": { + "fs": 27, + "mclk": 24, + "sck": 28, + "sb": 25, + "sa": 26 + } + } + ], + "components": { + "knob1": { + "component": "AnalogControl", + "pin": 15, + "flip": "true" + }, + "knob2": { + "component": "AnalogControl", + "pin": 16, + "flip": "true" + }, + "knob3": { + "component": "AnalogControl", + "pin": 21, + "flip": "true" + }, + "knob4": { + "component": "AnalogControl", + "pin": 18, + "flip": "true" + }, + "encoder": { + "component": "Encoder", + "pin": { + "a": 12, + "b": 11, + "click": 0 + } + }, + "gateout": { + "component": "GateOut", + "pin": 17, + "display": "" + }, + "cvout": { + "component": "CVOuts" + }, + "gatein1": { + "component": "GateIn", + "pin": 20 + }, + "gatein2": { + "component": "GateIn", + "pin": 19 + } + }, + "aliases": { + "gate": "gatein1", + "gate1": "gatein1", + "gate2": "gatein2", + "cvout": "cvout1", + "encswitch": "encoder_rise", + "enp": "encoder_press", + "press": "encoder_press", + "knob": "knob1", + "ctrl": "knob1", + "ctrl1": "knob1", + "ctrl2": "knob2", + "ctrl3": "knob3", + "ctrl4": "knob4" + } +} diff --git a/source/patch_init.json b/source/patch_init.json new file mode 100644 index 0000000..1d07a8e --- /dev/null +++ b/source/patch_init.json @@ -0,0 +1,148 @@ +{ + "name": "patch_init", + "som": "patch_sm", + "defines": {}, + "components": { + "cv_1": { + "component": "AnalogControl", + "pin": "C5", + "is_default": true + }, + "cv_2": { + "component": "AnalogControl", + "pin": "C4", + "is_default": true + }, + "cv_3": { + "component": "AnalogControl", + "pin": "C3", + "is_default": true + }, + "cv_4": { + "component": "AnalogControl", + "pin": "C2", + "is_default": true + }, + "cv_5": { + "component": "AnalogControlBipolar", + "pin": "C6", + "is_default": true + }, + "cv_6": { + "component": "AnalogControlBipolar", + "pin": "C7", + "is_default": true + }, + "cv_7": { + "component": "AnalogControlBipolar", + "pin": "C8", + "is_default": true + }, + "cv_8": { + "component": "AnalogControlBipolar", + "pin": "C9", + "is_default": true + }, + "adc_9": { + "component": "AnalogControl", + "pin": "A2", + "is_default": true + }, + "adc_10": { + "component": "AnalogControl", + "pin": "A3", + "is_default": true + }, + "adc_11": { + "component": "AnalogControl", + "pin": "D9", + "is_default": true + }, + "adc_12": { + "component": "AnalogControl", + "pin": "D8", + "is_default": true + }, + "gate_out_1": { + "component": "GateOut", + "pin": "B5", + "display": "", + "is_default": true + }, + "gate_out_2": { + "component": "GateOut", + "pin": "B6", + "display": "", + "is_default": true + }, + "cvout": { + "component": "CVOuts", + "is_default": true + }, + "gate_in_1": { + "component": "GateIn", + "pin": "B10", + "is_default": true + }, + "gate_in_2": { + "component": "GateIn", + "pin": "B9", + "is_default": true + }, + "sw1": { + "component": "Switch", + "pin": "B7" + }, + "sw2": { + "component": "Switch", + "pin": "B8" + } + }, + "aliases": { + "switch": "sw1", + "switch1": "sw1", + "switch2": "sw2", + "button": "sw1", + "toggle": "sw2", + "gate": "gate_in_1", + "gate1": "gate_in_1", + "gate2": "gate_in_2", + "gateout": "gate_out_1", + "gateout1": "gate_out_1", + "gateout2": "gate_out_2", + "cvout": "cvout1", + "cv_out_1": "cvout1", + "cv_out_2": "cvout2", + "led": "cvout2", + "knob": "cv_1", + "knob1": "cv_1", + "knob2": "cv_2", + "knob3": "cv_3", + "knob4": "cv_4", + "knob5": "cv_5", + "knob6": "cv_6", + "knob7": "cv_7", + "knob8": "cv_8", + "ctrl": "cv_1", + "ctrl1": "cv_1", + "ctrl2": "cv_2", + "ctrl3": "cv_3", + "ctrl4": "cv_4", + "ctrl5": "cv_5", + "ctrl6": "cv_6", + "ctrl7": "cv_7", + "ctrl8": "cv_8", + "cv1": "cv_1", + "cv2": "cv_2", + "cv3": "cv_3", + "cv4": "cv_4", + "cv5": "cv_5", + "cv6": "cv_6", + "cv7": "cv_7", + "cv8": "cv_8", + "adc9": "adc_9", + "adc10": "adc_10", + "adc11": "adc_11", + "adc12": "adc_12" + } +} \ No newline at end of file diff --git a/source/petal.json b/source/petal.json new file mode 100644 index 0000000..c8ce815 --- /dev/null +++ b/source/petal.json @@ -0,0 +1,210 @@ +{ + "name": "petal", + "som": "seed", + "defines": { + "OOPSY_TARGET_PETAL": 1, + "OOPSY_HAS_ENCODER": 1 + }, + "max_apps": 8, + "parents": { + "i2c": { + "component": "i2c", + "pin": { + "scl": 11, + "sda": 12 + } + }, + "led_driver": { + "component": "PCA9685", + "address": "{0x00, 0x01}", + "parent": "i2c", + "driver_count": 2 + } + }, + "audio": { + "channels": 2 + }, + "components": { + "sw1": { + "component": "Switch", + "pin": 8 + }, + "sw2": { + "component": "Switch", + "pin": 9 + }, + "sw3": { + "component": "Switch", + "pin": 10 + }, + "sw4": { + "component": "Switch", + "pin": 13 + }, + "sw5": { + "component": "Switch", + "pin": 25 + }, + "sw6": { + "component": "Switch", + "pin": 26 + }, + "sw7": { + "component": "Switch", + "pin": 7 + }, + "encoder": { + "component": "Encoder", + "pin": { + "a": 28, + "b": 27, + "click": 14 + } + }, + "knob1": { + "component": "AnalogControl", + "pin": 16 + }, + "knob2": { + "component": "AnalogControl", + "pin": 19 + }, + "knob3": { + "component": "AnalogControl", + "pin": 17 + }, + "knob4": { + "component": "AnalogControl", + "pin": 20 + }, + "knob5": { + "component": "AnalogControl", + "pin": 18 + }, + "knob6": { + "component": "AnalogControl", + "pin": 21 + }, + "expression": { + "component": "AnalogControl", + "pin": 15 + }, + "led_ring_1": { + "component": "PCA9685RgbLed", + "index": { + "red": 0, + "green": 1, + "blue": 2 + }, + "parent": "led_driver" + }, + "led_ring_2": { + "component": "PCA9685RgbLed", + "index": { + "red": 6, + "green": 7, + "blue": 8 + }, + "parent": "led_driver" + }, + "led_ring_3": { + "component": "PCA9685RgbLed", + "index": { + "red": 12, + "green": 13, + "blue": 14 + }, + "parent": "led_driver" + }, + "led_ring_4": { + "component": "PCA9685RgbLed", + "index": { + "red": 16, + "green": 17, + "blue": 18 + }, + "parent": "led_driver" + }, + "led_ring_5": { + "component": "PCA9685RgbLed", + "index": { + "red": 3, + "green": 4, + "blue": 5 + }, + "parent": "led_driver" + }, + "led_ring_6": { + "component": "PCA9685RgbLed", + "index": { + "red": 9, + "green": 10, + "blue": 11 + }, + "parent": "led_driver" + }, + "led_ring_7": { + "component": "PCA9685RgbLed", + "index": { + "red": 19, + "green": 20, + "blue": 21 + }, + "parent": "led_driver" + }, + "led_ring_8": { + "component": "PCA9685RgbLed", + "index": { + "red": 22, + "green": 23, + "blue": 24 + }, + "parent": "led_driver" + }, + "led_fs_1": { + "component": "PCA9685Led", + "index": 15, + "parent": "led_driver" + }, + "led_fs_2": { + "component": "PCA9685Led", + "index": 25, + "parent": "led_driver" + }, + "led_fs_3": { + "component": "PCA9685Led", + "index": 26, + "parent": "led_driver" + }, + "led_fs_4": { + "component": "PCA9685Led", + "index": 27, + "parent": "led_driver" + } + }, + "aliases": { + "led1": "led_fs_1", + "led2": "led_fs_2", + "led3": "led_fs_3", + "led4": "led_fs_4", + "switch": "sw1", + "switch1": "sw1", + "switch2": "sw2", + "switch3": "sw3", + "switch4": "sw4", + "switch5": "sw5", + "switch6": "sw6", + "switch7": "sw7", + "encswitch": "encoder_rise", + "enp": "encoder_press", + "press": "encoder_press", + "knob": "knob1", + "ctrl": "knob1", + "ctrl1": "knob1", + "ctrl2": "knob2", + "ctrl3": "knob3", + "ctrl4": "knob4", + "ctrl5": "knob5", + "ctrl6": "knob6" + } +} diff --git a/source/petal_125b_sm.json b/source/petal_125b_sm.json new file mode 100644 index 0000000..6d99b44 --- /dev/null +++ b/source/petal_125b_sm.json @@ -0,0 +1,98 @@ +{ + "name": "petal_125b_sm", + "som": "petal_125b_sm", + "audio": { + "channels": 1 + }, + "components": { + "knob_1": { + "component": "AnalogControl", + "index": 0, + "is_default": true + }, + "knob_2": { + "component": "AnalogControl", + "index": 1, + "is_default": true + }, + "knob_3": { + "component": "AnalogControl", + "index": 2, + "is_default": true + }, + "knob_4": { + "component": "AnalogControl", + "index": 3, + "is_default": true + }, + "knob_5": { + "component": "AnalogControl", + "index": 4, + "is_default": true + }, + "knob_6": { + "component": "AnalogControl", + "index": 5, + "is_default": true + }, + "expression": { + "component": "Expression", + "is_default": true + }, + "toggle_1": { + "component": "Switch3", + "index": 0, + "is_default": true + }, + "toggle_2": { + "component": "Switch3", + "index": 1, + "is_default": true + }, + "toggle_3": { + "component": "Switch3", + "index": 2, + "is_default": true + }, + "footswitch_1": { + "component": "Switch", + "index": 1, + "is_default": true + }, + "footswitch_2": { + "component": "Switch", + "index": 2, + "is_default": true + }, + "led1": { + "component": "RgbLed", + "index": {"r": 0, "g": 1, "b": 2}, + "is_default": true + }, + "led2": { + "component": "Led", + "index": 3, + "is_default": true + }, + "led3": { + "component": "RgbLed", + "index": {"r": 4, "g": 5, "b": 6}, + "is_default": true + }, + "relay": { + "component": "Relay", + "is_default": true + } + }, + "aliases": { + "knob1": "knob_1", + "knob2": "knob_2", + "knob3": "knob_3", + "knob4": "knob_4", + "knob5": "knob_5", + "knob6": "knob_6", + "sw1": "toggle_1", + "sw2": "toggle_2", + "sw3": "toggle_3" + } +} \ No newline at end of file diff --git a/source/petal_led_hardcode.h b/source/petal_led_hardcode.h new file mode 100644 index 0000000..bc4ac23 --- /dev/null +++ b/source/petal_led_hardcode.h @@ -0,0 +1,74 @@ +#include +#include "daisy.h" +#include "daisy_petal.h" + +enum LedOrder +{ + LED_RING_1_R, + LED_RING_1_G, + LED_RING_1_B, + LED_RING_5_R, + LED_RING_5_G, + LED_RING_5_B, + LED_RING_2_R, + LED_RING_2_G, + LED_RING_2_B, + LED_RING_6_R, + LED_RING_6_G, + LED_RING_6_B, + LED_RING_3_R, + LED_RING_3_G, + LED_RING_3_B, + LED_FS_1, + LED_RING_4_R, + LED_RING_4_G, + LED_RING_4_B, + LED_RING_7_R, + LED_RING_7_G, + LED_RING_7_B, + LED_RING_8_R, + LED_RING_8_G, + LED_RING_8_B, + LED_FS_2, + LED_FS_3, + LED_FS_4, + LED_FAKE1, + LED_FAKE2, + LED_FAKE3, + LED_FAKE4, + LED_LAST, +}; + +template +void SetRingLed(daisy::LedDriverPca9685* led_driver, daisy::DaisyPetal::RingLed idx, float r, float g, float b) +{ + uint8_t r_addr[daisy::DaisyPetal::RingLed::RING_LED_LAST] = {LED_RING_1_R, + LED_RING_2_R, + LED_RING_3_R, + LED_RING_4_R, + LED_RING_5_R, + LED_RING_6_R, + LED_RING_7_R, + LED_RING_8_R}; + uint8_t g_addr[daisy::DaisyPetal::RingLed::RING_LED_LAST] = {LED_RING_1_G, + LED_RING_2_G, + LED_RING_3_G, + LED_RING_4_G, + LED_RING_5_G, + LED_RING_6_G, + LED_RING_7_G, + LED_RING_8_G}; + uint8_t b_addr[daisy::DaisyPetal::RingLed::RING_LED_LAST] = {LED_RING_1_B, + LED_RING_2_B, + LED_RING_3_B, + LED_RING_4_B, + LED_RING_5_B, + LED_RING_6_B, + LED_RING_7_B, + LED_RING_8_B}; + + + led_driver->SetLed(r_addr[idx], r); + led_driver->SetLed(g_addr[idx], g); + led_driver->SetLed(b_addr[idx], b); +} \ No newline at end of file diff --git a/source/petal_sm/daisy_petal_125b_sm.cpp b/source/petal_sm/daisy_petal_125b_sm.cpp new file mode 100644 index 0000000..2c522b7 --- /dev/null +++ b/source/petal_sm/daisy_petal_125b_sm.cpp @@ -0,0 +1,334 @@ +#include "daisy_petal_125b_sm.h" +#include + +namespace daisy +{ + void Petal125BSM::Init() + { + /** Pot Pins */ + constexpr Pin knobpins[KNOB_LAST] = { + Pin(PORTC, 4), /**< VR1 - sch: ADC_POT_6 */ + Pin(PORTA, 7), /**< VR2 - sch: ADC_POT_5 */ + Pin(PORTB, 1), /**< VR3 - sch: ADC_POT_3 */ + Pin(PORTA, 6), /**< VR4 - sch: ADC_POT_2 */ + Pin(PORTA, 2), /**< VR5 - sch: ADC_POT_4 */ + Pin(PORTA, 3), /**< VR6 - sch: ADC_POT_1 */ + }; + + /** 3-way Toggle Switch Pins + * These are routed to the opposite sides + * of what the Switch3 class expects. + * + * So below, we initialize them in what + * may appear to be the opposite direction. + */ + constexpr Pin togglepins[TOGGLE_LAST][2] = { + {Pin(PORTB, 4), Pin(PORTC, 12)}, /**< sch: GPIO_TSW (1A, 1B) */ + {Pin(PORTA, 8), Pin(PORTC, 7)}, /**< sch: GPIO_TSW (3A, 3B) */ + {Pin(PORTB, 15), Pin(PORTB, 14)}, /**< sch: GPIO_TSW (2A, 2B) */ + }; + + /** Momentary Footswitch Pins */ + constexpr Pin footswpins[FOOTSWITCH_LAST] = { + Pin(PORTD, 13), /**< sch: GPIO_MSW_2 */ + Pin(PORTC, 6), /**< sch: GPIO_MSW_1 */ + }; + + /** LED Pins */ + constexpr Pin ledpins[LED_LAST] = { + Pin(PORTA, 5), /**< LED1R - sch: GPIO_LED_1_R, */ + Pin(PORTB, 6), /**< LED1G - sch: GPIO_LED_1_G, */ + Pin(PORTD, 7), /**< LED1B - sch: GPIO_LED_1_B, */ + Pin(PORTG, 14), /**< LED2 - sch: GPIO_LED_2, */ + Pin(PORTG, 10), /**< LED3R - sch: GPIO_LED_3_R, */ + Pin(PORTC, 10), /**< LED3G - sch: GPIO_LED_3_G, */ + Pin(PORTC, 11), /**< LED3B - sch: GPIO_LED_3_B, */ + Pin(PORTB, 5), /**< LED4 - sch: GPIO_LED_4, */ + Pin(PORTB, 7), /**< LED5 - sch: GPIO_LED_5, */ + }; + + /** Expression Pin */ + constexpr Pin exprpin = Pin(PORTC, 0); + + /** Relay Control Pin */ + constexpr Pin relay_pin = Pin(PORTG, 13); + + /** System Init (sys, ram, flash, etc.) */ + System::Config syscfg; + syscfg.Defaults(); + sys.Init(syscfg); + + /** SDRAM */ + sdram.Init(); + + /** EXT. FLASH */ + auto qspi_config = qspi.GetConfig(); + qspi_config.device = QSPIHandle::Config::Device::IS25LP064A; + qspi_config.mode = QSPIHandle::Config::Mode::MEMORY_MAPPED; + qspi_config.pin_config.io0 = dsy_pin(DSY_GPIOF, 8); + qspi_config.pin_config.io1 = dsy_pin(DSY_GPIOF, 9); + qspi_config.pin_config.io2 = dsy_pin(DSY_GPIOF, 7); + qspi_config.pin_config.io3 = dsy_pin(DSY_GPIOF, 6); + qspi_config.pin_config.clk = dsy_pin(DSY_GPIOF, 10); + qspi_config.pin_config.ncs = dsy_pin(DSY_GPIOG, 6); + qspi.Init(qspi_config); + + // Audio Init + SaiHandle::Config sai_config; + sai_config.periph = SaiHandle::Config::Peripheral::SAI_1; + sai_config.sr = SaiHandle::Config::SampleRate::SAI_48KHZ; + sai_config.bit_depth = SaiHandle::Config::BitDepth::SAI_24BIT; + sai_config.a_sync = SaiHandle::Config::Sync::MASTER; + sai_config.b_sync = SaiHandle::Config::Sync::SLAVE; + sai_config.a_dir = SaiHandle::Config::Direction::RECEIVE; + sai_config.b_dir = SaiHandle::Config::Direction::TRANSMIT; + sai_config.pin_config.fs = {DSY_GPIOE, 4}; + sai_config.pin_config.mclk = {DSY_GPIOE, 2}; + sai_config.pin_config.sck = {DSY_GPIOE, 5}; + sai_config.pin_config.sa = {DSY_GPIOE, 6}; + sai_config.pin_config.sb = {DSY_GPIOE, 3}; + SaiHandle sai_1_handle; + sai_1_handle.Init(sai_config); + + // TODO: Add Codec Init + I2CHandle::Config i2c_cfg; + i2c_cfg.periph = I2CHandle::Config::Peripheral::I2C_1; + i2c_cfg.speed = I2CHandle::Config::Speed::I2C_400KHZ; + i2c_cfg.mode = I2CHandle::Config::Mode::I2C_MASTER; + i2c_cfg.pin_config.scl = {DSY_GPIOB, 8}; + i2c_cfg.pin_config.sda = {DSY_GPIOB, 9}; + + I2CHandle i2c1; + i2c1.Init(i2c_cfg); + codec.Init(i2c1); + + AudioHandle::Config audio_config; + audio_config.blocksize = 4; + audio_config.samplerate = SaiHandle::Config::SampleRate::SAI_48KHZ; + audio_config.postgain = 1.f; + audio.Init(audio_config, sai_1_handle); + callback_rate_ = AudioSampleRate() / AudioBlockSize(); + + // Adc Init + AdcChannelConfig adc_config[KNOB_LAST + 1]; + for (size_t i = 0; i < KNOB_LAST; i++) + { + adc_config[i].InitSingle(knobpins[i]); + } + // last ADC channel will be expression input. + adc_config[KNOB_LAST].InitSingle(exprpin); + adc.Init(adc_config, KNOB_LAST + 1); + + for (size_t i = 0; i < KNOB_LAST; i++) + { + knob[i].Init(adc.GetPtr(i), AudioCallbackRate()); + } + expression.Init(adc.GetPtr(KNOB_LAST), AudioCallbackRate()); + // Other Inits (switches, analogcontrols, etc.) + for (size_t i = 0; i < TOGGLE_LAST; i++) + { + toggle[i].Init(togglepins[i][1], togglepins[i][0]); + } + footswitch1.Init(footswpins[0], AudioCallbackRate()); + footswitch2.Init(footswpins[1], AudioCallbackRate()); + for (size_t i = 0; i < LED_LAST; i++) + { + // Invert RGB LEDs because they're common anode + bool inv = (i == LED_1_R) || (i == LED_1_G) || (i == LED_1_B) || + (i == LED_3_R) | (i == LED_3_G) | (i == LED_3_B) + ? true + : false; + led[i].Init(ledpins[i], inv, AudioCallbackRate()); + } + + relay_control.Init(relay_pin, GPIO::Mode::OUTPUT); + bypass_state_ = false; + SetBypassState(bypass_state_); + adc.Start(); + SetLed1(0.f, 0.f, 0.f); + SetLed2(0.f); + SetLed3(0.f, 0.f, 0.f); + SetLed4(0.f); + SetLed5(0.f); + UpdateLeds(); + } + + void Petal125BSM::StartAudio(AudioHandle::InterleavingAudioCallback cb) + { + audio.Start(cb); + } + + void Petal125BSM::StartAudio(AudioHandle::AudioCallback cb) + { + audio.Start(cb); + } + + void Petal125BSM::ChangeAudioCallback(AudioHandle::InterleavingAudioCallback cb) + { + audio.ChangeCallback(cb); + } + + void Petal125BSM::ChangeAudioCallback(AudioHandle::AudioCallback cb) + { + audio.ChangeCallback(cb); + } + + void Petal125BSM::StopAudio() + { + audio.Stop(); + } + + void Petal125BSM::SetAudioSampleRate(SaiHandle::Config::SampleRate samplerate) + { + audio.SetSampleRate(samplerate); + callback_rate_ = AudioSampleRate() / AudioBlockSize(); + for (size_t i = 0; i < LED_LAST; i++) + led[i].SetSampleRate(callback_rate_); + for (size_t i = 0; i < KNOB_LAST; i++) + knob[i].SetSampleRate(callback_rate_); + } + + float Petal125BSM::AudioSampleRate() + { + return audio.GetSampleRate(); + } + + void Petal125BSM::SetAudioBlockSize(size_t blocksize) + { + audio.SetBlockSize(blocksize); + callback_rate_ = AudioSampleRate() / AudioBlockSize(); + for (size_t i = 0; i < LED_LAST; i++) + led[i].SetSampleRate(callback_rate_); + for (size_t i = 0; i < KNOB_LAST; i++) + knob[i].SetSampleRate(callback_rate_); + } + + size_t Petal125BSM::AudioBlockSize() + { + return audio.GetConfig().blocksize; + } + + float Petal125BSM::AudioCallbackRate() + { + return callback_rate_; + } + + void Petal125BSM::ProcessAnalogControls() + { + for (size_t i = 0; i < KNOB_LAST; i++) + { + knob[i].Process(); + } + expression.Process(); + } + + void Petal125BSM::ProcessDigitalControls() + { + footswitch1.Debounce(); + footswitch2.Debounce(); + } + + void Petal125BSM::SetBypassState(bool state) + { + bypass_state_ = state; + relay_control.Write(!bypass_state_); + } + + void Petal125BSM::ToggleBypassState() + { + bypass_state_ = !bypass_state_; + relay_control.Write(!bypass_state_); + } + + void Petal125BSM::UpdateLeds() + { + for (size_t i = 0; i < LED_LAST; i++) + { + led[i].Update(); + } + } + + void Petal125BSM::SetLed1(float r, float g, float b) + { + led[LED_1_R].Set(r); + led[LED_1_G].Set(g); + led[LED_1_B].Set(b); + } + + void Petal125BSM::SetLed3(float r, float g, float b) + { + led[LED_3_R].Set(r); + led[LED_3_G].Set(g); + led[LED_3_B].Set(b); + } + + bool Petal125BSM::ValidateSDRAM() + { + uint32_t *sdramptr = (uint32_t *)0xc0000000; + uint32_t size_in_words = 16777216; + uint32_t testval = 0xdeadbeef; + uint32_t num_failed = 0; + /** Write test val */ + for (uint32_t i = 0; i < size_in_words; i++) + { + uint32_t *word = sdramptr + i; + *word = testval; + } + /** Compare written */ + for (uint32_t i = 0; i < size_in_words; i++) + { + uint32_t *word = sdramptr + i; + if (*word != testval) + num_failed++; + } + /** Write Zeroes */ + for (uint32_t i = 0; i < size_in_words; i++) + { + uint32_t *word = sdramptr + i; + *word = 0x00000000; + } + /** Compare Cleared */ + for (uint32_t i = 0; i < size_in_words; i++) + { + uint32_t *word = sdramptr + i; + if (*word != 0) + num_failed++; + } + return num_failed == 0; + } + + bool Petal125BSM::ValidateQSPI(bool quick) + { + uint32_t start; + uint32_t size; + if (quick) + { + start = 0x400000; + size = 0x4000; + } + else + { + start = 0; + size = 0x800000; + } + // Erase the section to be tested + qspi.Erase(start, start + size); + // Create some test data + std::vector test; + test.resize(size); + uint8_t *testmem = test.data(); + for (size_t i = 0; i < size; i++) + testmem[i] = (uint8_t)(i & 0xff); + // Write the test data to the device + qspi.Write(start, size, testmem); + // Read it all back and count any/all errors + // I supppose any byte where ((data & 0xff) == data) + // would be able to false-pass.. + size_t fail_cnt = 0; + for (size_t i = 0; i < size; i++) + if (testmem[i] != (uint8_t)(i & 0xff)) + fail_cnt++; + return fail_cnt == 0; + } + +}; // namespace daisy diff --git a/source/petal_sm/daisy_petal_125b_sm.h b/source/petal_sm/daisy_petal_125b_sm.h new file mode 100644 index 0000000..afba187 --- /dev/null +++ b/source/petal_sm/daisy_petal_125b_sm.h @@ -0,0 +1,288 @@ +#pragma once +#ifndef DSY_BUD_H +#define DSY_BUD_H + +#include "daisy.h" + +namespace daisy +{ + /** + * @brief Configurable Guitar Pedal SOM based on Daisy. + * @ingroup boards + */ + class Petal125BSM + { + public: + enum + { + KNOB_1, /**< Top Left */ + KNOB_2, /**< Top Midddle */ + KNOB_3, /**< Top Right */ + KNOB_4, /**< Bottom Left */ + KNOB_5, /**< Bottom Middle */ + KNOB_6, /**< Bottom Right */ + KNOB_LAST, + }; + + enum + { + LED_1_R, + LED_1_G, + LED_1_B, + LED_2, + LED_3_R, + LED_3_G, + LED_3_B, + LED_4, + LED_5, + LED_LAST, + }; + + enum + { + TOGGLE_1, /**< Left */ + TOGGLE_2, /**< Middle */ + TOGGLE_3, /**< Right */ + TOGGLE_LAST + }; + + enum + { + FOOTSWITCH_1, /** Top */ + FOOTSWITCH_2, /** Bottom */ + FOOTSWITCH_LAST + }; + + Petal125BSM() {} + ~Petal125BSM() {} + + /** @brief Initializes the submodule hardware + * This includes SDRAM, External Flash, + * Knobs, toggles, etc. etc. + */ + void Init(); + + /** @brief Begins the audio. + * the specified Interleaving callback will get called whenever + * new data is ready to be prepared. + */ + void StartAudio(AudioHandle::InterleavingAudioCallback cb); + + /** @brief Begins the audio. + * the specified Non-Interleaving callback will get called whenever + * new data is ready to be prepared. + */ + void StartAudio(AudioHandle::AudioCallback cb); + + /** @brief Changes to a new interleaved callback */ + void ChangeAudioCallback(AudioHandle::InterleavingAudioCallback cb); + + /** @brief Changes to a new non-interleaving callback */ + void ChangeAudioCallback(AudioHandle::AudioCallback cb); + + /** @brief Stops audio stream if its running, disabling the SAI DMA */ + void StopAudio(); + + /** @brief Updates the Audio Sample Rate, and reinitializes. + * @note Audio must be stopped for this to work. + */ + void SetAudioSampleRate(SaiHandle::Config::SampleRate samplerate); + + /** @brief Returns the audio sample rate in Hz as a floating point number. */ + float AudioSampleRate(); + + /** @brief Sets the number of samples processed per channel by the audio callback. */ + void SetAudioBlockSize(size_t blocksize); + + /** @brief Returns the number of samples per channel in a block of audio. */ + size_t AudioBlockSize(); + + /** @brief Returns the rate in Hz that the Audio callback is called */ + float AudioCallbackRate(); + + /** @brief Processes Analog Controls (all 6 knobs, and expression) */ + void ProcessAnalogControls(); + + /** @brief Processes Digital buttons, debouncing as necessary. */ + void ProcessDigitalControls(); + + /** @brief Processes all controls */ + inline void ProcessAllControls() + { + ProcessAnalogControls(); + ProcessDigitalControls(); + } + + /** @brief Returns the value of a specific knob. + * @param index number representing which knob to use 0-5 + * @return 0-1 value corresponding to knob position + */ + inline float GetKnobValue(int index) const + { + return knob[index < KNOB_LAST ? index : 0].Value(); + } + + /** @brief Returns the value of Knob 1 + * @return 0-1 value corresponding to the knob position. + */ + inline float GetKnob1() const { return knob[0].Value(); } + + /** @brief Returns the value of Knob 2 + * @return 0-1 value corresponding to the knob position. + */ + inline float GetKnob2() const { return knob[1].Value(); } + + /** @brief Returns the value of Knob 3 + * @return 0-1 value corresponding to the knob position. + */ + inline float GetKnob3() const { return knob[2].Value(); } + + /** @brief Returns the value of Knob 4 + * @return 0-1 value corresponding to the knob position. + */ + inline float GetKnob4() const { return knob[3].Value(); } + + /** @brief Returns the value of Knob 5 + * @return 0-1 value corresponding to the knob position. + */ + inline float GetKnob5() const { return knob[4].Value(); } + + /** @brief Returns the value of Knob 6 + * @return 0-1 value corresponding to the knob position. + */ + inline float GetKnob6() const { return knob[5].Value(); } + + /** @brief Returns the current expression value + * @return 0-1 value corresponding to the expression input + */ + inline float GetExpressionValue() const { return expression.Value(); } + + /** @brief Enables/Disables True Bypass */ + void SetBypassState(bool state); + + /** @brief Toggles the state of the True Bypass feature */ + void ToggleBypassState(); + + /** @brief Returns whether True Bypass is enabled or not. */ + inline bool BypassState() const { return bypass_state_; } + + /** @brief Updates the PWM value for any direct GPIO LEDs + * + * @note This should be called at AudioCallbackRate + * + * For setting individual LED brightnesses you can access the + * leds[] array, and use the `Set` function. + * + * For example: + * hw.leds[LED_2].Set(0.5); + * + * The RGB LEDs each have convenience functions below. + */ + void UpdateLeds(); + + /** @brief Convenience function for setting the RGB values for LED 1 + * @param r 0-1 value for red LED + * @param g 0-1 value for green LED + * @param b 0-1 value for blue LED + */ + void SetLed1(float r, float g, float b); + + /** @brief Convenience function for Setting LED2 + * @param val 0-1 value for brightness of LED. + */ + inline void SetLed2(float val) { led[LED_2].Set(val); } + + /** @brief Convenience function for setting the RGB values for LED 3 + * @param r 0-1 value for red LED + * @param g 0-1 value for green LED + * @param b 0-1 value for blue LED + */ + void SetLed3(float r, float g, float b); + + /** @brief Convenience function for Setting LED2 + * @param val 0-1 value for brightness of LED. + */ + inline void SetLed4(float val) { led[LED_4].Set(val); } + + /** @brief Convenience function for Setting LED2 + * @param val 0-1 value for brightness of LED. + */ + inline void SetLed5(float val) { led[LED_5].Set(val); } + + /** @brief Print formatted debug log message */ + template + static void Print(const char *format, VA... va) + { + Log::Print(format, va...); + } + + /** @brief Print formatted debug log message with automatic line termination */ + template + static void PrintLine(const char *format, VA... va) + { + Log::PrintLine(format, va...); + } + + /** @brief Start the logging session. + * @param wait_for_pc Optionally wait for terminal connection before proceeding. + * defaults to not waiting + */ + static void StartLog(bool wait_for_pc = false) + { + Log::StartLog(wait_for_pc); + } + + /** @brief Tests entirety of SDRAM for validity + * This will wipe contents of SDRAM when testing. + * + * @note If using the SDRAM for the default bss, or heap, + * and using constructors as initializers do not + * call this function. Otherwise, it could + * overwrite changes performed by constructors. + * + * \retval returns true if SDRAM is okay, otherwise false + */ + bool ValidateSDRAM(); + + /** @brief Tests the QSPI for validity + * This will wipe contents of QSPI when testing. + * + * @note If called with quick = false, this will erase all memory + * the "quick" test starts 0x400000 bytes into the memory and + * test 16kB of data + * + * \param quick if this is true the test will only test a small piece of the QSPI + * checking the entire 8MB can take roughly over a minute. + * + * \retval returns true if SDRAM is okay, otherwise false + */ + bool ValidateQSPI(bool quick = true); + + AnalogControl knob[KNOB_LAST]; /**< Knob Objects */ + AnalogControl expression; /**< Expresion Object */ + Switch3 toggle[TOGGLE_LAST]; /**< Toggle Objects */ + Switch footswitch1, footswitch2; /**< Footswitch Objects */ + + /** LED Objects -- RGBs are handled as separate LEDs + * @see SetLed1 + * @see SetLed3 + */ + Led led[LED_LAST]; + + QSPIHandle qspi; /**< External Flash Access */ + AudioHandle audio; /**< Audio Engine Access */ + AdcHandle adc; /**< Analog to Digital Converter Access */ + Pcm3060 codec; /**< PCM3060 codec control */ + + private: + using Log = Logger; + float callback_rate_; + GPIO relay_control; + bool bypass_state_; + System sys; + SdramHandle sdram; + }; + +} // namespace daisy + +#endif diff --git a/source/seed.pod.json b/source/pod.json similarity index 64% rename from source/seed.pod.json rename to source/pod.json index 23721dd..861dfc6 100644 --- a/source/seed.pod.json +++ b/source/pod.json @@ -1,7 +1,15 @@ { - "name":"pod", + "name": "pod", + "som": "seed", "defines": { - "OOPSY_TARGET_HAS_MIDI_INPUT": 1 + "OOPSY_TARGET_POD": 1, + "OOPSY_TARGET_HAS_MIDI_INPUT": 1, + "OOPSY_HAS_ENCODER": 1 + }, + "max_apps": 8, + "display": {}, + "audio": { + "channels": 2 }, "components": { "sw1": { @@ -22,15 +30,27 @@ }, "encoder": { "component": "Encoder", - "pin": {"a":26, "b":25, "click":13 } + "pin": { + "a": 26, + "b": 25, + "click": 13 + } }, "led1": { "component": "RgbLed", - "pin": {"r":20, "g":19, "b":18 } + "pin": { + "r": 20, + "g": 19, + "b": 18 + } }, "led2": { "component": "RgbLed", - "pin": {"r":17, "g":24, "b":23 } + "pin": { + "r": 17, + "g": 24, + "b": 23 + } } }, "aliases": { @@ -40,8 +60,8 @@ "button1": "sw1", "switch2": "sw2", "button2": "sw2", + "encswitch": "encoder_rise", "enp": "encoder_press", - "switch3": "encoder_press", "press": "encoder_press", "knob": "knob1", "ctrl": "knob1", diff --git a/source/test.sh b/source/test.sh index eac9afa..c57098a 100755 --- a/source/test.sh +++ b/source/test.sh @@ -4,8 +4,8 @@ node oopsy.js ../templates/oopsy_field.cpp field && \ node oopsy.js ../templates/oopsy_petal.cpp petal && \ node oopsy.js ../templates/oopsy_pod.cpp pod && \ node oopsy.js ../templates/oopsy_versio.cpp versio && \ -node oopsy.js ../templates/oopsy_pod.cpp seed.pod.json && \ -node oopsy.js ../templates/oopsy_versio.cpp seed.versio.json && \ +node oopsy.js ../templates/oopsy_pod.cpp pod.json && \ +node oopsy.js ../templates/oopsy_versio.cpp versio.json && \ node oopsy.js ../templates/oopsy_bluemchen.cpp bluemchen && \ node oopsy.js ../templates/oopsy_nehcmeulb.cpp nehcmeulb && \ node oopsy.js ../examples/dattoro.cpp ../examples/gigaverb.cpp ../examples/crossover.cpp ../examples/midside.cpp && \ diff --git a/source/seed.versio.json b/source/versio.json similarity index 93% rename from source/seed.versio.json rename to source/versio.json index 34e9c81..d530f20 100644 --- a/source/seed.versio.json +++ b/source/versio.json @@ -1,6 +1,10 @@ { "name":"versio", - "defines": {}, + "som":"seed", + "defines": { + "OOPSY_TARGET_VERSIO": 1 + }, + "max_apps": 1, "components": { "knob1": { "component": "AnalogControl", @@ -37,7 +41,8 @@ }, "gate1": { "component": "GateIn", - "pin": 24 + "pin": 24, + "invert": false }, "sw1": { "component": "Switch3", diff --git a/templates/oopsy_bluemchen.maxpat b/templates/oopsy_bluemchen.maxpat index 6fb3119..79e14e2 100644 --- a/templates/oopsy_bluemchen.maxpat +++ b/templates/oopsy_bluemchen.maxpat @@ -4,7 +4,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -39,6 +39,26 @@ "subpatcher_template" : "oopsy_bluemchen", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "bluemchen" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-1", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 215.0, 230.0, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "id" : "obj-2", "maxclass" : "comment", @@ -97,26 +117,6 @@ "varname" : "live.gain~" } - } -, { - "box" : { - "args" : [ "@target", "bluemchen" ], - "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" : [ 240.0, 230.0, 128.0, 128.0 ], - "viewvisibility" : 1 - } - } , { "box" : { @@ -131,7 +131,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -454,7 +454,7 @@ , "patching_rect" : [ 40.0, 230.0, 144.0, 35.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", "exportname" : "oopsy_bluemchen" } , @@ -571,11 +571,26 @@ ], "parameters" : { "obj-11" : [ "live.gain~", "live.gain~", 0 ], - "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], - "obj-9::obj-33" : [ "live.text[1]", "FILTER", 0 ], - "obj-9::obj-34" : [ "live.text[3]", "FILTER", 0 ], + "obj-1::obj-32" : [ "live.text[6]", "FILTER", 0 ], + "obj-1::obj-33" : [ "live.text[4]", "FILTER", 0 ], + "obj-1::obj-34" : [ "live.text[5]", "FILTER", 0 ], "parameterbanks" : { + } +, + "parameter_overrides" : { + "obj-1::obj-32" : { + "parameter_longname" : "live.text[6]" + } +, + "obj-1::obj-33" : { + "parameter_longname" : "live.text[4]" + } +, + "obj-1::obj-34" : { + "parameter_longname" : "live.text[5]" + } + } , "inherited_shortname" : 1 @@ -583,21 +598,21 @@ , "dependency_cache" : [ { "name" : "oopsy.maxpat", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/patchers", "patcherrelativepath" : "../patchers", "type" : "JSON", "implicit" : 1 } , { "name" : "oopsy.snoop.js", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 } , { "name" : "oopsy.node4max.js", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 diff --git a/templates/oopsy_field.maxpat b/templates/oopsy_field.maxpat index ba8488f..8190cc2 100644 --- a/templates/oopsy_field.maxpat +++ b/templates/oopsy_field.maxpat @@ -4,13 +4,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 890.0, 138.0, 756.0, 523.0 ], + "rect" : [ 650.0, 138.0, 756.0, 523.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -39,6 +39,26 @@ "subpatcher_template" : "oopsy_field", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "field" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-15", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 484.0, 57.0, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "id" : "obj-23", "maxclass" : "comment", @@ -269,13 +289,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", - "rect" : [ 84.0, 103.0, 1280.0, 913.0 ], + "rect" : [ 78.0, 102.0, 1280.0, 729.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -1524,7 +1544,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 570.5, 296.0, 36.5, 22.0 ], + "patching_rect" : [ 591.561904761904771, 296.0, 36.5, 22.0 ], "text" : "min" } @@ -1593,8 +1613,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 702.5, 323.0, 69.0, 22.0 ], - "text" : "out 5 gate1" + "patching_rect" : [ 702.5, 323.0, 85.0, 22.0 ], + "text" : "out 5 gateout1" } } @@ -1616,8 +1636,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 570.5, 323.0, 57.0, 22.0 ], - "text" : "out 4 cv2" + "patching_rect" : [ 591.561904761904771, 323.0, 74.0, 22.0 ], + "text" : "out 4 cvout2" } } @@ -1627,8 +1647,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 509.5, 323.0, 57.0, 22.0 ], - "text" : "out 3 cv1" + "patching_rect" : [ 509.5, 323.0, 74.0, 22.0 ], + "text" : "out 3 cvout1" } } @@ -1675,7 +1695,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 588.0, 144.0, 65.0, 22.0 ], + "patching_rect" : [ 609.061904761904771, 142.400900900363922, 65.0, 22.0 ], "text" : "param cv4" } @@ -1687,7 +1707,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 570.5, 118.5, 65.0, 22.0 ], + "patching_rect" : [ 591.561904761904771, 116.900900900363922, 65.0, 22.0 ], "text" : "param cv3" } @@ -2308,7 +2328,7 @@ , "patching_rect" : [ 24.0, 290.0, 194.0, 35.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", "exportname" : "oopsy_field" } , @@ -2377,26 +2397,6 @@ "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" : [ { @@ -2521,62 +2521,64 @@ ], "parameters" : { "obj-11" : [ "live.gain~", "live.gain~", 0 ], + "obj-15::obj-32" : [ "live.text[6]", "FILTER", 0 ], + "obj-15::obj-33" : [ "live.text[4]", "FILTER", 0 ], + "obj-15::obj-34" : [ "live.text[5]", "FILTER", 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-4" : [ "live.menu[6]", "live.menu", 0 ], "parameterbanks" : { + } +, + "parameter_overrides" : { + "obj-15::obj-32" : { + "parameter_longname" : "live.text[6]" + } +, + "obj-15::obj-33" : { + "parameter_longname" : "live.text[4]" + } +, + "obj-15::obj-34" : { + "parameter_longname" : "live.text[5]" + } + } , "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", + "name" : "oopsy.suggestions.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", "implicit" : 1 } , { - "name" : "oopsy.suggestions.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "name" : "oopsy.gate.trig.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", + "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", + "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", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", "implicit" : 1 @@ -2617,6 +2619,27 @@ "type" : "TEXT", "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 + } ], "autosave" : 0 } diff --git a/templates/oopsy_nehcmeulb.maxpat b/templates/oopsy_nehcmeulb.maxpat index e32abd3..56daf02 100644 --- a/templates/oopsy_nehcmeulb.maxpat +++ b/templates/oopsy_nehcmeulb.maxpat @@ -4,13 +4,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 300.0, 426.0, 546.0, 483.0 ], + "rect" : [ 303.0, 203.0, 546.0, 483.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -39,6 +39,26 @@ "subpatcher_template" : "oopsy_bluemchen", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "nehcmeulb" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-7", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 212.0, 230.0, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "attr" : "cv1", "id" : "obj-6", @@ -109,26 +129,6 @@ "varname" : "live.gain~" } - } -, { - "box" : { - "args" : [ "@target", "nehcmeulb" ], - "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" : [ 240.0, 230.0, 128.0, 128.0 ], - "viewvisibility" : 1 - } - } , { "box" : { @@ -136,14 +136,14 @@ "id" : "obj-3", "maxclass" : "newobj", "numinlets" : 2, - "numoutlets" : 3, - "outlettype" : [ "signal", "signal", "signal" ], + "numoutlets" : 4, + "outlettype" : [ "signal", "signal", "signal", "signal" ], "patcher" : { "fileversion" : 1, "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -523,7 +523,7 @@ , "patching_rect" : [ 40.0, 230.0, 144.0, 35.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", "exportname" : "oopsy_nehcmeulb" } , @@ -628,9 +628,9 @@ ], "parameters" : { "obj-11" : [ "live.gain~", "live.gain~", 0 ], - "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], - "obj-9::obj-33" : [ "live.text[1]", "FILTER", 0 ], - "obj-9::obj-34" : [ "live.text[3]", "FILTER", 0 ], + "obj-7::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-7::obj-33" : [ "live.text[1]", "FILTER", 0 ], + "obj-7::obj-34" : [ "live.text[3]", "FILTER", 0 ], "parameterbanks" : { } @@ -640,21 +640,21 @@ , "dependency_cache" : [ { "name" : "oopsy.maxpat", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/patchers", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/patchers", "patcherrelativepath" : "../patchers", "type" : "JSON", "implicit" : 1 } , { "name" : "oopsy.snoop.js", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 } , { "name" : "oopsy.node4max.js", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 diff --git a/templates/oopsy_patch.maxpat b/templates/oopsy_patch.maxpat index d97ad08..07f9d14 100644 --- a/templates/oopsy_patch.maxpat +++ b/templates/oopsy_patch.maxpat @@ -4,13 +4,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 431.0, 199.0, 800.0, 598.0 ], + "rect" : [ 478.0, 196.0, 800.0, 598.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -39,6 +39,26 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "patch" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-15", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 556.0, 108.0, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "id" : "obj-25", "maxclass" : "live.dial", @@ -349,26 +369,6 @@ "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" : [ 614.5, 22.0, 128.0, 128.0 ], - "viewvisibility" : 1 - } - } , { "box" : { @@ -383,7 +383,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -424,7 +424,7 @@ "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 369.5, 323.0, 36.5, 22.0 ], + "patching_rect" : [ 389.5, 324.0, 36.5, 22.0 ], "text" : "min" } @@ -516,8 +516,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 511.5, 350.0, 69.0, 22.0 ], - "text" : "out 7 gate1" + "patching_rect" : [ 511.5, 350.0, 85.0, 22.0 ], + "text" : "out 7 gateout1" } } @@ -539,8 +539,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 369.5, 350.0, 57.0, 22.0 ], - "text" : "out 6 cv2" + "patching_rect" : [ 389.5, 351.0, 74.0, 22.0 ], + "text" : "out 6 cvout2" } } @@ -550,8 +550,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 308.5, 350.0, 57.0, 22.0 ], - "text" : "out 5 cv1" + "patching_rect" : [ 308.5, 350.0, 74.0, 22.0 ], + "text" : "out 5 cvout1" } } @@ -646,7 +646,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 387.0, 171.0, 86.0, 49.0 ], + "patching_rect" : [ 407.0, 172.0, 86.0, 49.0 ], "text" : "param ctrl4 @min -10 @max 10" } @@ -658,7 +658,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 369.5, 145.5, 69.0, 22.0 ], + "patching_rect" : [ 389.5, 146.5, 69.0, 22.0 ], "text" : "param ctrl3" } @@ -682,7 +682,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 407.211711704730988, 225.0, 74.288288295269012, 47.0 ], + "patching_rect" : [ 427.211711704730988, 226.0, 74.288288295269012, 47.0 ], "text" : "cv1, knob1, cv1_foo, etc. all work" } @@ -917,7 +917,7 @@ , "patching_rect" : [ 47.0, 363.0, 195.0, 35.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", "exportname" : "oopsy_patch" } , @@ -1171,17 +1171,32 @@ "parameters" : { "obj-11" : [ "live.gain~", "live.gain~", 0 ], "obj-12" : [ "live.gain~[1]", "live.gain~", 0 ], + "obj-15::obj-32" : [ "live.text[6]", "FILTER", 0 ], + "obj-15::obj-33" : [ "live.text[4]", "FILTER", 0 ], + "obj-15::obj-34" : [ "live.text[5]", "FILTER", 0 ], "obj-25" : [ "knob4", "knob4", 0 ], "obj-27" : [ "knob3", "knob3", 0 ], "obj-28" : [ "knob2", "knob2", 0 ], "obj-29" : [ "knob1", "knob1", 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-33" : [ "live.text[1]", "FILTER", 0 ], - "obj-9::obj-34" : [ "live.text[3]", "FILTER", 0 ], "parameterbanks" : { + } +, + "parameter_overrides" : { + "obj-15::obj-32" : { + "parameter_longname" : "live.text[6]" + } +, + "obj-15::obj-33" : { + "parameter_longname" : "live.text[4]" + } +, + "obj-15::obj-34" : { + "parameter_longname" : "live.text[5]" + } + } , "inherited_shortname" : 1 @@ -1189,51 +1204,37 @@ , "dependency_cache" : [ { "name" : "oopsy.suggestions.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "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", + "name" : "oopsy.gate.trig.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", + "name" : "oopsy.gate.min.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", + "name" : "oopsy.ctrl.smooth3.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", + "name" : "oopsy.ctrl.smooth2.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", "implicit" : 1 } , { @@ -1272,6 +1273,27 @@ "type" : "TEXT", "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 + } ], "autosave" : 0 } diff --git a/templates/oopsy_patch_sm.maxpat b/templates/oopsy_patch_init.maxpat similarity index 80% rename from templates/oopsy_patch_sm.maxpat rename to templates/oopsy_patch_init.maxpat index e4d9b47..dfc078f 100644 --- a/templates/oopsy_patch_sm.maxpat +++ b/templates/oopsy_patch_init.maxpat @@ -10,7 +10,7 @@ } , "classnamespace" : "box", - "rect" : [ 226.0, 177.0, 1003.0, 630.0 ], + "rect" : [ 58.0, 85.0, 1003.0, 630.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -39,6 +39,26 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "patch_init" ], + "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" : [ 527.833333333333258, 243.5, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "attr" : "cv5", "id" : "obj-39", @@ -340,12 +360,11 @@ "fontname" : "Arial Italic", "fontsize" : 18.0, "id" : "obj-24", - "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 24.0, 22.0, 221.0, 47.0 ], - "text" : "Template for DaisyPatch Submodule" + "patching_rect" : [ 24.0, 22.0, 221.0, 27.0 ], + "text" : "Template for patch.Init()" } } @@ -507,26 +526,6 @@ "viewvisibility" : 1 } - } -, { - "box" : { - "args" : [ "field", "@target", "patch_sm" ], - "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" : [ 760.5, 63.0, 128.0, 128.0 ], - "viewvisibility" : 1 - } - } , { "box" : { @@ -576,6 +575,149 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "id" : "obj-47", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 398.5, 243.5, 26.0, 22.0 ], + "text" : "+ 1" + } + + } +, { + "box" : { + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 398.5, 276.0, 61.0, 22.0 ], + "text" : "selector 2" + } + + } +, { + "box" : { + "id" : "obj-48", + "linecount" : 5, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 870.0, 18.0, 150.0, 74.0 ], + "text" : "Toggling the switch with this patcher will switch between interface inputs and voltage inputs for gate2 and cvout2" + } + + } +, { + "box" : { + "id" : "obj-46", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 803.5, 312.0, 29.5, 22.0 ], + "text" : "+" + } + + } +, { + "box" : { + "id" : "obj-42", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 879.211711704730988, 228.5, 26.0, 22.0 ], + "text" : "!- 1" + } + + } +, { + "box" : { + "id" : "obj-43", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 814.0, 200.0, 49.0, 22.0 ], + "text" : "r toggle" + } + + } +, { + "box" : { + "id" : "obj-44", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 868.711711704730988, 265.0, 29.5, 22.0 ], + "text" : "*" + } + + } +, { + "box" : { + "id" : "obj-45", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 803.5, 269.0, 29.5, 22.0 ], + "text" : "*" + } + + } +, { + "box" : { + "id" : "obj-41", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 870.0, 96.0, 103.0, 22.0 ], + "text" : "param sw2_press" + } + + } +, { + "box" : { + "id" : "obj-40", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 870.0, 133.0, 51.0, 22.0 ], + "text" : "s toggle" + } + + } +, { + "box" : { + "id" : "obj-36", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 975.0, 96.0, 103.0, 22.0 ], + "text" : "param sw1_press" + } + + } +, { + "box" : { + "id" : "obj-30", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 398.5, 211.0, 49.0, 22.0 ], + "text" : "r toggle" + } + + } +, { "box" : { "id" : "obj-24", "maxclass" : "newobj", @@ -594,7 +736,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 419.211711704730988, 312.0, 96.0, 33.0 ], + "patching_rect" : [ 459.211711704730988, 312.0, 96.0, 33.0 ], "text" : "\"out 4 led\" would also work" } @@ -602,12 +744,12 @@ , { "box" : { "id" : "obj-8", - "linecount" : 6, + "linecount" : 8, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 589.0, 211.0, 83.0, 87.0 ], - "text" : "cv5, cv5_foo, etc. all work for these 4 (but not knob5 or related)" + "patching_rect" : [ 565.0, 211.0, 146.0, 114.0 ], + "text" : "cv5, cv5_foo, etc. all work for these 4 (but not knob5 or related).\nSince these inputs are all bipolar, we need to set the @min attribute to -1 (@max can be left at the default value of 1)" } } @@ -618,8 +760,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 589.0, 178.0, 65.0, 22.0 ], - "text" : "param cv8" + "patching_rect" : [ 594.0, 180.0, 113.0, 22.0 ], + "text" : "param cv8 @min -1" } } @@ -630,8 +772,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 568.0, 151.0, 65.0, 22.0 ], - "text" : "param cv7" + "patching_rect" : [ 565.0, 151.0, 113.0, 22.0 ], + "text" : "param cv7 @min -1" } } @@ -642,8 +784,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 544.0, 123.0, 65.0, 22.0 ], - "text" : "param cv6" + "patching_rect" : [ 532.0, 123.0, 113.0, 22.0 ], + "text" : "param cv6 @min -1" } } @@ -654,8 +796,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 520.0, 96.0, 65.0, 22.0 ], - "text" : "param cv5" + "patching_rect" : [ 506.0, 96.0, 113.0, 22.0 ], + "text" : "param cv5 @min -1" } } @@ -677,8 +819,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 786.5, 351.5, 69.0, 22.0 ], - "text" : "out 6 gate2" + "patching_rect" : [ 803.5, 351.5, 99.0, 22.0 ], + "text" : "out 6 gate_out_2" } } @@ -689,7 +831,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 891.5, 96.0, 107.0, 22.0 ], + "patching_rect" : [ 1081.5, 96.0, 107.0, 22.0 ], "text" : "oopsy.suggestions" } @@ -734,8 +876,8 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 703.5, 351.5, 69.0, 22.0 ], - "text" : "out 5 gate1" + "patching_rect" : [ 703.5, 351.5, 99.0, 22.0 ], + "text" : "out 5 gate_out_1" } } @@ -848,13 +990,12 @@ , { "box" : { "id" : "obj-14", - "linecount" : 3, "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 320.5, 119.900900900363922, 67.0, 49.0 ], - "text" : "param cv3 @min 0.5 @max 1" + "patching_rect" : [ 320.5, 119.900900900363922, 65.0, 22.0 ], + "text" : "param cv3" } } @@ -957,6 +1098,13 @@ "source" : [ "obj-1", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-6", 2 ], + "source" : [ "obj-10", 0 ] + } + } , { "patchline" : { @@ -967,7 +1115,7 @@ } , { "patchline" : { - "destination" : [ "obj-29", 0 ], + "destination" : [ "obj-6", 1 ], "source" : [ "obj-15", 0 ] } @@ -988,7 +1136,7 @@ } , { "patchline" : { - "destination" : [ "obj-7", 0 ], + "destination" : [ "obj-45", 0 ], "source" : [ "obj-25", 0 ] } @@ -1006,18 +1154,97 @@ "source" : [ "obj-3", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-44", 0 ], + "source" : [ "obj-36", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-40", 0 ], + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-44", 1 ], + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 0 ], + "order" : 0, + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 1 ], + "order" : 1, + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-46", 1 ], + "source" : [ "obj-44", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-46", 0 ], + "source" : [ "obj-45", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-46", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "source" : [ "obj-47", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-6", 0 ] + } + } ] } , "patching_rect" : [ 47.0, 363.0, 195.0, 35.0 ], "saved_object_attributes" : { - "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/oopsy/templates/", - "exportname" : "oopsy_patch_sm" + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", + "exportname" : "oopsy_patch_init" } , "text" : "gen~", - "varname" : "oopsy_patch_sm" + "varname" : "oopsy_patch_init" } } @@ -1187,20 +1414,6 @@ "source" : [ "obj-29", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-1", 0 ], - "source" : [ "obj-3", 2 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-11", 1 ], - "source" : [ "obj-3", 1 ] - } - } , { "patchline" : { @@ -1208,27 +1421,6 @@ "source" : [ "obj-3", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-14", 0 ], - "source" : [ "obj-3", 3 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-15", 0 ], - "source" : [ "obj-3", 5 ] - } - - } -, { - "patchline" : { - "destination" : [ "obj-20", 0 ], - "source" : [ "obj-3", 4 ] - } - } , { "patchline" : { @@ -1285,19 +1477,10 @@ "source" : [ "obj-6", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-3", 1 ], - "order" : 0, - "source" : [ "obj-7", 0 ] - } - } , { "patchline" : { "destination" : [ "obj-3", 0 ], - "order" : 1, "source" : [ "obj-7", 0 ] } @@ -1334,60 +1517,39 @@ , "dependency_cache" : [ { "name" : "oopsy.suggestions.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", "implicit" : 1 } , { "name" : "oopsy.gate.trig.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "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", + "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", + "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", + "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", @@ -1424,6 +1586,27 @@ "type" : "TEXT", "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 + } ], "autosave" : 0 } diff --git a/templates/oopsy_petal.maxpat b/templates/oopsy_petal.maxpat index 8a397d6..3abf115 100644 --- a/templates/oopsy_petal.maxpat +++ b/templates/oopsy_petal.maxpat @@ -4,7 +4,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -39,6 +39,26 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "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" : [ 241.333333333333371, 239.5, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "id" : "obj-17", "maxclass" : "comment", @@ -245,26 +265,6 @@ "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" : { @@ -280,7 +280,7 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } @@ -776,7 +776,7 @@ , "patching_rect" : [ 17.333333333333343, 222.0, 71.5, 35.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", "exportname" : "oopsy_petal" } , @@ -894,60 +894,39 @@ , "dependency_cache" : [ { "name" : "oopsy.suggestions.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", "implicit" : 1 } , { "name" : "oopsy.gate.trig.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "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", + "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", + "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", + "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", @@ -984,6 +963,27 @@ "type" : "TEXT", "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 + } ], "autosave" : 0 } diff --git a/templates/oopsy_petal_125b_sm.maxpat b/templates/oopsy_petal_125b_sm.maxpat new file mode 100644 index 0000000..7798219 --- /dev/null +++ b/templates/oopsy_petal_125b_sm.maxpat @@ -0,0 +1,1112 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 11, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 388.0, 94.0, 439.0, 640.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_initial" : [ -70.0 ], + "parameter_initial_enable" : 1, + "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" : 1, + "numoutlets" : 7, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal", "signal", "signal" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 1, + "revision" : 11, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "dsp.gen", + "rect" : [ 64.0, 203.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-47", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 489.0, 238.0, 150.0, 33.0 ], + "text" : "Cycle through RGB spectrum" + } + + } +, { + "box" : { + "id" : "obj-44", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 818.0, 306.0, 150.0, 47.0 ], + "text" : "The LED will go dark when the petal is set to bypass" + } + + } +, { + "box" : { + "id" : "obj-42", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 621.5, 305.0, 69.0, 22.0 ], + "text" : "expr 1 - in1" + } + + } +, { + "box" : { + "id" : "obj-41", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 341.0, 209.600000000000023, 72.0, 22.0 ], + "text" : "expr in1 * pi" + } + + } +, { + "box" : { + "id" : "obj-40", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 381.5, 340.0, 91.0, 22.0 ], + "text" : "out 5 led3_blue" + } + + } +, { + "box" : { + "id" : "obj-36", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 359.5, 366.0, 99.0, 22.0 ], + "text" : "out 4 led3_green" + } + + } +, { + "box" : { + "id" : "obj-35", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 381.5, 309.0, 184.0, 22.0 ], + "text" : "expr sin(in1 + pi * 1.2) * 0.5 + 0.5" + } + + } +, { + "box" : { + "id" : "obj-34", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 359.5, 278.0, 184.0, 22.0 ], + "text" : "expr sin(in1 + pi * 0.6) * 0.5 + 0.5" + } + + } +, { + "box" : { + "id" : "obj-33", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 341.0, 249.0, 133.0, 22.0 ], + "text" : "expr sin(in1) * 0.5 + 0.5" + } + + } +, { + "box" : { + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 341.0, 392.0, 85.0, 22.0 ], + "text" : "out 3 led3_red" + } + + } +, { + "box" : { + "id" : "obj-27", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 743.5, 112.400000000000006, 113.0, 22.0 ], + "text" : "param footswitch_2" + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 730.0, 340.0, 65.0, 22.0 ], + "text" : "out 7 relay" + } + + } +, { + "box" : { + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 730.0, 185.600000000000023, 61.0, 22.0 ], + "text" : "clamp 0 1" + } + + } +, { + "box" : { + "id" : "obj-18", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 730.0, 157.0, 48.0, 22.0 ], + "text" : "change" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 730.0, 88.0, 113.0, 22.0 ], + "text" : "param footswitch_1" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 730.0, 216.0, 92.0, 22.0 ], + "text" : "accum @max 2" + } + + } +, { + "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-25", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 248.531413612565416, 342.0, 61.0, 22.0 ], + "text" : "out 2 led2" + } + + } +, { + "box" : { + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 621.5, 340.0, 96.0, 22.0 ], + "text" : "out 6 led1_white" + } + + } +, { + "box" : { + "id" : "obj-23", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 575.5, 88.0, 104.0, 22.0 ], + "text" : "param expression" + } + + } +, { + "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, 79.0, 22.0 ], + "text" : "param knob6" + } + + } +, { + "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, 176.0, 22.0 ], + "text" : "param knob3 @min -1 @max 1" + } + + } +, { + "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" : [ 898.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-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 ], + "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-20", 0 ], + "source" : [ "obj-18", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 1 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "order" : 0, + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 0 ], + "order" : 1, + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-36", 0 ], + "source" : [ "obj-34", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-40", 0 ], + "source" : [ "obj-35", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "order" : 2, + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "order" : 1, + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "order" : 0, + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-18", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 0 ], + "source" : [ "obj-9", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 17.333333333333343, 222.0, 71.5, 35.0 ], + "saved_object_attributes" : { + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", + "exportname" : "oopsy_petal_125b_sm" + } +, + "text" : "gen~", + "varname" : "oopsy_petal_125b_sm" + } + + } + ], + "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-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-33" : [ "live.text[1]", "FILTER", 0 ], + "obj-9::obj-34" : [ "live.text[3]", "FILTER", 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.trig.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 index 6feb625..b428efe 100644 --- a/templates/oopsy_pod.maxpat +++ b/templates/oopsy_pod.maxpat @@ -4,13 +4,13 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 692.0, 240.0, 640.0, 480.0 ], + "rect" : [ 226.0, 180.0, 625.0, 480.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -39,6 +39,26 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "pod" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-3", + "lockeddragscroll" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 438.0, 101.0, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "id" : "obj-1", "maxclass" : "newobj", @@ -50,18 +70,18 @@ "appversion" : { "major" : 8, "minor" : 1, - "revision" : 8, + "revision" : 11, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "dsp.gen", - "rect" : [ 84.0, 103.0, 964.0, 458.0 ], + "rect" : [ 84.0, 103.0, 1240.0, 680.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, "default_fontface" : 0, - "default_fontname" : "Arial", + "default_fontname" : "Tahoma", "gridonopen" : 1, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 1, @@ -86,111 +106,382 @@ "assistshowspatchername" : 0, "boxes" : [ { "box" : { - "id" : "obj-26", + "id" : "obj-101", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 225.5, 61.0, 67.0, 21.0 ], + "text" : "Buttons" + } + + } +, { + "box" : { + "id" : "obj-98", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 767.0, 325.0, 151.0, 64.0 ], + "text" : "Rotating the encoder will change the wave shape of the Saw / Triangle oscillator" + } + + } +, { + "box" : { + "id" : "obj-96", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 767.0, 61.0, 72.0, 21.0 ], + "text" : "Encoder" + } + + } +, { + "box" : { + "id" : "obj-93", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 140.0, 240.0, 43.0, 22.0 ], - "text" : "* 1000" + "patching_rect" : [ 767.0, 253.5, 36.0, 23.0 ], + "text" : "* 0.1" } } , { "box" : { - "id" : "obj-25", + "id" : "obj-92", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 90.0, 240.0, 43.0, 22.0 ], - "text" : "* 1000" + "patching_rect" : [ 839.5, 253.5, 36.0, 23.0 ], + "text" : "* 0.1" } } , { "box" : { - "id" : "obj-24", + "id" : "obj-91", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 767.0, 289.5, 141.0, 23.0 ], + "text" : "accum @max 1 @init 0.5" + } + + } +, { + "box" : { + "id" : "obj-90", "maxclass" : "newobj", "numinlets" : 1, - "numoutlets" : 2, - "outlettype" : [ "", "" ], - "patching_rect" : [ 128.0, 276.400900900363922, 36.0, 22.0 ], - "text" : "cycle" + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 767.0, 219.0, 60.0, 23.0 ], + "text" : "clamp 0 1" + } + + } +, { + "box" : { + "id" : "obj-89", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 839.5, 219.0, 65.0, 23.0 ], + "text" : "clamp -1 0" + } + + } +, { + "box" : { + "id" : "obj-88", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 767.0, 177.0, 47.0, 23.0 ], + "text" : "change" + } + + } +, { + "box" : { + "id" : "obj-87", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 839.5, 177.0, 47.0, 23.0 ], + "text" : "change" + } + + } +, { + "box" : { + "id" : "obj-86", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 839.5, 136.0, 65.0, 23.0 ], + "text" : "clamp -1 0" + } + + } +, { + "box" : { + "id" : "obj-85", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 767.0, 136.0, 60.0, 23.0 ], + "text" : "clamp 0 1" + } + + } +, { + "box" : { + "id" : "obj-84", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 656.5, 365.0, 90.0, 21.0 ], + "text" : "Saw / Triangle" } } , { "box" : { - "id" : "obj-23", + "id" : "obj-81", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 411.5, 215.0, 41.0, 21.0 ], + "text" : "Sine" + } + + } +, { + "box" : { + "id" : "obj-78", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 458.0, 215.0, 37.0, 21.0 ], + "text" : "Rect" + } + + } +, { + "box" : { + "id" : "obj-66", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 656.5, 325.0, 90.0, 23.0 ], + "text" : "expr in1 * 2 - 1" + } + + } +, { + "box" : { + "id" : "obj-65", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "" ], - "patching_rect" : [ 84.0, 276.400900900363922, 36.0, 22.0 ], + "patching_rect" : [ 246.5, 460.0, 35.0, 23.0 ], "text" : "cycle" } } , { "box" : { - "id" : "obj-22", + "id" : "obj-63", "maxclass" : "newobj", - "numinlets" : 0, + "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 37.5, 243.900900900363922, 37.0, 22.0 ], - "text" : "noise" + "patching_rect" : [ 225.5, 205.0, 33.0, 23.0 ], + "text" : "* -1." } } , { "box" : { - "id" : "obj-18", + "id" : "obj-62", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 37.5, 276.400900900363922, 33.0, 22.0 ], - "text" : "* 0.1" + "patching_rect" : [ 225.5, 165.0, 60.0, 23.0 ], + "text" : "clamp 0 1" + } + + } +, { + "box" : { + "id" : "obj-61", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 225.5, 128.400900900363922, 47.0, 23.0 ], + "text" : "change" + } + + } +, { + "box" : { + "id" : "obj-60", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 307.0, 165.0, 60.0, 23.0 ], + "text" : "clamp 0 1" } } , { "box" : { - "id" : "obj-21", + "id" : "obj-59", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 307.0, 128.400900900363922, 47.0, 23.0 ], + "text" : "change" + } + + } +, { + "box" : { + "id" : "obj-57", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 656.5, 219.0, 100.0, 23.0 ], + "text" : "expr in1 / 48000." + } + + } +, { + "box" : { + "id" : "obj-56", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 656.5, 252.0, 90.0, 23.0 ], + "text" : "accum @max 1" + } + + } +, { + "box" : { + "id" : "obj-43", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 225.5, 252.0, 176.0, 23.0 ], + "text" : "accum @min 1 @max 4 @init 1" + } + + } +, { + "box" : { + "id" : "obj-34", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 284.5, 315.0, 29.5, 22.0 ], + "patching_rect" : [ 225.5, 352.0, 29.5, 23.0 ], "text" : "*" } } , { "box" : { - "id" : "obj-20", - "linecount" : 3, - "maxclass" : "comment", + "id" : "obj-33", + "maxclass" : "newobj", "numinlets" : 1, - "numoutlets" : 0, - "patching_rect" : [ 225.5, 378.0, 192.0, 47.0 ], - "text" : "LED outputs range -1 to 1; where output will be green when positive and red when negative" + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 454.0, 252.0, 194.0, 23.0 ], + "text" : "expr round(in1 * 0.5 + 0.5) * 2 - 1" } } , { "box" : { - "id" : "obj-16", + "id" : "obj-26", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "" ], - "patching_rect" : [ 225.5, 284.0, 36.0, 22.0 ], + "patching_rect" : [ 409.5, 252.0, 35.0, 23.0 ], "text" : "cycle" } + } +, { + "box" : { + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 225.5, 303.5, 60.0, 23.0 ], + "text" : "selector 3" + } + + } +, { + "box" : { + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 656.5, 289.5, 48.0, 23.0 ], + "text" : "triangle" + } + + } +, { + "box" : { + "id" : "obj-25", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 483.5, 139.5, 50.0, 23.0 ], + "text" : "* 1000" + } + + } +, { + "box" : { + "id" : "obj-20", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 245.5, 529.0, 192.0, 50.0 ], + "text" : "LED outputs range -1 to 1; where output will be blue when positive and red when negative" + } + } , { "box" : { @@ -198,7 +489,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 289.0, 350.0, 61.0, 22.0 ], + "patching_rect" : [ 315.0, 501.0, 63.5, 23.0 ], "text" : "out 4 led2" } @@ -209,7 +500,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 225.5, 350.0, 61.0, 22.0 ], + "patching_rect" : [ 245.5, 501.0, 64.0, 23.0 ], "text" : "out 3 led1" } @@ -221,7 +512,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 493.5, 150.0, 108.0, 60.0 ], + "patching_rect" : [ 929.5, 136.0, 108.0, 64.0 ], "text" : "Pod encoder will be +1, -1 or 0;\nencoder press will be 0 or 1" } @@ -233,7 +524,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 473.5, 120.0, 75.0, 22.0 ], + "patching_rect" : [ 970.5, 96.0, 75.0, 23.0 ], "text" : "param press" } @@ -245,7 +536,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 453.5, 96.0, 186.0, 22.0 ], + "patching_rect" : [ 767.0, 96.0, 186.0, 23.0 ], "text" : "param encoder @min -1 @max 1" } @@ -257,8 +548,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 284.5, 172.0, 164.0, 22.0 ], - "text" : "param sw2 @min -1 @max 1" + "patching_rect" : [ 307.0, 96.0, 66.0, 23.0 ], + "text" : "param sw2" } } @@ -269,7 +560,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 265.5, 148.0, 67.0, 22.0 ], + "patching_rect" : [ 225.5, 96.0, 67.0, 23.0 ], "text" : "param sw1" } @@ -281,7 +572,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 794.5, 96.0, 107.0, 22.0 ], + "patching_rect" : [ 1138.5, 280.0, 107.0, 23.0 ], "text" : "oopsy.suggestions" } @@ -292,7 +583,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 9.5, 350.0, 69.0, 20.0 ], + "patching_rect" : [ 9.5, 350.0, 69.0, 21.0 ], "text" : "OUTPUTS" } @@ -303,7 +594,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 9.5, 96.0, 69.0, 20.0 ], + "patching_rect" : [ 9.5, 96.0, 69.0, 21.0 ], "text" : "INPUTS" } @@ -314,7 +605,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 651.0, 62.5, 139.0, 20.0 ], + "patching_rect" : [ 991.0, 280.0, 139.0, 21.0 ], "text" : "MIDI:" } @@ -326,7 +617,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 651.0, 96.0, 53.0, 22.0 ], + "patching_rect" : [ 991.0, 312.0, 59.0, 23.0 ], "text" : "in 3 midi" } @@ -334,11 +625,11 @@ , { "box" : { "id" : "obj-30", - "linecount" : 7, + "linecount" : 6, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 651.0, 150.0, 139.0, 100.0 ], + "patching_rect" : [ 1061.0, 317.0, 160.0, 93.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. " } @@ -346,11 +637,11 @@ , { "box" : { "id" : "obj-17", - "linecount" : 6, + "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 313.5, 211.400900900363922, 122.0, 87.0 ], + "patching_rect" : [ 576.0, 125.0, 135.0, 79.0 ], "text" : "Knob and switch inputs will be mapped to the @min..@max range. @min @max are 0 and 1 by default." } @@ -362,7 +653,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 244.5, 120.0, 79.0, 22.0 ], + "patching_rect" : [ 576.0, 96.0, 79.0, 23.0 ], "text" : "param knob2" } @@ -374,8 +665,8 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 225.5, 96.0, 127.0, 22.0 ], - "text" : "param knob1 @max 1" + "patching_rect" : [ 483.5, 96.0, 78.0, 23.0 ], + "text" : "param knob1" } } @@ -385,7 +676,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 225.5, 61.0, 57.0, 20.0 ], + "patching_rect" : [ 483.5, 61.0, 57.0, 21.0 ], "text" : "Knobs" } @@ -396,7 +687,7 @@ "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 117.5, 61.0, 69.0, 20.0 ], + "patching_rect" : [ 117.5, 61.0, 69.0, 21.0 ], "text" : "Audio IOs" } @@ -408,7 +699,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 158.5, 96.0, 28.0, 22.0 ], + "patching_rect" : [ 158.5, 96.0, 28.0, 23.0 ], "text" : "in 2" } @@ -419,7 +710,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 158.5, 350.0, 35.0, 22.0 ], + "patching_rect" : [ 158.5, 501.0, 36.0, 23.0 ], "text" : "out 2" } @@ -431,7 +722,7 @@ "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 117.5, 96.0, 28.0, 22.0 ], + "patching_rect" : [ 117.5, 96.0, 28.0, 23.0 ], "text" : "in 1" } @@ -442,7 +733,7 @@ "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 117.5, 350.0, 35.0, 22.0 ], + "patching_rect" : [ 117.5, 501.0, 36.0, 23.0 ], "text" : "out 1" } @@ -457,33 +748,91 @@ } , { "patchline" : { - "destination" : [ "obj-21", 1 ], - "order" : 0, + "destination" : [ "obj-34", 1 ], + "midpoints" : [ 585.5, 127.0, 568.0, 127.0, 568.0, 237.0, 653.0, 237.0, 653.0, 339.0, 245.5, 339.0 ], "source" : [ "obj-14", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "order" : 0, + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-65", 0 ], + "midpoints" : [ 493.0, 133.0, 468.0, 133.0, 468.0, 191.0, 406.0, 191.0, 406.0, 447.0, 256.0, 447.0 ], + "order" : 1, + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-66", 0 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "source" : [ "obj-24", 0 ] + } + } , { "patchline" : { "destination" : [ "obj-26", 0 ], + "midpoints" : [ 493.0, 206.75, 419.0, 206.75 ], "order" : 1, - "source" : [ "obj-14", 0 ] + "source" : [ "obj-25", 0 ] } } , { "patchline" : { - "destination" : [ "obj-13", 0 ], + "destination" : [ "obj-57", 0 ], + "midpoints" : [ 493.0, 208.25, 666.0, 208.25 ], + "order" : 0, + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 1 ], + "midpoints" : [ 419.0, 282.75, 248.666666666666657, 282.75 ], "order" : 1, - "source" : [ "obj-16", 0 ] + "source" : [ "obj-26", 0 ] } } , { "patchline" : { - "destination" : [ "obj-21", 0 ], + "destination" : [ "obj-33", 0 ], + "midpoints" : [ 419.0, 282.0, 449.25, 282.0, 449.25, 241.0, 463.5, 241.0 ], "order" : 0, - "source" : [ "obj-16", 0 ] + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 2 ], + "midpoints" : [ 463.5, 288.75, 262.333333333333314, 288.75 ], + "source" : [ "obj-33", 0 ] } } @@ -491,7 +840,7 @@ "patchline" : { "destination" : [ "obj-4", 0 ], "order" : 1, - "source" : [ "obj-18", 0 ] + "source" : [ "obj-34", 0 ] } } @@ -499,72 +848,187 @@ "patchline" : { "destination" : [ "obj-5", 0 ], "order" : 0, - "source" : [ "obj-18", 0 ] + "source" : [ "obj-34", 0 ] } } , { "patchline" : { - "destination" : [ "obj-16", 0 ], - "order" : 0, - "source" : [ "obj-2", 0 ] + "destination" : [ "obj-24", 0 ], + "source" : [ "obj-43", 0 ] } } , { "patchline" : { - "destination" : [ "obj-25", 0 ], + "destination" : [ "obj-22", 0 ], + "source" : [ "obj-56", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-56", 0 ], + "source" : [ "obj-57", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-60", 0 ], + "source" : [ "obj-59", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-59", 0 ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 0 ], + "source" : [ "obj-60", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-62", 0 ], + "source" : [ "obj-61", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-63", 0 ], + "source" : [ "obj-62", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 0 ], + "source" : [ "obj-63", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], "order" : 1, - "source" : [ "obj-2", 0 ] + "source" : [ "obj-65", 0 ] } } , { "patchline" : { "destination" : [ "obj-15", 0 ], - "source" : [ "obj-21", 0 ] + "order" : 0, + "source" : [ "obj-65", 0 ] } } , { "patchline" : { - "destination" : [ "obj-18", 0 ], - "source" : [ "obj-22", 0 ] + "destination" : [ "obj-24", 3 ], + "midpoints" : [ 666.0, 358.0, 631.0, 358.0, 631.0, 294.5, 276.0, 294.5 ], + "source" : [ "obj-66", 0 ] } } , { "patchline" : { - "destination" : [ "obj-4", 0 ], - "source" : [ "obj-23", 0 ] + "destination" : [ "obj-61", 0 ], + "source" : [ "obj-7", 0 ] } } , { "patchline" : { - "destination" : [ "obj-5", 0 ], - "source" : [ "obj-24", 0 ] + "destination" : [ "obj-91", 1 ], + "source" : [ "obj-8", 0 ] } } , { "patchline" : { - "destination" : [ "obj-23", 0 ], - "source" : [ "obj-25", 0 ] + "destination" : [ "obj-88", 0 ], + "source" : [ "obj-85", 0 ] } } , { "patchline" : { - "destination" : [ "obj-24", 0 ], - "source" : [ "obj-26", 0 ] + "destination" : [ "obj-87", 0 ], + "source" : [ "obj-86", 0 ] } } , { "patchline" : { - "destination" : [ "obj-5", 0 ], - "source" : [ "obj-3", 0 ] + "destination" : [ "obj-89", 0 ], + "source" : [ "obj-87", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-90", 0 ], + "source" : [ "obj-88", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-92", 0 ], + "source" : [ "obj-89", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-85", 0 ], + "order" : 1, + "source" : [ "obj-9", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-86", 0 ], + "order" : 0, + "source" : [ "obj-9", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-93", 0 ], + "source" : [ "obj-90", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 1 ], + "source" : [ "obj-91", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-91", 0 ], + "source" : [ "obj-92", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-91", 0 ], + "source" : [ "obj-93", 0 ] } } @@ -573,7 +1037,7 @@ , "patching_rect" : [ 18.0, 267.0, 137.0, 22.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/Oopsy/templates/", "exportname" : "oopsy_pod" } , @@ -727,26 +1191,6 @@ "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" : [ { @@ -829,11 +1273,11 @@ ], "parameters" : { "obj-11" : [ "live.gain~", "live.gain~", 0 ], + "obj-3::obj-32" : [ "live.text[2]", "FILTER", 0 ], + "obj-3::obj-33" : [ "live.text[1]", "FILTER", 0 ], + "obj-3::obj-34" : [ "live.text[3]", "FILTER", 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-33" : [ "live.text[1]", "FILTER", 0 ], - "obj-9::obj-34" : [ "live.text[3]", "FILTER", 0 ], "parameterbanks" : { } @@ -842,27 +1286,6 @@ } , "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", @@ -900,39 +1323,60 @@ } , { "name" : "oopsy.suggestions.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "bootpath" : "~/Documents/Max 8/Packages/Oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", "implicit" : 1 } , { "name" : "oopsy.gate.trig.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "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", + "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", + "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", + "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 + } ], "autosave" : 0 } diff --git a/templates/oopsy_versio.maxpat b/templates/oopsy_versio.maxpat index 8396f7b..9a80d22 100644 --- a/templates/oopsy_versio.maxpat +++ b/templates/oopsy_versio.maxpat @@ -3,14 +3,14 @@ "fileversion" : 1, "appversion" : { "major" : 8, - "minor" : 1, - "revision" : 8, + "minor" : 5, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } , "classnamespace" : "box", - "rect" : [ 288.0, 78.0, 679.0, 709.0 ], + "rect" : [ 61.0, 79.0, 535.0, 709.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -39,6 +39,27 @@ "subpatcher_template" : "", "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "args" : [ "nehcmeulb" ], + "bgmode" : 0, + "border" : 0, + "clickthrough" : 0, + "enablehscroll" : 0, + "enablevscroll" : 0, + "id" : "obj-5", + "lockeddragscroll" : 0, + "lockedsize" : 0, + "maxclass" : "bpatcher", + "name" : "oopsy.maxpat", + "numinlets" : 1, + "numoutlets" : 0, + "offset" : [ 0.0, 0.0 ], + "patching_rect" : [ 251.0, 179.0, 171.0, 171.0 ], + "viewvisibility" : 1 + } + + } +, { "box" : { "activebgcolor" : [ -0.0, 0.0, 0.0, 1.0 ], "bgcolor" : [ 1.0, 0.0, 0.0, 1.0 ], @@ -50,8 +71,16 @@ "outlettype" : [ "" ], "parameter_enable" : 1, "parameter_mappable" : 0, - "patching_rect" : [ 547.833333333333258, 111.5, 16.0, 16.0 ], + "patching_rect" : [ 588.833333333333258, 111.5, 16.0, 16.0 ], "saved_attribute_attributes" : { + "activebgcolor" : { + "expression" : "" + } +, + "bgcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_enum" : [ "off", "on" ], "parameter_initial" : [ 0.0 ], @@ -78,8 +107,16 @@ "numoutlets" : 1, "outlettype" : [ "" ], "parameter_enable" : 1, - "patching_rect" : [ 528.5, 111.5, 16.0, 16.0 ], + "patching_rect" : [ 569.5, 111.5, 16.0, 16.0 ], "saved_attribute_attributes" : { + "activebgcolor" : { + "expression" : "" + } +, + "bgcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_enum" : [ "off", "on" ], "parameter_initial" : [ 0.0 ], @@ -107,8 +144,16 @@ "outlettype" : [ "" ], "parameter_enable" : 1, "parameter_mappable" : 0, - "patching_rect" : [ 502.333333333333314, 111.5, 16.0, 16.0 ], + "patching_rect" : [ 543.333333333333258, 111.5, 16.0, 16.0 ], "saved_attribute_attributes" : { + "activebgcolor" : { + "expression" : "" + } +, + "bgcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_enum" : [ "off", "on" ], "parameter_initial" : [ 0.0 ], @@ -135,8 +180,16 @@ "numoutlets" : 1, "outlettype" : [ "" ], "parameter_enable" : 1, - "patching_rect" : [ 483.0, 111.5, 16.0, 16.0 ], + "patching_rect" : [ 524.0, 111.5, 16.0, 16.0 ], "saved_attribute_attributes" : { + "activebgcolor" : { + "expression" : "" + } +, + "bgcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_enum" : [ "off", "on" ], "parameter_initial" : [ 0.0 ], @@ -160,7 +213,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 521.0, 462.355421686746922, 113.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 562.0, 462.355421686746922, 113.0, 22.0 ], "text_width" : 60.0 } @@ -173,7 +227,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 521.0, 440.379518072289102, 113.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 562.0, 440.379518072289102, 113.0, 22.0 ], "text_width" : 60.0 } @@ -186,7 +241,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 521.0, 418.403614457831281, 113.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 562.0, 418.403614457831281, 113.0, 22.0 ], "text_width" : 60.0 } @@ -199,7 +255,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 521.0, 396.427710843373461, 113.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 562.0, 396.427710843373461, 113.0, 22.0 ], "text_width" : 60.0 } @@ -212,7 +269,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 521.0, 374.451807228915641, 113.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 562.0, 374.451807228915641, 113.0, 22.0 ], "text_width" : 60.0 } @@ -225,7 +283,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 521.0, 352.47590361445782, 113.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 562.0, 352.47590361445782, 113.0, 22.0 ], "text_width" : 60.0 } @@ -238,7 +297,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 408.5, 437.855421686746922, 99.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 449.5, 437.855421686746922, 99.0, 22.0 ], "text_width" : 63.0 } @@ -252,7 +312,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 408.5, 462.355421686746922, 99.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 449.5, 462.355421686746922, 99.0, 22.0 ], "text_width" : 63.0 } @@ -265,7 +326,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 521.0, 330.5, 113.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 562.0, 330.5, 113.0, 22.0 ], "text_width" : 60.0 } @@ -278,7 +340,8 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 408.5, 413.855421686746922, 99.0, 22.0 ], + "parameter_enable" : 0, + "patching_rect" : [ 449.5, 413.855421686746922, 99.0, 22.0 ], "text_width" : 63.0 } @@ -292,7 +355,7 @@ "mode" : 0, "numinlets" : 1, "numoutlets" : 0, - "patching_rect" : [ 401.75, 328.284172661870343, 242.25, 161.0 ], + "patching_rect" : [ 442.75, 328.284172661870343, 242.25, 161.0 ], "proportion" : 0.5, "rounded" : 0 } @@ -309,8 +372,8 @@ "fileversion" : 1, "appversion" : { "major" : 8, - "minor" : 1, - "revision" : 8, + "minor" : 5, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } @@ -592,7 +655,7 @@ ] } , - "patching_rect" : [ 404.5, 330.5, 58.0, 22.0 ], + "patching_rect" : [ 445.5, 330.5, 58.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -614,7 +677,7 @@ "numoutlets" : 3, "outlettype" : [ "", "", "float" ], "parameter_enable" : 1, - "patching_rect" : [ 443.5, 253.5, 29.0, 17.0 ], + "patching_rect" : [ 484.5, 253.5, 29.0, 17.0 ], "saved_attribute_attributes" : { "valueof" : { "parameter_enum" : [ "A", "B", "C" ], @@ -643,7 +706,7 @@ "numoutlets" : 4, "outlettype" : [ "bang", "bang", "", "int" ], "parameter_enable" : 0, - "patching_rect" : [ 513.0, 294.0, 24.0, 24.0 ], + "patching_rect" : [ 554.0, 294.0, 24.0, 24.0 ], "rounded" : 20.0 } @@ -656,7 +719,7 @@ "numoutlets" : 2, "outlettype" : [ "", "" ], "parameter_enable" : 1, - "patching_rect" : [ 513.0, 294.0, 24.0, 24.0 ], + "patching_rect" : [ 554.0, 294.0, 24.0, 24.0 ], "rounded" : 22.0, "saved_attribute_attributes" : { "valueof" : { @@ -685,7 +748,7 @@ "numoutlets" : 3, "outlettype" : [ "", "", "float" ], "parameter_enable" : 1, - "patching_rect" : [ 443.5, 290.0, 29.0, 17.0 ], + "patching_rect" : [ 484.5, 290.0, 29.0, 17.0 ], "saved_attribute_attributes" : { "valueof" : { "parameter_enum" : [ "X", "Y", "Z" ], @@ -715,8 +778,12 @@ "outlettype" : [ "", "float" ], "panelcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "parameter_enable" : 1, - "patching_rect" : [ 564.0, 252.0, 50.0, 43.0 ], + "patching_rect" : [ 605.0, 252.0, 50.0, 43.0 ], "saved_attribute_attributes" : { + "panelcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_longname" : "knob7", "parameter_mmax" : 1.0, @@ -744,8 +811,12 @@ "outlettype" : [ "", "float" ], "panelcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "parameter_enable" : 1, - "patching_rect" : [ 564.0, 174.0, 50.0, 43.0 ], + "patching_rect" : [ 605.0, 174.0, 50.0, 43.0 ], "saved_attribute_attributes" : { + "panelcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_longname" : "knob6", "parameter_mmax" : 1.0, @@ -773,8 +844,12 @@ "outlettype" : [ "", "float" ], "panelcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "parameter_enable" : 1, - "patching_rect" : [ 564.0, 96.0, 50.0, 43.0 ], + "patching_rect" : [ 605.0, 96.0, 50.0, 43.0 ], "saved_attribute_attributes" : { + "panelcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_longname" : "knob5", "parameter_mmax" : 1.0, @@ -802,8 +877,12 @@ "outlettype" : [ "", "float" ], "panelcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "parameter_enable" : 1, - "patching_rect" : [ 496.0, 210.0, 50.0, 43.0 ], + "patching_rect" : [ 537.0, 210.0, 50.0, 43.0 ], "saved_attribute_attributes" : { + "panelcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_longname" : "knob4", "parameter_mmax" : 1.0, @@ -831,8 +910,12 @@ "outlettype" : [ "", "float" ], "panelcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "parameter_enable" : 1, - "patching_rect" : [ 496.0, 134.0, 50.0, 43.0 ], + "patching_rect" : [ 537.0, 134.0, 50.0, 43.0 ], "saved_attribute_attributes" : { + "panelcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_longname" : "knob3", "parameter_mmax" : 1.0, @@ -860,8 +943,12 @@ "outlettype" : [ "", "float" ], "panelcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "parameter_enable" : 1, - "patching_rect" : [ 431.0, 174.0, 50.0, 43.0 ], + "patching_rect" : [ 472.0, 174.0, 50.0, 43.0 ], "saved_attribute_attributes" : { + "panelcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_longname" : "knob2", "parameter_mmax" : 1.0, @@ -889,8 +976,12 @@ "outlettype" : [ "", "float" ], "panelcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "parameter_enable" : 1, - "patching_rect" : [ 431.0, 96.0, 50.0, 43.0 ], + "patching_rect" : [ 472.0, 96.0, 50.0, 43.0 ], "saved_attribute_attributes" : { + "panelcolor" : { + "expression" : "" + } +, "valueof" : { "parameter_longname" : "knob1", "parameter_mmax" : 1.0, @@ -967,6 +1058,7 @@ "enablevscroll" : 0, "id" : "obj-7", "lockeddragscroll" : 0, + "lockedsize" : 0, "maxclass" : "bpatcher", "name" : "demosound.maxpat", "numinlets" : 0, @@ -977,26 +1069,6 @@ "viewvisibility" : 1 } - } -, { - "box" : { - "args" : [ "@target", "versio" ], - "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" : [ 252.0, 179.0, 128.0, 128.0 ], - "viewvisibility" : 1 - } - } , { "box" : { @@ -1010,8 +1082,8 @@ "fileversion" : 1, "appversion" : { "major" : 8, - "minor" : 1, - "revision" : 8, + "minor" : 5, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } @@ -1452,7 +1524,7 @@ , "patching_rect" : [ 18.0, 483.0, 144.0, 35.0 ], "saved_object_attributes" : { - "exportfolder" : "Macintosh HD:/Users/grrrwaaa/Documents/Max 8/Packages/oopsy/templates/", + "exportfolder" : "macOS:/Users/corvus/Documents/Max 8/Packages/oopsy/templates/", "exportname" : "oopsy_versio" } , @@ -1470,7 +1542,7 @@ "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "jit_matrix" ], - "patching_rect" : [ 391.0, 18.715827338129543, 263.0, 533.568345323740914 ], + "patching_rect" : [ 432.0, 18.715827338129543, 263.0, 533.568345323740914 ], "pic" : "oopsy_noise_engineering_versio.png" } @@ -1486,8 +1558,8 @@ "fileversion" : 1, "appversion" : { "major" : 8, - "minor" : 1, - "revision" : 8, + "minor" : 5, + "revision" : 4, "architecture" : "x64", "modernui" : 1 } @@ -2297,7 +2369,7 @@ ] } , - "patching_rect" : [ 449.0, 523.0, 147.0, 22.0 ], + "patching_rect" : [ 490.0, 523.0, 147.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -2426,7 +2498,7 @@ "patchline" : { "destination" : [ "obj-70", 3 ], "hidden" : 1, - "midpoints" : [ 152.5, 520.0, 586.5, 520.0 ], + "midpoints" : [ 152.5, 520.0, 627.5, 520.0 ], "source" : [ "obj-3", 5 ] } @@ -2435,7 +2507,7 @@ "patchline" : { "destination" : [ "obj-70", 2 ], "hidden" : 1, - "midpoints" : [ 127.5, 520.0, 543.833333333333371, 520.0 ], + "midpoints" : [ 127.5, 520.0, 584.833333333333371, 520.0 ], "source" : [ "obj-3", 4 ] } @@ -2444,7 +2516,7 @@ "patchline" : { "destination" : [ "obj-70", 1 ], "hidden" : 1, - "midpoints" : [ 102.5, 520.0, 501.166666666666686, 520.0 ], + "midpoints" : [ 102.5, 520.0, 542.166666666666629, 520.0 ], "source" : [ "obj-3", 3 ] } @@ -2453,7 +2525,7 @@ "patchline" : { "destination" : [ "obj-70", 0 ], "hidden" : 1, - "midpoints" : [ 77.5, 520.0, 458.5, 520.0 ], + "midpoints" : [ 77.5, 520.0, 499.5, 520.0 ], "source" : [ "obj-3", 2 ] } @@ -2613,38 +2685,51 @@ "obj-26" : [ "live.tab[2]", "live.tab[3]", 0 ], "obj-29" : [ "live.tab[4]", "live.tab[3]", 0 ], "obj-30" : [ "live.text", "live.text", 0 ], + "obj-5::obj-32" : [ "live.text[6]", "FILTER", 0 ], + "obj-5::obj-33" : [ "live.text[4]", "FILTER", 0 ], + "obj-5::obj-34" : [ "live.text[5]", "FILTER", 0 ], "obj-73" : [ "live.button", "live.button", 0 ], "obj-7::obj-21::obj-6" : [ "live.tab[3]", "live.tab[1]", 0 ], "obj-7::obj-35" : [ "[5]", "Level", 0 ], "obj-83" : [ "live.button[3]", "live.button", 0 ], "obj-85" : [ "live.button[5]", "live.button", 0 ], "obj-86" : [ "live.button[6]", "live.button", 0 ], - "obj-9::obj-32" : [ "live.text[2]", "FILTER", 0 ], - "obj-9::obj-33" : [ "live.text[1]", "FILTER", 0 ], - "obj-9::obj-34" : [ "live.text[3]", "FILTER", 0 ], "parameterbanks" : { + } +, + "parameter_overrides" : { + "obj-5::obj-32" : { + "parameter_longname" : "live.text[6]" + } +, + "obj-5::obj-33" : { + "parameter_longname" : "live.text[4]" + } +, + "obj-5::obj-34" : { + "parameter_longname" : "live.text[5]" + } + } , "inherited_shortname" : 1 } , "dependency_cache" : [ { - "name" : "oopsy_noise_engineering_versio.png", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/media", - "patcherrelativepath" : "../media", - "type" : "PNG", + "name" : "demosound.maxpat", + "bootpath" : "C74:/help/msp", + "type" : "JSON", "implicit" : 1 } , { - "name" : "oopsy.suggestions.gendsp", - "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", - "patcherrelativepath" : "../code", - "type" : "gDSP", + "name" : "interfacecolor.js", + "bootpath" : "C74:/interfaces", + "type" : "TEXT", "implicit" : 1 } , { - "name" : "oopsy.gate.min.gendsp", + "name" : "oopsy.ctrl.smooth2.gendsp", "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", @@ -2658,7 +2743,7 @@ "implicit" : 1 } , { - "name" : "oopsy.ctrl.smooth2.gendsp", + "name" : "oopsy.gate.min.gendsp", "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", "patcherrelativepath" : "../code", "type" : "gDSP", @@ -2679,53 +2764,55 @@ "implicit" : 1 } , { - "name" : "oopsy.snoop.js", + "name" : "oopsy.node4max.js", "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 } , { - "name" : "oopsy.node4max.js", + "name" : "oopsy.snoop.js", "bootpath" : "~/Documents/Max 8/Packages/oopsy/javascript", "patcherrelativepath" : "../javascript", "type" : "TEXT", "implicit" : 1 } , { - "name" : "demosound.maxpat", - "bootpath" : "C74:/help/msp", - "type" : "JSON", + "name" : "oopsy.suggestions.gendsp", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/code", + "patcherrelativepath" : "../code", + "type" : "gDSP", "implicit" : 1 } , { - "name" : "sine.svg", - "bootpath" : "C74:/media/max/picts/m4l-picts", - "type" : "svg", + "name" : "oopsy_noise_engineering_versio.png", + "bootpath" : "~/Documents/Max 8/Packages/oopsy/media", + "patcherrelativepath" : "../media", + "type" : "PNG", "implicit" : 1 } , { - "name" : "saw.svg", + "name" : "random.svg", "bootpath" : "C74:/media/max/picts/m4l-picts", "type" : "svg", "implicit" : 1 } , { - "name" : "square.svg", + "name" : "saw.svg", "bootpath" : "C74:/media/max/picts/m4l-picts", "type" : "svg", "implicit" : 1 } , { - "name" : "random.svg", + "name" : "sine.svg", "bootpath" : "C74:/media/max/picts/m4l-picts", "type" : "svg", "implicit" : 1 } , { - "name" : "interfacecolor.js", - "bootpath" : "C74:/interfaces", - "type" : "TEXT", + "name" : "square.svg", + "bootpath" : "C74:/media/max/picts/m4l-picts", + "type" : "svg", "implicit" : 1 } ],