{ "patcher" : { "fileversion" : 1, "rect" : [ 25.0, 69.0, 942.0, 701.0 ], "bglocked" : 0, "defrect" : [ 25.0, 69.0, 942.0, 701.0 ], "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], "openinpresentation" : 0, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", "gridonopen" : 0, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 0, "toolbarvisible" : 1, "boxanimatetime" : 200, "imprint" : 0, "boxes" : [ { "box" : { "maxclass" : "message", "text" : "65", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 339.0, 466.0, 32.5, 18.0 ], "outlettype" : [ "" ], "id" : "obj-9", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "sel 1", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 339.0, 437.0, 36.0, 20.0 ], "outlettype" : [ "bang", "" ], "id" : "obj-6", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "Serial Call-Response \n\nSends a byte out the serial port, and reads 3 bytes in. Sets foregound color, xpos, and ypos of a circle using the values returned from the serial port. \n\nNote: This patch assumes that the device on the other end of the serial port is going to send a single byte of value 65 (ASCII A) on startup. The sketch waits for that byte, then sends an ASCII A whenever it wants more data. \n\ncreated 14 Apr 2009\nby Scott Fitzgerald and Tom Igoe", "linecount" : 11, "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 404.0, 52.0, 464.0, 158.0 ], "id" : "obj-5", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "trigger (or [t]) forces right-left conventions. All the drawing and processing will happen before Max requests new values. When this trigger fires, it sends an ASCII A to ask Arduino for new values.", "linecount" : 3, "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 239.0, 505.0, 422.0, 48.0 ], "id" : "obj-65", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "reinitializes the gates when turned on and off", "linecount" : 2, "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 170.0, 370.0, 135.0, 34.0 ], "id" : "obj-64", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "checks for the ascii value of \"A\" to begin cominucation. After initial communication is made, this block shuts down.", "linecount" : 3, "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 460.0, 355.0, 230.0, 48.0 ], "id" : "obj-63", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "p \"draw the circle\"", "numinlets" : 3, "fontsize" : 10.0, "numoutlets" : 1, "patching_rect" : [ 217.0, 645.0, 269.0, 19.0 ], "outlettype" : [ "" ], "id" : "obj-62", "fontname" : "Verdana", "patcher" : { "fileversion" : 1, "rect" : [ 54.0, 94.0, 640.0, 480.0 ], "bglocked" : 0, "defrect" : [ 54.0, 94.0, 640.0, 480.0 ], "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], "openinpresentation" : 0, "default_fontsize" : 10.0, "default_fontface" : 0, "default_fontname" : "Verdana", "gridonopen" : 0, "gridsize" : [ 25.0, 25.0 ], "gridsnaponopen" : 0, "toolbarvisible" : 1, "boxanimatetime" : 200, "imprint" : 0, "boxes" : [ { "box" : { "maxclass" : "message", "text" : "frgb 255 255 255", "numinlets" : 2, "fontsize" : 11.595187, "numoutlets" : 1, "patching_rect" : [ 375.0, 150.0, 98.0, 18.0 ], "outlettype" : [ "" ], "id" : "obj-47", "fontname" : "Arial" } } , { "box" : { "maxclass" : "message", "text" : "frgb 0 0 0", "numinlets" : 2, "fontsize" : 11.595187, "numoutlets" : 1, "patching_rect" : [ 275.0, 125.0, 59.0, 18.0 ], "outlettype" : [ "" ], "id" : "obj-46", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "sel 255 0", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 3, "patching_rect" : [ 300.0, 100.0, 66.0, 21.0 ], "outlettype" : [ "bang", "bang", "" ], "id" : "obj-45", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "newobj", "text" : "pack 0 0 0 0", "numinlets" : 4, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 50.0, 125.0, 180.0, 21.0 ], "outlettype" : [ "" ], "id" : "obj-43", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "newobj", "text" : "+ 10", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 200.0, 100.0, 40.0, 21.0 ], "outlettype" : [ "int" ], "id" : "obj-42", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "newobj", "text" : "+ 10", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 75.0, 100.0, 40.0, 21.0 ], "outlettype" : [ "int" ], "id" : "obj-41", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "message", "text" : "clear, paintoval $1 $2 $3 $4", "numinlets" : 2, "fontsize" : 11.595187, "numoutlets" : 1, "patching_rect" : [ 50.0, 150.0, 152.0, 18.0 ], "outlettype" : [ "" ], "id" : "obj-40", "fontname" : "Arial" } } , { "box" : { "maxclass" : "inlet", "numinlets" : 0, "numoutlets" : 1, "patching_rect" : [ 57.5, 40.0, 25.0, 25.0 ], "outlettype" : [ "int" ], "id" : "obj-58", "comment" : "" } } , { "box" : { "maxclass" : "inlet", "numinlets" : 0, "numoutlets" : 1, "patching_rect" : [ 120.0, 40.0, 25.0, 25.0 ], "outlettype" : [ "int" ], "id" : "obj-59", "comment" : "" } } , { "box" : { "maxclass" : "inlet", "numinlets" : 0, "numoutlets" : 1, "patching_rect" : [ 300.0, 40.0, 25.0, 25.0 ], "outlettype" : [ "int" ], "id" : "obj-60", "comment" : "" } } , { "box" : { "maxclass" : "outlet", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 228.333344, 228.0, 25.0, 25.0 ], "id" : "obj-61", "comment" : "" } } ], "lines" : [ { "patchline" : { "source" : [ "obj-43", 0 ], "destination" : [ "obj-40", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-45", 0 ], "destination" : [ "obj-46", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-45", 1 ], "destination" : [ "obj-47", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-41", 0 ], "destination" : [ "obj-43", 2 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-42", 0 ], "destination" : [ "obj-43", 3 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-58", 0 ], "destination" : [ "obj-43", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-58", 0 ], "destination" : [ "obj-41", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-59", 0 ], "destination" : [ "obj-43", 1 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-59", 0 ], "destination" : [ "obj-42", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-60", 0 ], "destination" : [ "obj-45", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-40", 0 ], "destination" : [ "obj-61", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-46", 0 ], "destination" : [ "obj-61", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-47", 0 ], "destination" : [ "obj-61", 0 ], "hidden" : 0, "midpoints" : [ ] } } ] } , "saved_object_attributes" : { "globalpatchername" : "", "default_fontsize" : 10.0, "fontface" : 0, "fontsize" : 10.0, "default_fontface" : 0, "default_fontname" : "Verdana", "fontname" : "Verdana" } } } , { "box" : { "maxclass" : "newobj", "text" : "0", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 310.0, 378.0, 32.5, 20.0 ], "outlettype" : [ "int" ], "id" : "obj-57", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "!- 1", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 385.0, 436.0, 32.5, 20.0 ], "outlettype" : [ "int" ], "id" : "obj-55", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "gate 1 1", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 385.0, 355.0, 54.0, 20.0 ], "outlettype" : [ "" ], "id" : "obj-54", "fontname" : "Arial" } } , { "box" : { "maxclass" : "toggle", "numinlets" : 1, "numoutlets" : 1, "patching_rect" : [ 385.0, 405.0, 20.0, 20.0 ], "outlettype" : [ "int" ], "id" : "obj-53" } } , { "box" : { "maxclass" : "newobj", "text" : "gate 1 0", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 194.0, 455.0, 54.0, 20.0 ], "outlettype" : [ "" ], "id" : "obj-50", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "sel 65", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 385.0, 380.0, 43.0, 20.0 ], "outlettype" : [ "bang", "" ], "id" : "obj-48", "fontname" : "Arial" } } , { "box" : { "maxclass" : "lcd", "numinlets" : 1, "numoutlets" : 4, "patching_rect" : [ 217.0, 695.0, 256.0, 256.0 ], "outlettype" : [ "list", "list", "int", "" ], "id" : "obj-39" } } , { "box" : { "maxclass" : "newobj", "text" : "t 65 l", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 194.0, 504.0, 42.0, 21.0 ], "outlettype" : [ "int", "" ], "id" : "obj-35", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "comment", "text" : "val3", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 535.0, 604.0, 37.0, 21.0 ], "id" : "obj-1", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "number", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 467.0, 604.0, 56.0, 21.0 ], "outlettype" : [ "int", "bang" ], "id" : "obj-3", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "comment", "text" : "val2", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 410.0, 605.0, 37.0, 21.0 ], "id" : "obj-18", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "comment", "text" : "val1", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 282.0, 605.0, 37.0, 21.0 ], "id" : "obj-20", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "number", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 342.0, 605.0, 56.0, 21.0 ], "outlettype" : [ "int", "bang" ], "id" : "obj-22", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "number", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 217.0, 605.0, 55.0, 21.0 ], "outlettype" : [ "int", "bang" ], "id" : "obj-23", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "newobj", "text" : "unpack 0 0 0", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 3, "patching_rect" : [ 217.0, 570.0, 269.0, 21.0 ], "outlettype" : [ "int", "int", "int" ], "id" : "obj-29", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "newobj", "text" : "zl group 3", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 194.0, 480.0, 71.0, 21.0 ], "outlettype" : [ "", "" ], "id" : "obj-31", "fontname" : "Verdana" } } , { "box" : { "maxclass" : "newobj", "text" : "select 0 1", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 3, "patching_rect" : [ 312.0, 200.0, 62.0, 20.0 ], "outlettype" : [ "bang", "bang", "" ], "id" : "obj-30", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "click here to close the serial port", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 360.0, 291.0, 206.0, 20.0 ], "id" : "obj-26", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "click here to open the serial port", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 385.0, 265.0, 206.0, 20.0 ], "id" : "obj-27", "fontname" : "Arial" } } , { "box" : { "maxclass" : "message", "text" : "close", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 312.0, 291.0, 39.0, 18.0 ], "outlettype" : [ "" ], "id" : "obj-21", "fontname" : "Arial" } } , { "box" : { "maxclass" : "message", "text" : "port a", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 334.0, 265.0, 41.0, 18.0 ], "outlettype" : [ "" ], "id" : "obj-19", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "Click here to get a list of serial ports", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 405.0, 239.0, 207.0, 20.0 ], "id" : "obj-2", "fontname" : "Arial" } } , { "box" : { "maxclass" : "toggle", "numinlets" : 1, "numoutlets" : 1, "patching_rect" : [ 229.0, 155.0, 22.0, 22.0 ], "outlettype" : [ "int" ], "id" : "obj-11" } } , { "box" : { "maxclass" : "newobj", "text" : "qmetro 10", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 229.0, 200.0, 65.0, 20.0 ], "outlettype" : [ "bang" ], "id" : "obj-12", "fontname" : "Arial" } } , { "box" : { "maxclass" : "message", "text" : "print", "numinlets" : 2, "fontsize" : 12.0, "numoutlets" : 1, "patching_rect" : [ 354.0, 239.0, 36.0, 18.0 ], "outlettype" : [ "" ], "id" : "obj-13", "fontname" : "Arial" } } , { "box" : { "maxclass" : "newobj", "text" : "serial a 9600", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 2, "patching_rect" : [ 229.0, 315.0, 84.0, 20.0 ], "outlettype" : [ "int", "" ], "id" : "obj-14", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "Read serial input buffer every 10 milliseconds", "linecount" : 2, "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 13.0, 192.0, 210.0, 34.0 ], "id" : "obj-15", "fontname" : "Arial" } } , { "box" : { "maxclass" : "comment", "text" : "Click to start", "numinlets" : 1, "fontsize" : 12.0, "numoutlets" : 0, "patching_rect" : [ 256.0, 163.0, 117.0, 20.0 ], "id" : "obj-17", "fontname" : "Arial" } } ], "lines" : [ { "patchline" : { "source" : [ "obj-9", 0 ], "destination" : [ "obj-14", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-53", 0 ], "destination" : [ "obj-6", 0 ], "hidden" : 0, "midpoints" : [ 394.5, 431.5, 348.5, 431.5 ] } } , { "patchline" : { "source" : [ "obj-6", 0 ], "destination" : [ "obj-9", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-31", 0 ], "destination" : [ "obj-35", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-35", 1 ], "destination" : [ "obj-29", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-35", 0 ], "destination" : [ "obj-14", 0 ], "hidden" : 0, "midpoints" : [ 203.5, 542.0, 167.0, 542.0, 167.0, 300.0, 238.5, 300.0 ] } } , { "patchline" : { "source" : [ "obj-57", 0 ], "destination" : [ "obj-53", 0 ], "hidden" : 0, "midpoints" : [ 319.5, 401.0, 394.5, 401.0 ] } } , { "patchline" : { "source" : [ "obj-30", 0 ], "destination" : [ "obj-57", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-55", 0 ], "destination" : [ "obj-54", 0 ], "hidden" : 0, "midpoints" : [ 394.5, 459.0, 453.0, 459.0, 453.0, 351.0, 394.5, 351.0 ] } } , { "patchline" : { "source" : [ "obj-53", 0 ], "destination" : [ "obj-55", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-23", 0 ], "destination" : [ "obj-62", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-22", 0 ], "destination" : [ "obj-62", 1 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-3", 0 ], "destination" : [ "obj-62", 2 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-62", 0 ], "destination" : [ "obj-39", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-54", 0 ], "destination" : [ "obj-48", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-14", 0 ], "destination" : [ "obj-54", 1 ], "hidden" : 0, "midpoints" : [ 238.5, 342.0, 429.5, 342.0 ] } } , { "patchline" : { "source" : [ "obj-53", 0 ], "destination" : [ "obj-50", 0 ], "hidden" : 0, "midpoints" : [ 394.5, 426.0, 203.5, 426.0 ] } } , { "patchline" : { "source" : [ "obj-48", 0 ], "destination" : [ "obj-53", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-50", 0 ], "destination" : [ "obj-31", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-14", 0 ], "destination" : [ "obj-50", 1 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-29", 1 ], "destination" : [ "obj-22", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-29", 0 ], "destination" : [ "obj-23", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-29", 2 ], "destination" : [ "obj-3", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-11", 0 ], "destination" : [ "obj-30", 0 ], "hidden" : 0, "midpoints" : [ 238.5, 191.0, 321.5, 191.0 ] } } , { "patchline" : { "source" : [ "obj-30", 1 ], "destination" : [ "obj-19", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-30", 0 ], "destination" : [ "obj-21", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-21", 0 ], "destination" : [ "obj-14", 0 ], "hidden" : 0, "midpoints" : [ 321.5, 311.5, 238.5, 311.5 ] } } , { "patchline" : { "source" : [ "obj-19", 0 ], "destination" : [ "obj-14", 0 ], "hidden" : 0, "midpoints" : [ 343.5, 288.5, 238.5, 288.5 ] } } , { "patchline" : { "source" : [ "obj-13", 0 ], "destination" : [ "obj-14", 0 ], "hidden" : 0, "midpoints" : [ 363.5, 260.5, 238.5, 260.5 ] } } , { "patchline" : { "source" : [ "obj-11", 0 ], "destination" : [ "obj-12", 0 ], "hidden" : 0, "midpoints" : [ ] } } , { "patchline" : { "source" : [ "obj-12", 0 ], "destination" : [ "obj-14", 0 ], "hidden" : 0, "midpoints" : [ ] } } ] } }