{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 7, "minor" : 0, "revision" : 0, "architecture" : "x86", "modernui" : 1 } , "rect" : [ 86.0, 78.0, 851.0, 596.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-58", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 540.0, 435.0, 276.0, 74.0 ], "style" : "", "text" : "Now, both the left- and right-hand values work the same way. When you change the right-hand value, the trigger object passes that value on to the COLD inlet of the plus object (the i stands for integer), then bangs the HOT inlet." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-56", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "bang", "int" ], "patching_rect" : [ 465.0, 435.0, 61.0, 22.0 ], "style" : "", "text" : "trigger b i" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-52", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 465.0, 405.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-53", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 402.5, 405.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-54", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 402.5, 525.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-55", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 402.5, 495.0, 32.5, 22.0 ], "style" : "", "text" : "+" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-51", "linecount" : 6, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 405.0, 300.0, 210.0, 87.0 ], "style" : "", "text" : "The patch above is not entirely satisfactory, because you have to bang the plus object if you change the right-hand value. We can use the trigger object to make something much better:" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-49", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 510.0, 180.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-48", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 450.0, 180.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "id" : "obj-47", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 405.0, 180.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-46", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 435.0, 255.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-45", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 435.0, 225.0, 32.5, 22.0 ], "style" : "", "text" : "+" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-44", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 690.0, 180.0, 117.0, 74.0 ], "style" : "", "text" : "You can store a default COLD value by using it as a parameter for the arithmetic operator" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-42", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 630.0, 255.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-40", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 630.0, 225.0, 34.0, 22.0 ], "style" : "", "text" : "+ 42" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-39", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 630.0, 180.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-37", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 525.0, 345.0, 33.0 ], "style" : "", "text" : "Hover over the inlets of an object with your mouse cursor. \nHOT inlets are circled in red, COLD ones in blue." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-35", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 405.0, 90.0, 210.0, 74.0 ], "style" : "", "text" : "The left-hand inlet of the aritmetic operator is HOT. When you send a value to it, the object uses that value to perform a calculation and output the answer right away." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-34", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 630.0, 90.0, 186.0, 74.0 ], "style" : "", "text" : "The right-hand inlet of the aritmetic operator is COLD. When you send a value to it, the object stores the value but does not output anything." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-32", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 122.5, 431.5, 253.0, 74.0 ], "style" : "", "text" : "If we analyze the order of events, we see that the button bangs the right-hand message, sending 22 to the plus object, then it bangs the left-hand message, sending 20. Plus then responds by outputting the correct sum." } } , { "box" : { "id" : "obj-30", "maxclass" : "button", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "bang" ], "patching_rect" : [ 30.0, 390.0, 20.0, 20.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-25", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 30.0, 495.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-26", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 30.0, 465.0, 32.5, 22.0 ], "style" : "", "text" : "+" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-27", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 75.0, 435.0, 32.5, 22.0 ], "style" : "", "text" : "22" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-28", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 30.0, 435.0, 32.5, 22.0 ], "style" : "", "text" : "20" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-24", "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 122.5, 390.0, 252.5, 20.0 ], "style" : "", "text" : "Note that this version works. " } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-22", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 210.0, 300.0, 165.0, 60.0 ], "style" : "", "text" : "If you click the right message, nothing seems to happen at all. What is going on?" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-21", "linecount" : 4, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 300.0, 165.0, 60.0 ], "style" : "", "text" : "If you click the left message, you end up with 20, which is probably not what you were expecting" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-19", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 330.0, 150.0, 45.0, 33.0 ], "style" : "", "text" : "Click\nme" } } , { "box" : { "fontface" : 2, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-18", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 150.0, 45.0, 33.0 ], "style" : "", "text" : "Click\nme" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-13", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 285.0, 270.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-14", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 285.0, 240.0, 32.5, 22.0 ], "style" : "", "text" : "+" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-15", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 330.0, 195.0, 32.5, 22.0 ], "style" : "", "text" : "22" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-16", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 285.0, 195.0, 32.5, 22.0 ], "style" : "", "text" : "20" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-12", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 30.0, 270.0, 50.0, 22.0 ], "style" : "" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-10", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "int" ], "patching_rect" : [ 30.0, 240.0, 32.5, 22.0 ], "style" : "", "text" : "+" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-9", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 75.0, 195.0, 32.5, 22.0 ], "style" : "", "text" : "22" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-7", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 30.0, 195.0, 32.5, 22.0 ], "style" : "", "text" : "20" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-5", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 90.0, 346.0, 47.0 ], "style" : "", "text" : "Many Max objects with multiple inlets (including the arithmetic operators) treat the leftmost inlet differently than the others. Try clicking just one of the messages to the plus object..." } } , { "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-012. Hot and Cold Inlets\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, 75.0, 810.0, 495.0 ], "proportion" : 0.39, "rounded" : 20, "style" : "" } } ], "lines" : [ { "patchline" : { "destination" : [ "obj-12", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-10", 0 ] } } , { "patchline" : { "destination" : [ "obj-13", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-14", 0 ] } } , { "patchline" : { "destination" : [ "obj-14", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-15", 0 ] } } , { "patchline" : { "destination" : [ "obj-14", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-16", 0 ] } } , { "patchline" : { "destination" : [ "obj-25", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-26", 0 ] } } , { "patchline" : { "destination" : [ "obj-26", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-27", 0 ] } } , { "patchline" : { "destination" : [ "obj-26", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-28", 0 ] } } , { "patchline" : { "destination" : [ "obj-27", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-30", 0 ] } } , { "patchline" : { "destination" : [ "obj-28", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-30", 0 ] } } , { "patchline" : { "destination" : [ "obj-40", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-39", 0 ] } } , { "patchline" : { "destination" : [ "obj-42", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-40", 0 ] } } , { "patchline" : { "destination" : [ "obj-46", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-45", 0 ] } } , { "patchline" : { "destination" : [ "obj-45", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-47", 0 ] } } , { "patchline" : { "destination" : [ "obj-45", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-48", 0 ] } } , { "patchline" : { "destination" : [ "obj-45", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-49", 0 ] } } , { "patchline" : { "destination" : [ "obj-56", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-52", 0 ] } } , { "patchline" : { "destination" : [ "obj-55", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-53", 0 ] } } , { "patchline" : { "destination" : [ "obj-54", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-55", 0 ] } } , { "patchline" : { "destination" : [ "obj-55", 1 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 516.5, 488.0, 425.5, 488.0 ], "source" : [ "obj-56", 1 ] } } , { "patchline" : { "destination" : [ "obj-55", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 474.5, 473.0, 412.0, 473.0 ], "source" : [ "obj-56", 0 ] } } , { "patchline" : { "destination" : [ "obj-10", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-7", 0 ] } } , { "patchline" : { "destination" : [ "obj-10", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-9", 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 } }