alarm door mat problem with constantly bang

schmidsino's icon

hello all!

i hope my english is good enough to describe the problem.
so i work on a project with alarm door mats, the idea is kids can play with 8 mats sound in the kindergarden.
the communication between arduino and max msp and reason works fine.

i have two values 0 and 1 in max i say is $1>0 then bang it works good but the problem is the mat/value does trigger the bang constantly when you stand on the mat.
it means the midi note is playing constantly from the beginnig when you stand on the mat more as a milli second.
thats a problem because it sounds not good.

have anybody a idea for fix that problem?

i search a lot about this problem but i don´t found a reason.

best regards
schmid

----------begin_max5_patcher----------
{
    "patcher" :     {
        "fileversion" : 1,
        "appversion" :         {
            "major" : 6,
            "minor" : 1,
            "revision" : 3,
            "architecture" : "x64"
        }
,
        "rect" : [ -6.0, 54.0, 1356.0, 640.0 ],
        "bglocked" : 0,
        "openinpresentation" : 0,
        "default_fontsize" : 12.0,
        "default_fontface" : 0,
        "default_fontname" : "Arial",
        "gridonopen" : 0,
        "gridsize" : [ 8.0, 8.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" : 11.595187,
                    "id" : "obj-44",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 2,
                    "outlettype" : [ "float", "float" ],
                    "patching_rect" : [ 894.0, 444.0, 107.0, 20.0 ],
                    "text" : "makenote 127 200"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-47",
                    "maxclass" : "number",
                    "maximum" : 16,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1067.0, 453.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-48",
                    "maxclass" : "slider",
                    "min" : 1.0,
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1069.0, 404.0, 20.0, 40.0 ],
                    "size" : 16.0
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-49",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 0,
                    "patching_rect" : [ 893.0, 494.0, 195.0, 20.0 ],
                    "text" : "noteout 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-13",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 1026.5, 175.0, 114.0, 20.0 ],
                    "text" : "if ($i1>0) then bang"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-15",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 1026.5, 137.0, 32.5, 18.0 ],
                    "text" : "$1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-18",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1021.0, 93.0, 99.0, 27.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-2",
                    "maxclass" : "newobj",
                    "numinlets" : 6,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 232.0, 490.5, 99.0, 20.0 ],
                    "text" : "scale 0 1023 0 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-25",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 9,
                    "outlettype" : [ "int", "int", "int", "int", "int", "int", "int", "int", "int" ],
                    "patching_rect" : [ 242.0, 384.0, 204.0, 27.0 ],
                    "text" : "unpack 0 0 0 0 0 0 0 0 0"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-21",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 242.0, 431.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-46",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 885.5, 175.0, 114.0, 20.0 ],
                    "text" : "if ($i1>0) then bang"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-45",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 885.5, 137.0, 32.5, 18.0 ],
                    "text" : "$1"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-26",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1335.0, 318.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-27",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1335.5, 356.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-12",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1276.0, 316.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-22",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1276.5, 354.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-19",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1214.0, 314.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-16",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1214.5, 352.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-23",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1152.0, 315.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-24",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1152.5, 353.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-28",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1082.0, 313.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-29",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1082.5, 351.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-30",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1021.0, 311.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-31",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1021.5, 349.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-32",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 954.0, 311.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-33",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 954.0, 353.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-34",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 894.0, 312.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-35",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 894.0, 356.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-38",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 2,
                    "outlettype" : [ "float", "float" ],
                    "patching_rect" : [ 1161.0, 430.0, 107.0, 20.0 ],
                    "text" : "makenote 127 200"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-39",
                    "maxclass" : "number",
                    "maximum" : 16,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1334.0, 439.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-40",
                    "maxclass" : "slider",
                    "min" : 1.0,
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1336.0, 390.0, 20.0, 40.0 ],
                    "size" : 16.0
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-41",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 0,
                    "patching_rect" : [ 1160.0, 480.0, 195.0, 20.0 ],
                    "text" : "noteout 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "frgb" : 0.0,
                    "id" : "obj-42",
                    "maxclass" : "comment",
                    "numinlets" : 1,
                    "numoutlets" : 0,
                    "patching_rect" : [ 1109.0, 404.0, 48.0, 20.0 ],
                    "text" : "note-on"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "frgb" : 0.0,
                    "id" : "obj-43",
                    "maxclass" : "comment",
                    "numinlets" : 1,
                    "numoutlets" : 0,
                    "patching_rect" : [ 1109.0, 427.0, 50.0, 20.0 ],
                    "text" : "note-off"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-9",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 880.0, 93.0, 99.0, 27.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-20",
                    "maxclass" : "newobj",
                    "numinlets" : 6,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 341.0, 468.0, 99.0, 20.0 ],
                    "text" : "scale 0 1023 0 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-14",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 39.0, 488.0, 126.0, 25.0 ],
                    "text" : "0"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-11",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 46.0, 348.0, 126.0, 25.0 ],
                    "text" : "\"0\""
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-8",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 39.0, 215.0, 161.0, 25.0 ],
                    "text" : "48"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-17",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 333.0, 431.0, 99.0, 27.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-10",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 232.0, 336.0, 104.0, 27.0 ],
                    "text" : "fromsymbol"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-7",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 1,
                    "outlettype" : [ "int" ],
                    "patching_rect" : [ 230.0, 296.0, 46.0, 27.0 ],
                    "text" : "itoa"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-6",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 2,
                    "outlettype" : [ "", "" ],
                    "patching_rect" : [ 230.0, 253.0, 120.0, 27.0 ],
                    "text" : "zl group 1000"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-5",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 3,
                    "outlettype" : [ "bang", "bang", "" ],
                    "patching_rect" : [ 225.0, 185.0, 84.0, 27.0 ],
                    "text" : "sel 13 10"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-4",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "" ],
                    "patching_rect" : [ 225.0, 137.0, 153.0, 27.0 ],
                    "text" : "serial i 9600 8 1 0"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-3",
                    "maxclass" : "toggle",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "int" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 174.0, 45.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-1",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 170.0, 79.0, 72.0, 27.0 ],
                    "text" : "metro 2"
                }

            }
],
        "lines" : [             {
                "patchline" :                 {
                    "destination" : [ "obj-4", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-1", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-14", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-10", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-25", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-10", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-22", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-12", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-32", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-13", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-13", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-15", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-20", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-17", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-15", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-18", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-16", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-19", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-9", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-2", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-18", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-20", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-2", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-21", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-24", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-23", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-17", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-25", 1 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-21", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-25", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-27", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-26", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-29", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-28", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-1", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-3", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-31", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-30", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-33", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-32", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-38", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-33", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-35", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-34", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-44", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-35", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-41", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-38", 1 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-41", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-38", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-41", 2 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-39", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-5", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-4", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-39", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-40", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-49", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-44", 1 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-49", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-44", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-46", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-45", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-34", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-46", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-49", 2 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-47", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-47", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-48", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-6", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-5", 2 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-6", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-5", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-7", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-6", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-8", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-6", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-10", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-7", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-11", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-7", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-45", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-9", 0 ]
                }

            }
],
        "dependency_cache" : [ ]
    }

}
-----------end_max5_patcher-----------

door_mat.maxpat
Max Patch
woyteg's icon

[Change]
|
[select 1]

schmidsino's icon

thanks for the quick response

I tried this yesterday it does not work.
in this case, the bang never triggered.

I've attached the new patch.
you may find my error?

where do I make the error I do not get it??
I know, it's only a small error but I can not find it

thank you thank you

----------begin_max5_patcher----------
{
    "patcher" :     {
        "fileversion" : 1,
        "appversion" :         {
            "major" : 6,
            "minor" : 1,
            "revision" : 3,
            "architecture" : "x64"
        }
,
        "rect" : [ 8.0, 54.0, 1356.0, 640.0 ],
        "bglocked" : 0,
        "openinpresentation" : 0,
        "default_fontsize" : 12.0,
        "default_fontface" : 0,
        "default_fontname" : "Arial",
        "gridonopen" : 0,
        "gridsize" : [ 8.0, 8.0 ],
        "gridsnaponopen" : 0,
        "statusbarvisible" : 0,
        "toolbarvisible" : 1,
        "boxanimatetime" : 200,
        "imprint" : 0,
        "enablehscroll" : 1,
        "enablevscroll" : 1,
        "devicewidth" : 0.0,
        "description" : "",
        "digest" : "",
        "tags" : "",
        "boxes" : [             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-50",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 885.5, 175.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-37",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 2,
                    "outlettype" : [ "bang", "" ],
                    "patching_rect" : [ 998.0, 274.0, 52.0, 20.0 ],
                    "text" : "select 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-36",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 3,
                    "outlettype" : [ "", "int", "int" ],
                    "patching_rect" : [ 998.0, 213.0, 50.0, 20.0 ],
                    "text" : "change"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-44",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 2,
                    "outlettype" : [ "float", "float" ],
                    "patching_rect" : [ 894.0, 444.0, 107.0, 20.0 ],
                    "text" : "makenote 127 200"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-47",
                    "maxclass" : "number",
                    "maximum" : 16,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1067.0, 453.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-48",
                    "maxclass" : "slider",
                    "min" : 1.0,
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1069.0, 404.0, 20.0, 40.0 ],
                    "size" : 16.0
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-49",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 0,
                    "patching_rect" : [ 893.0, 494.0, 195.0, 20.0 ],
                    "text" : "noteout 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-13",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 1026.5, 185.0, 114.0, 20.0 ],
                    "text" : "if ($i1>0) then bang"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-15",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 1026.5, 137.0, 32.5, 18.0 ],
                    "text" : "$1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-18",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1021.0, 93.0, 99.0, 27.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-2",
                    "maxclass" : "newobj",
                    "numinlets" : 6,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 232.0, 488.0, 99.0, 20.0 ],
                    "text" : "scale 0 1000 0 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-25",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 9,
                    "outlettype" : [ "int", "int", "int", "int", "int", "int", "int", "int", "int" ],
                    "patching_rect" : [ 242.0, 384.0, 204.0, 27.0 ],
                    "text" : "unpack 0 0 0 0 0 0 0 0 0"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-21",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 242.0, 431.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-46",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 814.5, 228.0, 114.0, 20.0 ],
                    "text" : "if ($i1>0) then bang"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-45",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 885.5, 137.0, 32.5, 18.0 ],
                    "text" : "$1"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-26",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1335.0, 318.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-27",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1335.5, 356.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-12",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1276.0, 316.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-22",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1276.5, 354.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-19",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1214.0, 314.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-16",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1214.5, 352.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-23",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1152.0, 315.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-24",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1152.5, 353.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-28",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1082.0, 313.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-29",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1082.5, 351.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-30",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 1021.0, 311.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-31",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1021.5, 349.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-32",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 954.0, 311.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-33",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 954.0, 353.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-34",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 894.0, 312.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-35",
                    "maxclass" : "number",
                    "maximum" : 127,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 894.0, 361.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-38",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 2,
                    "outlettype" : [ "float", "float" ],
                    "patching_rect" : [ 1161.0, 430.0, 107.0, 20.0 ],
                    "text" : "makenote 127 200"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-39",
                    "maxclass" : "number",
                    "maximum" : 16,
                    "minimum" : 1,
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1334.0, 439.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-40",
                    "maxclass" : "slider",
                    "min" : 1.0,
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 1336.0, 390.0, 20.0, 40.0 ],
                    "size" : 16.0
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "id" : "obj-41",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 0,
                    "patching_rect" : [ 1160.0, 480.0, 195.0, 20.0 ],
                    "text" : "noteout 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "frgb" : 0.0,
                    "id" : "obj-42",
                    "maxclass" : "comment",
                    "numinlets" : 1,
                    "numoutlets" : 0,
                    "patching_rect" : [ 1109.0, 404.0, 48.0, 20.0 ],
                    "text" : "note-on"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 11.595187,
                    "frgb" : 0.0,
                    "id" : "obj-43",
                    "maxclass" : "comment",
                    "numinlets" : 1,
                    "numoutlets" : 0,
                    "patching_rect" : [ 1109.0, 427.0, 50.0, 20.0 ],
                    "text" : "note-off"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-9",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 880.0, 93.0, 99.0, 27.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-20",
                    "maxclass" : "newobj",
                    "numinlets" : 6,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 341.0, 468.0, 92.0, 20.0 ],
                    "text" : "scale 0 100 0 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-14",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 39.0, 488.0, 126.0, 25.0 ],
                    "text" : "99 85"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-11",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 46.0, 348.0, 126.0, 25.0 ],
                    "text" : "\"99 85\""
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-8",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 39.0, 215.0, 161.0, 25.0 ],
                    "text" : "57 57 32 32 56 53"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-17",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 333.0, 431.0, 99.0, 27.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-10",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 232.0, 336.0, 104.0, 27.0 ],
                    "text" : "fromsymbol"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-7",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 1,
                    "outlettype" : [ "int" ],
                    "patching_rect" : [ 230.0, 296.0, 46.0, 27.0 ],
                    "text" : "itoa"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-6",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 2,
                    "outlettype" : [ "", "" ],
                    "patching_rect" : [ 230.0, 253.0, 120.0, 27.0 ],
                    "text" : "zl group 1000"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-5",
                    "maxclass" : "newobj",
                    "numinlets" : 3,
                    "numoutlets" : 3,
                    "outlettype" : [ "bang", "bang", "" ],
                    "patching_rect" : [ 225.0, 185.0, 84.0, 27.0 ],
                    "text" : "sel 13 10"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-4",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "" ],
                    "patching_rect" : [ 225.0, 137.0, 159.0, 27.0 ],
                    "text" : "serial o 9600 8 1 0"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-3",
                    "maxclass" : "toggle",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "int" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 174.0, 45.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 18.0,
                    "id" : "obj-1",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 170.0, 79.0, 72.0, 27.0 ],
                    "text" : "metro 2"
                }

            }
],
        "lines" : [             {
                "patchline" :                 {
                    "destination" : [ "obj-4", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-1", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-14", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-10", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-25", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-10", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-22", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-12", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-36", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-13", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-13", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-15", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-20", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-17", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-15", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-18", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-16", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-19", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-18", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-2", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-9", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-2", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-2", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-21", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-24", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-23", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-17", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-25", 1 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-21", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-25", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-27", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-26", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-29", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-28", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-1", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-3", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-31", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-30", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-33", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-32", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-38", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-33", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-35", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-34", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-44", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-35", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-37", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-36", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-32", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-37", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-41", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-38", 1 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-41", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-38", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-41", 2 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-39", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-5", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-4", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-39", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-40", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-49", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-44", 1 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-49", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-44", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-50", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-45", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-34", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-46", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-49", 2 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-47", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-47", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-48", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-6", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-5", 2 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-6", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-5", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-46", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-50", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-7", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-6", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-8", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-6", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-10", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-7", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-11", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-7", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-45", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-9", 0 ]
                }

            }
],
        "dependency_cache" : [ ]
    }

}
-----------end_max5_patcher-----------

pdelges's icon

Please send your patches as "copy compressed".

About your problem: you need to check for 0->1 and 1->0 transitions.

if you program your arduino yourself, you could add the logic in the arduino itself and send only values on transition.

In Max, you could use change or maybe even togedge.

seejayjames's icon

Most likely the bang did trigger, but only once, and you missed seeing/hearing it (maybe). the [change] object is definitely what you need, because Arduino sends the values constantly, and you only want something to happen when someone gets on the mat or jumps on it, thereby changing the value. Be sure that if they jump, the Arduino is in fact sending a 0 at some point (maybe using [print]) to show that they have jumped, otherwise you'll always get a 1, and coming out of [change], you'll only get it once.

You can also reset [change] with a "set" message, so it thinks the last incoming number was whatever you put in "set". You could attach a [delay 1000] to anything coming out of [change], then a "set -1" back into it. This will cause something (either a 1 or 0, whatever is coming from the Arduino) to be output from [change] once per second, for testing purposes. When you have everything working, take out the [delay] and "set" message.

metamax's icon

schmid, your mistake was in the if statement preceding the change object.

Max Patch
Copy patch and select New From Clipboard in Max.

-

schmidsino's icon

thanks to all for the great input!
nice community!

@metamax
Thanks for the great elegant solution.
I see the error now, it was simply a logic error!
But your solution I had not come by itself!
thank you

schmid