{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 6, "minor" : 0, "revision" : 8 } , "rect" : [ 607.0, 73.0, 840.0, 588.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", "gridonopen" : 0, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 0, "statusbarvisible" : 2, "toolbarvisible" : 1, "boxanimatetime" : 200, "imprint" : 0, "enablehscroll" : 1, "enablevscroll" : 1, "devicewidth" : 0.0, "description" : "", "digest" : "", "tags" : "", "boxes" : [ { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-97", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 360.0, 255.0, 74.0 ], "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, 18.0 ], "text" : "116 101 120 116 32 65" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-93", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 300.0, 255.0, 47.0 ], "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, 20.0 ], "text" : "thresh" } } , { "box" : { "id" : "obj-89", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 375.0, 90.0, 20.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-79", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 255.0, 255.0, 33.0 ], "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, 20.0 ], "text" : "spell" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-74", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 200.0, 255.0, 33.0 ], "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" : [ "int", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 423.666656, 200.0, 50.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-70", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 555.0, 120.0, 255.0, 60.0 ], "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, "frgb" : 0.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 ], "text" : "A" } } , { "box" : { "id" : "obj-61", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 720.0, 495.0, 20.0, 20.0 ] } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-59", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 720.0, 525.0, 45.0, 33.0 ], "presentation_rect" : [ 719.0, 520.0, 0.0, 0.0 ], "text" : "Not in select" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-53", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 675.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 668.0, 525.0, 0.0, 0.0 ], "text" : "c" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-54", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 645.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 638.0, 525.0, 0.0, 0.0 ], "text" : "b" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-55", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 615.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 608.0, 525.0, 0.0, 0.0 ], "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 ], "presentation_rect" : [ 668.0, 495.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 608.0, 495.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 638.0, 495.0, 0.0, 0.0 ] } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-42", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 570.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 570.0, 523.0, 0.0, 0.0 ], "text" : "C" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-43", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 540.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 540.0, 523.0, 0.0, 0.0 ], "text" : "B" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-44", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 510.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 510.0, 523.0, 0.0, 0.0 ], "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 ], "presentation_rect" : [ 569.0, 495.0, 0.0, 0.0 ] } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-40", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 465.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 466.0, 523.0, 0.0, 0.0 ], "text" : "3" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-39", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 435.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 432.0, 527.0, 0.0, 0.0 ], "text" : "2" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-38", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 405.0, 525.0, 20.0, 20.0 ], "presentation_rect" : [ 403.0, 522.0, 0.0, 0.0 ], "text" : "1" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-37", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 345.0, 525.0, 45.0, 20.0 ], "presentation_rect" : [ 344.0, 523.0, 0.0, 0.0 ], "text" : "Space" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-36", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 294.0, 525.0, 45.0, 33.0 ], "presentation_rect" : [ 297.0, 523.0, 0.0, 0.0 ], "text" : "Arrow\ndown" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-35", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 240.0, 525.0, 45.0, 33.0 ], "presentation_rect" : [ 237.0, 521.0, 0.0, 0.0 ], "text" : "Arrow\nup" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-34", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 185.0, 525.0, 45.0, 33.0 ], "presentation_rect" : [ 183.0, 528.0, 0.0, 0.0 ], "text" : "Arrow\nright" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-33", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 135.0, 525.0, 45.0, 33.0 ], "presentation_rect" : [ 135.0, 522.0, 0.0, 0.0 ], "text" : "Arrow\nleft" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-30", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 90.0, 525.0, 30.0, 20.0 ], "presentation_rect" : [ 96.0, 521.0, 0.0, 0.0 ], "text" : "Esc" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-29", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 525.0, 45.0, 20.0 ], "text" : "Return" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-27", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 60.0, 360.0, 270.0, 47.0 ], "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 ], "presentation_rect" : [ 625.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 565.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 685.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 505.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 388.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 328.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 448.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 268.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 125.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 95.0, 341.0, 0.0, 0.0 ] } } , { "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 ], "presentation_rect" : [ 62.0, 343.0, 0.0, 0.0 ] } } , { "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 ] } } , { "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, 20.0 ], "text" : "select 13 27 28 29 30 31 32 49 50 51 65 66 67 97 98 99" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-10", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 60.0, 300.0, 270.0, 47.0 ], "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, "frgb" : 0.0, "id" : "obj-8", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 105.0, 170.0, 225.0, 60.0 ], "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" : [ "int", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 30.0, 170.0, 50.0, 20.0 ] } } , { "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, 20.0 ], "text" : "key" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "frgb" : 0.0, "id" : "obj-5", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 105.0, 90.0, 225.0, 60.0 ], "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, "frgb" : 0.0, "id" : "obj-2", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 15.0, 315.0, 51.0 ], "text" : "Patch 018. Reading the Keyboard\nWilliam J Turkel\nhttp://williamjturkel.net/code/#programming" } } , { "box" : { "bgcolor" : [ 1.0, 1.0, 1.0, 0.0 ], "border" : 1, "id" : "obj-3", "maxclass" : "panel", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 76.0, 810.0, 495.0 ], "rounded" : 20 } } ], "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" : [ ] } }