{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 7, "minor" : 0, "revision" : 1, "architecture" : "x86", "modernui" : 1 } , "rect" : [ 293.0, 173.0, 850.0, 595.0 ], "bgcolor" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "editing_bgcolor" : [ 0.721569, 0.737255, 0.85098, 1.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" : "IceCubeTray", "boxes" : [ { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-97", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 360.0, 257.0, 74.0 ], "style" : "", "text" : "Finally, we can store the output in a message by sending it ot the message's right inlet. Note that the output is preceded by the word 'text' in lowercase followed by a blank space (116 101 120 116 32)." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-95", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 375.0, 360.0, 165.0, 22.0 ], "style" : "", "text" : "116 101 120 116 32 65" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-93", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 300.0, 255.0, 47.0 ], "style" : "", "text" : "When the thresh object receives a bunch of messages close together, it combines them into a list " } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-90", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 375.0, 300.0, 44.0, 22.0 ], "style" : "", "text" : "thresh" } } , { "box" : { "id" : "obj-89", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 375.0, 90.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-79", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 255.0, 255.0, 33.0 ], "style" : "", "text" : "The spell object converts a symbol to ASCII codes" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-77", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 375.0, 255.0, 35.0, 22.0 ], "style" : "", "text" : "spell" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-74", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 200.0, 255.0, 33.0 ], "style" : "", "text" : "The second outlet sends the ASCII value of each key as it is pressed" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-72", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 423.666656, 200.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-70", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 120.0, 255.0, 60.0 ], "style" : "", "text" : "This object is called textedit. When the patch is locked, you can click in it and enter text. Press the button to dump the text out the leftmost outlet." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-68", "maxclass" : "textedit", "numinlets" : 1, "numoutlets" : 4, "outlettype" : [ "", "int", "", "" ], "parameter_enable" : 0, "patching_rect" : [ 375.0, 120.0, 165.0, 60.0 ], "style" : "", "text" : "A", "textcolor" : [ 0.0, 0.0, 0.0, 1.0 ] } } , { "box" : { "id" : "obj-61", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 720.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-59", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 720.0, 525.0, 45.0, 33.0 ], "style" : "", "text" : "Not in select" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-53", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 675.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "c" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-54", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 645.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "b" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-55", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 615.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "a" } } , { "box" : { "id" : "obj-56", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 675.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-57", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 615.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-58", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 645.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-42", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 570.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "C" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-43", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 540.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "B" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-44", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 510.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "A" } } , { "box" : { "id" : "obj-41", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 570.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-40", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 465.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "3" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-39", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 435.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "2" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-38", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 405.0, 525.0, 20.0, 20.0 ], "style" : "", "text" : "1" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-37", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 345.0, 525.0, 45.0, 20.0 ], "style" : "", "text" : "Space" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-36", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 294.0, 525.0, 45.0, 33.0 ], "style" : "", "text" : "Arrow\ndown" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-35", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 240.0, 525.0, 45.0, 33.0 ], "style" : "", "text" : "Arrow\nup" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-34", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 185.0, 525.0, 45.0, 33.0 ], "style" : "", "text" : "Arrow\nright" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-33", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 135.0, 525.0, 45.0, 33.0 ], "style" : "", "text" : "Arrow\nleft" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-30", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 90.0, 525.0, 30.0, 20.0 ], "style" : "", "text" : "Esc" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-29", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 525.0, 45.0, 20.0 ], "style" : "", "text" : "Return" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-27", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 60.0, 360.0, 270.0, 47.0 ], "style" : "", "text" : "The key values here work on the Mac. If you are using a Windows machine, you will have to adjust the select object for some keys." } } , { "box" : { "id" : "obj-22", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 510.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-23", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 465.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-24", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 540.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-25", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 435.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-18", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 345.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-19", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 294.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-20", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 405.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-21", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 240.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-16", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 135.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-17", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 90.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-15", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 185.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "id" : "obj-14", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 30.0, 495.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-13", "maxclass" : "newobj", "numinlets" : 17, "numoutlets" : 17, "outlettype" : [ "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "" ], "patching_rect" : [ 30.0, 420.0, 309.0, 22.0 ], "style" : "", "text" : "select 13 27 28 29 30 31 32 49 50 51 65 66 67 97 98 99" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-10", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 60.0, 300.0, 270.0, 47.0 ], "style" : "", "text" : "As in earlier patches, we can use the select object to choose different outlets depending on the value received in the inlet. " } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-8", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 105.0, 170.0, 225.0, 60.0 ], "style" : "", "text" : "Each key on the keyboard has a numeric code (its ASCII code). When this patch is locked, try typing to see the various key values" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-6", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 30.0, 170.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-1", "maxclass" : "newobj", "numinlets" : 0, "numoutlets" : 4, "outlettype" : [ "int", "int", "int", "int" ], "patching_rect" : [ 30.0, 90.0, 59.5, 22.0 ], "style" : "", "text" : "key" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-5", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 105.0, 90.0, 227.0, 60.0 ], "style" : "", "text" : "The Max key object allows us to read values from the keyboard. Unlike the mousestate object, key does not need to be polled with a toggle and metro." } } , { "box" : { "bubble" : 1, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-2", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 15.0, 315.0, 51.0 ], "style" : "", "text" : "Patch 7-019. Reading the Keyboard\nWilliam J Turkel\nhttp://williamjturkel.net/code/#programming" } } , { "box" : { "angle" : 0.0, "bgcolor" : [ 1.0, 1.0, 1.0, 0.0 ], "border" : 1, "id" : "obj-3", "maxclass" : "panel", "mode" : 0, "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 76.0, 810.0, 495.0 ], "proportion" : 0.39, "rounded" : 20, "style" : "" } } ], "lines" : [ { "patchline" : { "destination" : [ "obj-6", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-1", 0 ] } } , { "patchline" : { "destination" : [ "obj-14", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 0 ] } } , { "patchline" : { "destination" : [ "obj-15", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 3 ] } } , { "patchline" : { "destination" : [ "obj-16", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 2 ] } } , { "patchline" : { "destination" : [ "obj-17", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 1 ] } } , { "patchline" : { "destination" : [ "obj-18", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 6 ] } } , { "patchline" : { "destination" : [ "obj-19", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 5 ] } } , { "patchline" : { "destination" : [ "obj-20", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 7 ] } } , { "patchline" : { "destination" : [ "obj-21", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 4 ] } } , { "patchline" : { "destination" : [ "obj-22", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 10 ] } } , { "patchline" : { "destination" : [ "obj-23", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 9 ] } } , { "patchline" : { "destination" : [ "obj-24", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 11 ] } } , { "patchline" : { "destination" : [ "obj-25", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 8 ] } } , { "patchline" : { "destination" : [ "obj-41", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 12 ] } } , { "patchline" : { "destination" : [ "obj-56", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 15 ] } } , { "patchline" : { "destination" : [ "obj-57", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 13 ] } } , { "patchline" : { "destination" : [ "obj-58", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 14 ] } } , { "patchline" : { "destination" : [ "obj-61", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-13", 16 ] } } , { "patchline" : { "destination" : [ "obj-13", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-6", 0 ] } } , { "patchline" : { "destination" : [ "obj-72", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-68", 1 ] } } , { "patchline" : { "destination" : [ "obj-77", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-68", 0 ] } } , { "patchline" : { "destination" : [ "obj-90", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-77", 0 ] } } , { "patchline" : { "destination" : [ "obj-68", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-89", 0 ] } } , { "patchline" : { "destination" : [ "obj-95", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-90", 0 ] } } ], "dependency_cache" : [ ], "embedsnapshot" : 0, "default_bgcolor" : [ 0.207843, 0.215686, 0.278431, 1.0 ], "color" : [ 0.901961, 0.901961, 0.901961, 1.0 ], "elementcolor" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "accentcolor" : [ 0.552941, 0.588235, 0.85098, 1.0 ], "selectioncolor" : [ 0.552941, 0.588235, 0.85098, 1.0 ], "textcolor" : [ 0.090196, 0.07451, 0.07451, 1.0 ], "textcolor_inverse" : [ 0.721569, 0.737255, 0.85098, 1.0 ], "patchlinecolor" : [ 0.207843, 0.215686, 0.278431, 0.9 ], "bgfillcolor_type" : "gradient", "bgfillcolor_color1" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "bgfillcolor_color2" : [ 0.376471, 0.407843, 0.619608, 1.0 ], "bgfillcolor_color" : [ 0.290196, 0.309804, 0.301961, 1.0 ], "bgfillcolor_angle" : 270.0, "bgfillcolor_proportion" : 0.39 } }