{ "patcher" : { "fileversion" : 1, "rect" : [ 142.0, 494.0, 829.0, 625.0 ], "bglocked" : 0, "defrect" : [ 142.0, 494.0, 829.0, 625.0 ], "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], "openinpresentation" : 0, "default_fontsize" : 14.0, "default_fontface" : 0, "default_fontname" : "Arial", "gridonopen" : 0, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 0, "toolbarvisible" : 1, "boxanimatetime" : 200, "imprint" : 0, "enablehscroll" : 1, "enablevscroll" : 1, "devicewidth" : 0.0, "boxes" : [ { "box" : { "maxclass" : "comment", "text" : "-->", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ 146.0, 146.0, 22.0, 18.0 ], "id" : "obj-37", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "the restore of the correct menu index has to wait until the menu is filled completely with all device names", "linecount" : 7, "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ 82.0, 146.0, 83.0, 87.0 ], "id" : "obj-34", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "we save the selected menu index with our live set", "linecount" : 3, "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ 170.0, 26.0, 111.0, 41.0 ], "id" : "obj-32", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "deferlow", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ 170.0, 146.0, 52.0, 18.0 ], "id" : "obj-31", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "prepend set", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ 170.0, 122.0, 67.0, 18.0 ], "id" : "obj-21", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "t i b", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 2, "outlettype" : [ "int", "bang" ], "hidden" : 1, "patching_rect" : [ 170.0, 90.0, 32.5, 18.0 ], "id" : "obj-20", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "varname" : "selected-device-index", "text" : "M4L.api.SaveInteger", "numinlets" : 1, "fontsize" : 10.0, "color" : [ 0.545098, 0.85098, 0.592157, 1.0 ], "numoutlets" : 1, "outlettype" : [ "int" ], "hidden" : 1, "patching_rect" : [ 170.0, 66.0, 107.0, 18.0 ], "id" : "obj-19", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "comment", "text" : "gets the device names for all devices", "linecount" : 3, "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -198.0, -62.0, 86.0, 41.0 ], "id" : "obj-14", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "-->", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -118.0, -62.0, 22.0, 18.0 ], "id" : "obj-15", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "takes a list of track ids and creates a list of all available devices", "linecount" : 5, "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -198.0, -134.0, 86.0, 64.0 ], "id" : "obj-6", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "-->", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -118.0, -134.0, 22.0, 18.0 ], "id" : "obj-13", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "create a list of all track ids", "linecount" : 2, "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -198.0, -158.0, 86.0, 29.0 ], "id" : "obj-5", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "-->", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -118.0, -158.0, 22.0, 18.0 ], "id" : "obj-8", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "< look at what is inside by double clicking (locked) or Cmd/Ctrl-Double-Click (unlocked)", "linecount" : 6, "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ 58.0, -158.0, 86.0, 75.0 ], "id" : "obj-2", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "prototypename" : "ML.patcher-summary", "text" : "Build a menu of all available devices. ", "numinlets" : 1, "fontsize" : 11.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -38.0, -318.0, 209.0, 19.0 ], "id" : "obj-49", "fontname" : "Arial Bold Italic" } } , { "box" : { "maxclass" : "comment", "prototypename" : "ML.subpatcher-title", "text" : "Select Device", "numinlets" : 1, "fontsize" : 24.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -206.0, -326.0, 167.0, 34.0 ], "frgb" : [ 0.3, 0.34, 0.4, 1.0 ], "id" : "obj-1", "fontname" : "Arial Bold Italic", "textcolor" : [ 0.3, 0.34, 0.4, 1.0 ] } } , { "box" : { "maxclass" : "comment", "prototypename" : "ML.patcher-story", "text" : "Scans through all tracks, creates a llist of all available devices and fills it into an ubumenu. Use this patch inside a bpatcher object to display the menu. Outputs the id of the selected device (to be input in a M4L.api.SelectParameter object).", "linecount" : 3, "numinlets" : 1, "fontsize" : 11.0, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -206.0, -294.0, 502.0, 44.0 ], "id" : "obj-50", "fontname" : "Arial Italic" } } , { "box" : { "maxclass" : "button", "prototypename" : "M4L.patching", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "hidden" : 1, "patching_rect" : [ -70.0, -206.0, 18.0, 18.0 ], "id" : "obj-12" } } , { "box" : { "maxclass" : "outlet", "prototypename" : "M4L.Arial10", "numinlets" : 1, "numoutlets" : 0, "hidden" : 1, "patching_rect" : [ -6.0, 154.0, 18.0, 18.0 ], "id" : "obj-52", "comment" : "" } } , { "box" : { "maxclass" : "inlet", "prototypename" : "M4L.Arial10", "numinlets" : 0, "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ -70.0, -238.0, 18.0, 18.0 ], "id" : "obj-51", "comment" : "" } } , { "box" : { "maxclass" : "message", "text" : "clear", "numinlets" : 2, "fontsize" : 10.0, "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ 130.0, -62.0, 35.0, 16.0 ], "id" : "obj-36", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "t b b", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 2, "outlettype" : [ "bang", "bang" ], "hidden" : 1, "patching_rect" : [ -70.0, -182.0, 219.0, 18.0 ], "id" : "obj-35", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "live.menu", "varname" : "live.menu[1]", "numinlets" : 1, "numoutlets" : 3, "presentation_rect" : [ 8.0, 8.0, 100.0, 15.0 ], "outlettype" : [ "", "", "float" ], "patching_rect" : [ 2.0, 2.0, 100.0, 15.0 ], "pictures" : [ ], "presentation" : 1, "id" : "obj-33", "parameter_enable" : 1, "saved_attribute_attributes" : { "valueof" : { "parameter_info" : "", "parameter_order" : 0, "parameter_units" : "", "parameter_speedlim" : 0, "parameter_steps" : 0, "parameter_enum" : [ "one", "two", "three" ], "parameter_exponent" : 1.0, "parameter_unitstyle" : 10, "parameter_mmax" : 127.0, "parameter_mmin" : 0.0, "parameter_type" : 2, "parameter_initial_enable" : 0, "parameter_shortname" : "live.menu", "parameter_invisible" : 0, "parameter_modmax" : 127.0, "parameter_annotation_name" : "", "parameter_longname" : "live.menu[1]", "parameter_modmin" : 0.0, "parameter_linknames" : 0, "parameter_modmode" : 0 } } } } , { "box" : { "maxclass" : "newobj", "text" : "prepend id", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ -6.0, 122.0, 63.0, 18.0 ], "id" : "obj-11", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "zl mth", "numinlets" : 2, "fontsize" : 10.0, "numoutlets" : 2, "outlettype" : [ "", "" ], "hidden" : 1, "patching_rect" : [ -6.0, 98.0, 41.0, 18.0 ], "id" : "obj-10", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "t b i i", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 3, "outlettype" : [ "bang", "int", "int" ], "hidden" : 1, "patching_rect" : [ 2.0, 26.0, 46.0, 18.0 ], "id" : "obj-9", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "zl delace", "numinlets" : 2, "fontsize" : 10.0, "numoutlets" : 2, "outlettype" : [ "", "" ], "hidden" : 1, "patching_rect" : [ 66.0, -62.0, 53.0, 18.0 ], "id" : "obj-7", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "t l l", "numinlets" : 1, "fontsize" : 10.0, "numoutlets" : 2, "outlettype" : [ "", "" ], "hidden" : 1, "patching_rect" : [ -70.0, -102.0, 33.0, 18.0 ], "id" : "obj-4", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "message", "text" : "20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50", "linecount" : 5, "numinlets" : 2, "fontsize" : 10.0, "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ -22.0, 66.0, 109.0, 62.0 ], "id" : "obj-3", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "M4L.api.GetAllDeviceIds", "numinlets" : 1, "fontsize" : 10.0, "color" : [ 0.545098, 0.85098, 0.592157, 1.0 ], "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ -70.0, -134.0, 127.0, 18.0 ], "id" : "obj-22", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "M4L.api.GetDeviceNames", "numinlets" : 1, "fontsize" : 10.0, "color" : [ 0.545098, 0.85098, 0.592157, 1.0 ], "numoutlets" : 2, "outlettype" : [ "", "" ], "hidden" : 1, "patching_rect" : [ -70.0, -62.0, 132.0, 18.0 ], "id" : "obj-17", "fontname" : "Arial Bold" } } , { "box" : { "maxclass" : "newobj", "text" : "M4L.api.GetAllTrackIds", "numinlets" : 1, "fontsize" : 10.0, "color" : [ 0.545098, 0.85098, 0.592157, 1.0 ], "numoutlets" : 1, "outlettype" : [ "" ], "hidden" : 1, "patching_rect" : [ -70.0, -158.0, 121.0, 18.0 ], "id" : "obj-16", "fontname" : "Arial Bold" } } ], "lines" : [ { "patchline" : { "source" : [ "obj-9", 2 ], "destination" : [ "obj-19", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-19", 0 ], "destination" : [ "obj-20", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-21", 0 ], "destination" : [ "obj-31", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-4", 0 ], "destination" : [ "obj-17", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-16", 0 ], "destination" : [ "obj-22", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-22", 0 ], "destination" : [ "obj-4", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-35", 0 ], "destination" : [ "obj-16", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-10", 0 ], "destination" : [ "obj-11", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-3", 0 ], "destination" : [ "obj-10", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-7", 1 ], "destination" : [ "obj-3", 1 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-4", 1 ], "destination" : [ "obj-7", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-11", 0 ], "destination" : [ "obj-52", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-51", 0 ], "destination" : [ "obj-12", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-12", 0 ], "destination" : [ "obj-35", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-35", 1 ], "destination" : [ "obj-36", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-20", 1 ], "destination" : [ "obj-12", 0 ], "hidden" : 1, "midpoints" : [ 193.0, 114.0, 283.0, 114.0, 283.0, -214.0, -60.5, -214.0 ] } } , { "patchline" : { "source" : [ "obj-20", 0 ], "destination" : [ "obj-21", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-9", 0 ], "destination" : [ "obj-3", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-9", 1 ], "destination" : [ "obj-10", 1 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-33", 0 ], "destination" : [ "obj-9", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-36", 0 ], "destination" : [ "obj-33", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-17", 1 ], "destination" : [ "obj-33", 0 ], "hidden" : 1, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-31", 0 ], "destination" : [ "obj-33", 0 ], "hidden" : 1, "midpoints" : [ 179.5, 168.0, 299.0, 168.0, 299.0, -6.0, 11.5, -6.0 ] } } ], "parameters" : { "obj-33" : [ "live.menu[1]", "live.menu", 0 ], "obj-19::obj-19" : [ "saved-int", "saved-int", 0 ] } } }