Merge branch 'release/0.1.0'
1 files modified
4 files added
| | |
| | | *.exe |
| | | *.out |
| | | *.app |
| | | |
| | | # Mac OS Finder |
| | | .DS_Store |
| | | |
| | | # ignore build files |
| | | /build |
New file |
| | |
| | | { |
| | | "patcher" : { |
| | | "fileversion" : 1, |
| | | "appversion" : { |
| | | "major" : 9, |
| | | "minor" : 0, |
| | | "revision" : 5, |
| | | "architecture" : "x64", |
| | | "modernui" : 1 |
| | | } |
| | | , |
| | | "classnamespace" : "box", |
| | | "rect" : [ 549.0, 247.0, 742.0, 657.0 ], |
| | | "gridsize" : [ 15.0, 15.0 ], |
| | | "boxes" : [ { |
| | | "box" : { |
| | | "id" : "obj-27", |
| | | "lastchannelcount" : 0, |
| | | "maxclass" : "live.gain~", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 5, |
| | | "outlettype" : [ "signal", "signal", "", "float", "list" ], |
| | | "parameter_enable" : 1, |
| | | "patching_rect" : [ 141.0, 427.0, 56.0, 138.0 ], |
| | | "saved_attribute_attributes" : { |
| | | "valueof" : { |
| | | "parameter_longname" : "live.gain~", |
| | | "parameter_mmax" : 6.0, |
| | | "parameter_mmin" : -70.0, |
| | | "parameter_modmode" : 3, |
| | | "parameter_shortname" : "live.gain~", |
| | | "parameter_type" : 0, |
| | | "parameter_unitstyle" : 4 |
| | | } |
| | | |
| | | } |
| | | , |
| | | "varname" : "live.gain~" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-25", |
| | | "maxclass" : "toggle", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "int" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 89.5, 55.0, 24.0, 24.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-2", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patching_rect" : [ 89.5, 102.0, 52.0, 22.0 ], |
| | | "text" : "gate 1 0" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "format" : 6, |
| | | "id" : "obj-44", |
| | | "maxclass" : "flonum", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "bang" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 445.0, 41.0, 50.0, 22.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-39", |
| | | "maxclass" : "message", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patching_rect" : [ 445.0, 71.0, 73.0, 22.0 ], |
| | | "text" : "/distance $1" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-1", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 0, |
| | | "patching_rect" : [ 445.0, 102.0, 135.0, 22.0 ], |
| | | "text" : "udpsend localhost 7474" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-38", |
| | | "maxclass" : "number", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "bang" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 196.0, 262.0, 50.0, 22.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-36", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patching_rect" : [ 187.0, 153.0, 77.0, 22.0 ], |
| | | "text" : "loadmess 50" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-35", |
| | | "maxclass" : "number", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "bang" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 187.0, 185.0, 50.0, 22.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-33", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patcher" : { |
| | | "fileversion" : 1, |
| | | "appversion" : { |
| | | "major" : 9, |
| | | "minor" : 0, |
| | | "revision" : 5, |
| | | "architecture" : "x64", |
| | | "modernui" : 1 |
| | | } |
| | | , |
| | | "classnamespace" : "box", |
| | | "rect" : [ 59.0, 119.0, 640.0, 480.0 ], |
| | | "gridsize" : [ 15.0, 15.0 ], |
| | | "boxes" : [ { |
| | | "box" : { |
| | | "fontname" : "Arial", |
| | | "fontsize" : 12.0, |
| | | "id" : "obj-35", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "" ], |
| | | "patching_rect" : [ 35.0, 71.0, 74.0, 22.0 ], |
| | | "text" : "zl stream 20" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "fontname" : "Arial", |
| | | "fontsize" : 12.0, |
| | | "id" : "obj-33", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "" ], |
| | | "patching_rect" : [ 35.0, 94.0, 62.0, 22.0 ], |
| | | "text" : "zl median" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "comment" : "", |
| | | "id" : "obj-7", |
| | | "index" : 2, |
| | | "maxclass" : "inlet", |
| | | "numinlets" : 0, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patching_rect" : [ 110.0, 26.0, 25.0, 25.0 ], |
| | | "varname" : "inlet[1]" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "comment" : "", |
| | | "id" : "obj-11", |
| | | "index" : 1, |
| | | "maxclass" : "outlet", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 0, |
| | | "patching_rect" : [ 35.0, 191.0, 25.0, 25.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "comment" : "", |
| | | "id" : "obj-12", |
| | | "index" : 1, |
| | | "maxclass" : "inlet", |
| | | "numinlets" : 0, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patching_rect" : [ 35.0, 26.0, 25.0, 25.0 ], |
| | | "varname" : "inlet" |
| | | } |
| | | |
| | | } |
| | | ], |
| | | "lines" : [ { |
| | | "patchline" : { |
| | | "destination" : [ "obj-35", 0 ], |
| | | "source" : [ "obj-12", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-11", 0 ], |
| | | "source" : [ "obj-33", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-33", 0 ], |
| | | "source" : [ "obj-35", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-35", 1 ], |
| | | "source" : [ "obj-7", 0 ] |
| | | } |
| | | |
| | | } |
| | | ], |
| | | "originid" : "pat-158" |
| | | } |
| | | , |
| | | "patching_rect" : [ 141.0, 217.0, 65.0, 22.0 ], |
| | | "text" : "p median2" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "format" : 6, |
| | | "id" : "obj-32", |
| | | "maxclass" : "flonum", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "bang" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 274.0, 352.0, 50.0, 22.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "contdata" : 1, |
| | | "id" : "obj-30", |
| | | "maxclass" : "multislider", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 246.0, 430.0, 159.0, 132.0 ], |
| | | "setminmax" : [ 0.0, 10.0 ], |
| | | "setstyle" : 2 |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-29", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "float" ], |
| | | "patcher" : { |
| | | "fileversion" : 1, |
| | | "appversion" : { |
| | | "major" : 9, |
| | | "minor" : 0, |
| | | "revision" : 5, |
| | | "architecture" : "x64", |
| | | "modernui" : 1 |
| | | } |
| | | , |
| | | "classnamespace" : "box", |
| | | "rect" : [ 59.0, 119.0, 640.0, 480.0 ], |
| | | "gridsize" : [ 15.0, 15.0 ], |
| | | "boxes" : [ { |
| | | "box" : { |
| | | "fontname" : "Arial", |
| | | "fontsize" : 11.595186999999999, |
| | | "id" : "obj-31", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "float" ], |
| | | "patching_rect" : [ 195.75, 313.0, 32.5, 21.0 ], |
| | | "text" : "- 0." |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "fontname" : "Arial", |
| | | "fontsize" : 11.595186999999999, |
| | | "id" : "obj-32", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "bang" ], |
| | | "patching_rect" : [ 184.0, 208.0, 27.0, 21.0 ], |
| | | "text" : "b 1" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "fontname" : "Arial", |
| | | "fontsize" : 11.595186999999999, |
| | | "id" : "obj-33", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "float" ], |
| | | "patching_rect" : [ 184.0, 234.0, 56.0, 21.0 ], |
| | | "text" : "cpuclock" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "fontname" : "Arial", |
| | | "fontsize" : 12.0, |
| | | "id" : "obj-29", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "float", "float" ], |
| | | "patching_rect" : [ 184.0, 261.0, 32.5, 22.0 ], |
| | | "text" : "t f f" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "comment" : "", |
| | | "id" : "obj-7", |
| | | "index" : 1, |
| | | "maxclass" : "outlet", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 0, |
| | | "patching_rect" : [ 195.75, 353.0, 25.0, 25.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "comment" : "", |
| | | "id" : "obj-1", |
| | | "index" : 1, |
| | | "maxclass" : "inlet", |
| | | "numinlets" : 0, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patching_rect" : [ 184.0, 164.0, 25.0, 25.0 ] |
| | | } |
| | | |
| | | } |
| | | ], |
| | | "lines" : [ { |
| | | "patchline" : { |
| | | "destination" : [ "obj-32", 0 ], |
| | | "source" : [ "obj-1", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-31", 0 ], |
| | | "source" : [ "obj-29", 1 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-31", 1 ], |
| | | "source" : [ "obj-29", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-7", 0 ], |
| | | "source" : [ "obj-31", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-33", 0 ], |
| | | "source" : [ "obj-32", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-29", 0 ], |
| | | "source" : [ "obj-33", 0 ] |
| | | } |
| | | |
| | | } |
| | | ], |
| | | "originid" : "pat-160" |
| | | } |
| | | , |
| | | "patching_rect" : [ 246.0, 296.0, 65.0, 22.0 ], |
| | | "text" : "p cputimer" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "contdata" : 1, |
| | | "id" : "obj-28", |
| | | "maxclass" : "multislider", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 445.0, 153.0, 159.0, 132.0 ], |
| | | "setminmax" : [ 0.0, 300.0 ], |
| | | "setstyle" : 2 |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-14", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "signal" ], |
| | | "patching_rect" : [ 141.0, 358.0, 40.0, 22.0 ], |
| | | "text" : "*~ 10." |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-13", |
| | | "maxclass" : "ezdac~", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 0, |
| | | "patching_rect" : [ 141.0, 585.0, 45.0, 45.0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-12", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "signal" ], |
| | | "patching_rect" : [ 141.0, 393.0, 43.0, 22.0 ], |
| | | "text" : "cycle~" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-11", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 3, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "signal" ], |
| | | "patching_rect" : [ 141.0, 296.0, 74.0, 22.0 ], |
| | | "text" : "slide~ 10 10" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-9", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "signal" ], |
| | | "patching_rect" : [ 141.0, 262.0, 31.0, 22.0 ], |
| | | "text" : "sig~" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-6", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 2, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "" ], |
| | | "patching_rect" : [ 246.0, 97.0, 87.0, 22.0 ], |
| | | "text" : "route /distance" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "contdata" : 1, |
| | | "id" : "obj-5", |
| | | "maxclass" : "multislider", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 2, |
| | | "outlettype" : [ "", "" ], |
| | | "parameter_enable" : 0, |
| | | "patching_rect" : [ 445.0, 303.0, 159.0, 132.0 ], |
| | | "setminmax" : [ 0.0, 300.0 ], |
| | | "setstyle" : 2 |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-4", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 0, |
| | | "patching_rect" : [ 89.5, 144.0, 32.0, 22.0 ], |
| | | "text" : "print" |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "box" : { |
| | | "id" : "obj-3", |
| | | "maxclass" : "newobj", |
| | | "numinlets" : 1, |
| | | "numoutlets" : 1, |
| | | "outlettype" : [ "" ], |
| | | "patching_rect" : [ 246.0, 56.0, 97.0, 22.0 ], |
| | | "text" : "udpreceive 7474" |
| | | } |
| | | |
| | | } |
| | | ], |
| | | "lines" : [ { |
| | | "patchline" : { |
| | | "destination" : [ "obj-14", 0 ], |
| | | "source" : [ "obj-11", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-27", 1 ], |
| | | "order" : 0, |
| | | "source" : [ "obj-12", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-27", 0 ], |
| | | "order" : 1, |
| | | "source" : [ "obj-12", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-12", 0 ], |
| | | "source" : [ "obj-14", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-4", 0 ], |
| | | "source" : [ "obj-2", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-2", 0 ], |
| | | "source" : [ "obj-25", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-13", 1 ], |
| | | "source" : [ "obj-27", 1 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-13", 0 ], |
| | | "source" : [ "obj-27", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-30", 0 ], |
| | | "order" : 1, |
| | | "source" : [ "obj-29", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-32", 0 ], |
| | | "order" : 0, |
| | | "source" : [ "obj-29", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-2", 1 ], |
| | | "order" : 1, |
| | | "source" : [ "obj-3", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-6", 0 ], |
| | | "order" : 0, |
| | | "source" : [ "obj-3", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-5", 0 ], |
| | | "order" : 0, |
| | | "source" : [ "obj-33", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-9", 0 ], |
| | | "order" : 1, |
| | | "source" : [ "obj-33", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-33", 1 ], |
| | | "source" : [ "obj-35", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-35", 0 ], |
| | | "source" : [ "obj-36", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-11", 2 ], |
| | | "order" : 0, |
| | | "source" : [ "obj-38", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-11", 1 ], |
| | | "order" : 1, |
| | | "source" : [ "obj-38", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-1", 0 ], |
| | | "source" : [ "obj-39", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-39", 0 ], |
| | | "source" : [ "obj-44", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-28", 0 ], |
| | | "order" : 0, |
| | | "source" : [ "obj-6", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-29", 0 ], |
| | | "order" : 1, |
| | | "source" : [ "obj-6", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-33", 0 ], |
| | | "order" : 2, |
| | | "source" : [ "obj-6", 0 ] |
| | | } |
| | | |
| | | } |
| | | , { |
| | | "patchline" : { |
| | | "destination" : [ "obj-11", 0 ], |
| | | "source" : [ "obj-9", 0 ] |
| | | } |
| | | |
| | | } |
| | | ], |
| | | "originid" : "pat-156", |
| | | "parameters" : { |
| | | "obj-27" : [ "live.gain~", "live.gain~", 0 ], |
| | | "parameterbanks" : { |
| | | "0" : { |
| | | "index" : 0, |
| | | "name" : "", |
| | | "parameters" : [ "-", "-", "-", "-", "-", "-", "-", "-" ] |
| | | } |
| | | |
| | | } |
| | | , |
| | | "inherited_shortname" : 1 |
| | | } |
| | | , |
| | | "dependency_cache" : [ ], |
| | | "autosave" : 0 |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | ____ _____ _ _ |
| | | | __ )| ____| | / \ |
| | | | _ \| _| | | / _ \ |
| | | | |_) | |___| |___ / ___ \ |
| | | |____/|_____|_____/_/ \_\ |
| | | http://bela.io |
| | | */ |
| | | /** |
| | | \example Sensors/ultrasonic-distance-sensor/render.cpp |
| | | |
| | | Measuring distances with ultrasonic sensors |
| | | --------------------------- |
| | | |
| | | Ultrasonic sensors can detect distances to a high degree of accuracy, even |
| | | in many conditions where infrared sensors would not be suitable (e.g.: when natural |
| | | light is a problem. For this example we used the [Grove Ultrasonic Ranger] |
| | | (https://wiki.seeedstudio.com/Grove-Ultrasonic_Ranger/). |
| | | |
| | | After it receives a short pulse (> 10us) at its TRIGGER input, the module outputs from the |
| | | ECHO output a pulse whose length is proportional to the distance of the object that is in |
| | | front of the sensor. When a trigger is received the module emits an ultrasonic wave |
| | | from its emitter and then receives the signal back in its receiver, measuring the time |
| | | difference between the two. |
| | | |
| | | According to the datasheet of this sensor, the following relation stands: |
| | | time[us] / 58 = distance[cm] |
| | | The dataseheet recommends a minimum interval of 60ms between triggers, in order to be able to |
| | | read the result appropriately. |
| | | |
| | | Bela sends out the TRIGGER event every 2646 samples(60ms) and then waits for a pulse to come |
| | | appear on the ECHO pin. The `PulseIn` class is used here to monitor a digital pin for an HIGH |
| | | pulse and once the pulse termiantes, it returnes the duration ( in samples ) of the pulse. |
| | | |
| | | The module requires a 5V power supply and its digital inputs and outputs are low at 0V and |
| | | HIGH at 5V. Check the pin diagram in the IDE to see where to find the pins you need. |
| | | It is important that the 5V ECHO output from the module *is not* connected |
| | | straight to Bela's digital inputs, as that would most likely kill the Bela board |
| | | (digital I/Os are 3.3V tolerant). You will need to use a passive resistor divider from the |
| | | HC-SR04's ECHO output to scale down the voltage before connecting it to the digital input |
| | | on `gEchoDigitalInPin`. |
| | | |
| | | On the scope you should see the pulses coming in from the trigger and the distance. The closer |
| | | the object, the shorter the pulses. Make sure you set the trigger to "channel 1" (the pulse) and |
| | | you set the horizontal zoom appropriately. |
| | | */ |
| | | |
| | | #include <Bela.h> |
| | | #include <stdlib.h> |
| | | #include <libraries/Scope/Scope.h> |
| | | #include <libraries/PulseIn/PulseIn.h> |
| | | #include <libraries/OscSender/OscSender.h> |
| | | |
| | | PulseIn pulseIn; |
| | | Scope scope; |
| | | int sensorFreq = 10; // freq in Hz for polling value and sending OSC messages |
| | | int gTriggerInterval = 44100 / sensorFreq; // how often to send out a trigger. 2646 samples are 60ms |
| | | int gMinPulseLength = 7; //to avoid spurious readings |
| | | float gRescale = 58; // taken from the datasheet |
| | | unsigned int gTrigDigitalOutPin = 7; //channel to be connected to the module's TRIGGER pin - check the pin diagram in the IDE |
| | | unsigned int gEchoDigitalInPin = 7; //channel to be connected to the modules's ECHO pin via resistor divider. Check the pin diagram in the IDE |
| | | int gTriggerCount = 0; |
| | | int gPrintfCount = 0; |
| | | |
| | | OscSender oscSender; |
| | | int localPort = 7562; |
| | | const char* remoteIp = "127.0.0.1"; |
| | | int remotePort = 57120; |
| | | |
| | | bool setup(BelaContext *context, void *userData) |
| | | { |
| | | // osc sender setup |
| | | oscSender.setup(remotePort, remoteIp); |
| | | // Set the mode of digital pins |
| | | // pinMode(context, 0, gTrigDigitalOutPin, OUTPUT); // writing to TRIGGER pin |
| | | // pinMode(context, 0, gEchoDigitalInPin, INPUT); // reading from ECHO pin |
| | | pulseIn.setup(context, gEchoDigitalInPin, HIGH); //detect HIGH pulses on the ECHO pin |
| | | scope.setup(2, context->digitalSampleRate); |
| | | return true; |
| | | } |
| | | |
| | | void render(BelaContext *context, void *userData) |
| | | { |
| | | for(unsigned int n = 0; n < context->digitalFrames; ++n){ |
| | | gTriggerCount++; |
| | | bool state; |
| | | if(gTriggerCount == gTriggerInterval){ |
| | | pinMode(context, 0, gTrigDigitalOutPin, OUTPUT); // writing to TRIGGER pin |
| | | state = LOW; |
| | | digitalWriteOnce(context, n, gTrigDigitalOutPin, state); |
| | | } else if (gTriggerCount == gTriggerInterval+1) { |
| | | pinMode(context, 0, gTrigDigitalOutPin, OUTPUT); // writing to TRIGGER pin |
| | | state = HIGH; |
| | | digitalWriteOnce(context, n, gTrigDigitalOutPin, state); |
| | | } else if (gTriggerCount == gTriggerInterval+2) { |
| | | gTriggerCount = 0; |
| | | state = LOW; |
| | | digitalWriteOnce(context, n, gTrigDigitalOutPin, state); |
| | | } else { |
| | | pinMode(context, 0, gTrigDigitalOutPin, INPUT); // writing to TRIGGER pin |
| | | } |
| | | |
| | | auto dRead = digitalRead(context, n, gEchoDigitalInPin); |
| | | int pulseLength = pulseIn.hasPulsed(context, n); // will return the pulse duration(in samples) if a pulse just ended |
| | | |
| | | float duration = 1e6 * pulseLength / context->digitalSampleRate; // pulse duration in microseconds |
| | | |
| | | static float distance = 0; |
| | | if(pulseLength >= gMinPulseLength){ |
| | | // rescaling according to the datasheet |
| | | distance = duration / gRescale; |
| | | } |
| | | |
| | | static int count = 0; |
| | | if(count > gTriggerInterval){ // we do not want to print the value every time we read it |
| | | //rt_printf("pulseLength: %d, distance: %fcm\n", pulseLength, distance); |
| | | oscSender.newMessage("/distance").add(distance).send(); |
| | | count = 0; |
| | | } |
| | | ++count; |
| | | // Logging to the scope the pulse inputs (gEchoDigitalInPin) and the distance |
| | | scope.log(dRead * 0.5, distance/100); |
| | | } |
| | | } |
| | | |
| | | void cleanup(BelaContext *context, void *userData) |
| | | { |
| | | } |
New file |
| | |
| | | { |
| | | "fileName": "render.cpp", |
| | | "CLArgs": { |
| | | "-p": "16", |
| | | "-C": "8", |
| | | "-B": "16", |
| | | "-N": "1", |
| | | "-G": "1", |
| | | "-M": "0", |
| | | "-H0,": "-6", |
| | | "-H1,": "-6", |
| | | "-H2,": "-6", |
| | | "-H3,": "-6", |
| | | "-H4,": "-6", |
| | | "-H5,": "-6", |
| | | "-H6,": "-6", |
| | | "-H7,": "-6", |
| | | "-I0,": "10", |
| | | "-I1,": "10", |
| | | "-I2,": "10", |
| | | "-I3,": "10", |
| | | "-I4,": "10", |
| | | "-I5,": "10", |
| | | "-I6,": "10", |
| | | "-I7,": "10", |
| | | "user": "", |
| | | "make": "", |
| | | "-X": "0", |
| | | "audioExpander": "0", |
| | | "-Y": "", |
| | | "-Z": "", |
| | | "--disable-led": "0" |
| | | } |
| | | } |