max-msp-jitter

Save image from webcam with handclap MAX MSP


So what I've been trying to do, with none to limited experience in MaxMSP, is to create a patch which shows a little screen with live footage from a webcam. The user claps his hands, a microphone picks the sound up and saves the current image as JPG on the user's computer.

I can find the basic elementes such as the microphone element and I found out by googling how to get the webcam footage on a screen in Max MSP but after that my experience with Max MSP is next to none...

Here is my patch:

{
    "boxes" : [         {
            "box" :             {
                "maxclass" : "message",
                "text" : "exportimage jpeg",
                "id" : "obj-18",
                "fontsize" : 12.0,
                "numinlets" : 2,
                "patching_rect" : [ 390.0, 360.0, 103.0, 18.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
,       {
            "box" :             {
                "maxclass" : "ezadc~",
                "id" : "obj-16",
                "numinlets" : 1,
                "patching_rect" : [ 510.0, 90.0, 45.0, 45.0 ],
                "numoutlets" : 2,
                "outlettype" : [ "signal", "signal" ]
            }

        }
,       {
            "box" :             {
                "maxclass" : "message",
                "text" : "open",
                "id" : "obj-8",
                "fontsize" : 12.0,
                "numinlets" : 2,
                "patching_rect" : [ 570.0, 255.0, 47.0, 18.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
,       {
            "box" :             {
                "maxclass" : "jit.pwindow",
                "id" : "obj-6",
                "numinlets" : 1,
                "patching_rect" : [ 510.0, 360.0, 290.0, 231.0 ],
                "numoutlets" : 0,
                "idlemouse" : 0,
                "dstrect" : [ 0, 0, 320, 240 ],
                "colormode" : "argb",
                "border" : 0.0,
                "srcrect" : [ 0, 0, 320, 240 ],
                "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ],
                "doublebuffer" : 1,
                "planemap" : [ 0, 1, 2, 3 ],
                "depthbuffer" : 1,
                "fsaa" : 0,
                "usesrcrect" : 0,
                "usedstrect" : 0,
                "interp" : 0,
                "stereo" : 0,
                "onscreen" : 1
            }

        }
,       {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "jit.rgb2luma",
                "id" : "obj-4",
                "fontsize" : 12.0,
                "numinlets" : 1,
                "patching_rect" : [ 510.0, 330.0, 73.0, 20.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
,       {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "jit.dx.grab 200 200",
                "id" : "obj-2",
                "fontsize" : 12.0,
                "numinlets" : 1,
                "patching_rect" : [ 510.0, 300.0, 109.0, 20.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
,       {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "qmetro",
                "id" : "obj-1",
                "fontsize" : 12.0,
                "numinlets" : 2,
                "patching_rect" : [ 510.0, 255.0, 48.0, 20.0 ],
                "numoutlets" : 1,
                "outlettype" : [ "bang" ],
                "fontname" : "Arial"
            }

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

        }
,       {
            "patchline" :           {
                "source" : [ "obj-16", 0 ],
                "destination" : [ "obj-1", 0 ],
                "hidden" : 0,
                "midpoints" : [  ]
            }

        }
,       {
            "patchline" :           {
                "source" : [ "obj-2", 0 ],
                "destination" : [ "obj-4", 0 ],
                "hidden" : 0,
                "midpoints" : [  ]
            }

        }
,       {
            "patchline" :           {
                "source" : [ "obj-4", 0 ],
                "destination" : [ "obj-6", 0 ],
                "hidden" : 0,
                "midpoints" : [  ]
            }

        }
,       {
            "patchline" :           {
                "source" : [ "obj-1", 0 ],
                "destination" : [ "obj-2", 0 ],
                "hidden" : 0,
                "midpoints" : [  ]
            }

        }
,       {
            "patchline" :           {
                "source" : [ "obj-8", 0 ],
                "destination" : [ "obj-2", 0 ],
                "hidden" : 0,
                "midpoints" : [  ]
            }

        }
 ]
}

What do I need more to accomplish my goal? I've been reading about filters and jitters on forums but this won't make any sense to me right now..


Solution

  • You'd probably need something along the lines of this (copy and paste this code in an empty max patcher):

    <pre><code>
    ----------begin_max5_patcher----------
    895.3ocyX1sbiBBEG+5jmBGuNaF9vO2q184Xmc5fQVCYTzEIoYamlm8EPSaR
    SsgXbzdgxHB3+yONb3fOOelaR4dZsqy2c9kyrYOOe1LSU5Jl097L2Bx9U4jZ
    Syb2vjKqdjwSKezcQy6K2JyoR4+pnMCjq6B0kyuaeckfVS4RhjUxePPWIaZU
    HveIXgiejo.zd6sdQjqVy3YmzCbbftUdwHcAJ1zGDFdRu3aKXbkXLZE9VkMR
    zTKpsVVpwdJS17MLzUW2KymqusvRRvoOp57QHHo6MxzU5j3j2IZRH7r2gmKM
    zvHskgCCMEnk9Jy7T17mRtjSJLio6OELxqeuav90CRM6Iyf.0D8Rr.5CVJn0
    0jL5EbgtupTHYEp24TyIU0qKkNapnYc6FcMWHXrmwgH.XqKTCY8.XcAz235A
    itczh9PzBsFsn3A0iC1ICYb4UwnuuYcEFeiXDFYJPlIggyA8FnX3.RwTZtCF
    .97UtV.kFmQePegxc6ZELntV4NfOMN+4NXcFKyKZZikgvCHUxHRpMQs5jFvV
    nLY9HnAjF5LBJHRAaemLQ0jGN1DqHjGxDRpI.8j3uLjoD72BpTTp11w4GjUR
    1N5mDv9pgYhM6cgZh5BQvoxGB1qsvR1Jkk79a89vSBxhtLH6Mr+xo1BX.mso
    oYzCWMAPa2NAaR10yapVHLjawR1QEpz+N3.A.finntSJUyx3JC557IpYY.bx
    xAweH2scsJAs0GzYeAU2P2Odf.SQbTewC9NwSu11k9DIc0gqY8KtANfMAM87
    Od+NOvHLXHOYTYEk2uzIPvlHfMQE8BmpiyD0Gbzi+jPmoKL3+RffANAIQVBJ
    eaAYHRQpMCfHyjdHdp1YvafQT59kYBRhxV.5q9shnkMsoI.hmrildJbLeb2b
    F+8+pMiAnq+bhUWtUr5n41fZ0Qxe0DRo0RF2bJ9SZCFdViVyRSol2eTcorZR
    RN0nQvGN0YqbTo9cc8fFM4XCcPZ4.GE4frPNdiFbh9RMUgAmMMzgbFOOYjUd
    xvwkOWUOwiGev1D4ALZ5IzF7DLd3IvF8DNd5Iz1Pgiid7sw6Y7VbYgZBG2kV
    vuNyUHa12BMdyVuKp6GqmfuTQdfiWfPnMQd76obZxWkTUsiJpaGRiRT4xuoT
    neLXg4QFu4QShwtB5N1w1GZpgHTInKUYmuUzjw89H8IqTemWl+e.j169yC
    -----------end_max5_patcher-----------
    </code></pre>