Tap, double-tap, and press-hold?

  • Has anyone worked out some tap/doubletap/presshold stuff?

    I've got some of that stuff going for Arduino stuff, but never done it in Max.
    Most of the examples I've seen use a fixed timer, which adds a fair amount of latency. I'm trying to emulate the DL-4 style 'halfspeed, reverse, or halfspeed+reverse' type stuff, with one button. I don't have a DL-4 anymore to test with but I want to say that when you doubletapped it would quickly switch to halfspeed, then realize what you were doing, and switch back to normal speed and instead reverse.
    Just thinking that there wasn't any perceivable latency with the halfspeed stuff, so they have to be doing the timing somehow.

  • I've got something for double-tap, in a patch that isn't online and I don't have access to that machine right. It came from this forum, though. Just can't remember what thread. It was plenty useful, though -- differentiates between "press" vs "double-press" vs "triple-press" vs "quadruple-press" etc.

    I don't think that's included in this file, but I'm using a variation built off of that here:
    http://sadfactory.com/assets/downloads/maxmsp/gtz_sidestep.zip

    Might be useful to tear apart...

    Top row of the step sequencer:
    pressing and releasing a button jumps the transport for beat juggling. but holding a button and pressing a second one sets the range and direction of what's being looped.

    Other rows:
    pressing and releasing a button toggles that button. but holding a button and pressing a second one offsets the grid by that amount.

    I may have ended up cheating with that; using a JS file where standard Max objects could have done the job. Can't remember.

  • This might have been it:

    ----------begin_max5_patcher----------
    514.3ocyV10SCBCEF9Z3WQS8VbgV9XCi23uCiwvGcaUg1kQIN03+cgB39HEn
    aCQuAROsPeedOmCkOMMfQ7cjbH3Nvi.CiOMMLjgpBXzL1.lEtKNMLWtLHuPj
    RDPq5oXEYTV4X4bn8AqWkLpcSzMgh30T1pm2RhE06nqyLaK.NvUdyq8J3olG
    glTukQubqS6NFyyxHL4K.lW95RIf3TZ7qvpo+xzr5h0e.KXsQAqBkDdQz0fh
    T4JIwVIIs7UGR79FRMFP3ORtKHcFFQjJDuDrhJDBN6LxPcxUTHa0vrgcWHuY
    2dUYsXvkfBi7V4C2hhfrqoFljBPJAD2DbImIxoeHAAUoRUbi6kaKcxqX64xz
    qeur6COPVrvL49.eXKMLcDck6A2LBlRmECzpRxg7CjmrF2wsW+vYR7iTdXRc
    lrmNgqySFrAw06mte+96OvShmHnYjs5Wjfl4E3gVL+7ZeVV57B85eVHKTZNS
    qCqAGLxVSQVTGl.Z7Lgp1EKc+DJBIKN75uDwdb8go9bB24ZbLA5PRjq.lRYm
    96VxsnJ9w3kyK1F2Jp1uz.1uQIjbAkEJnkXevh7OZQqoIID1g+EPFMYCuLe1
    HBvSJMas0jsNZxYZ0TfFZBOoRBoiKglTIg0wkNI89qm4zwmNQ3+ezDZ5zD9e
    nO4qS8zeflPCooqPRkC9x7a.QuCec.
    -----------end_max5_patcher-----------


    From here:
    http://post.monome.org/comments.php?DiscussionID=10407&page=12

  • Simple enough. For some reason I've become abstraction-a-phobic in my programming. I guess it's wanting to have everything IN the patch so I can edit and see what's happening. Also makes it easier to share and stuff.

    I guess it needs some additional timing logic to block the single press when there is a double press as double press just sends both bangs out.

  • I think it comes from exploring other people's patches. Everything I run into an abstraction, it kind of halts to the poking/tweaking process. I need to edit the other file, then switch back, then go back, etc... Same with poly's. I use them at the very end once I've built it working as a 'p patcher', though that's probably more commonplace.

  • Here's my solution using that bit of code from above. It bangs instantly for a singletap, but if you doubletap it bang the second thing AND the first thing (putting the first thing back to where it was). (Makes sense if you look at it).

    Also using some (probably not super elegant) logic to control different LED states where nothing on = off, singleclick on = 1, doubleclick on = 2, and both on = 3.


    ----------begin_max5_patcher----------
    1629.3oc0ZssqahCE84juBDZT0ToyzwW.BYzzGlui1pHB3j3VhAANmd5T0+8
    wW.Bj.Ilj.gQUJTrwl8dsWde6vOmOydcxajbaq+x5SVyl8y4yloFRNvrh6mY
    uO3sv3fb0iYGlreOgwseQOGm7FWMNv5iVIa17YFT7eBiogeyJg8YFRbWTxg0
    wD0sXwsqS36D2TtCwTFIL4.SsMNECxNrmxhIb06DVLHMR8lRV+0+v0ub4aRX
    bVvdhZp+IiFDaebORNvK2DPsmOm9upmGh9P4voA7vcT11UYjPtFOfXewzVNN
    KkWVhk+5IVg0WjK4WymK+4k6D1zXisops2sp1oYjbw6Of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    0akJ1oZCZWsgcq10ApKGRpSWuKJyFzHf4QBFMhh0LRVNI1BVU2Rm0x0YWTtb
    XsV.R7UAxWNdsIn1ga5Kh2HcMNNmTy2vCr+sv71Mrh5.Vw2JrdQ9Y8zbuYjD
    pSZvAN1HYbRPTstvXtyazf.lmeXuenoG3ne.OvXClxf+Y8kVhVdqHI5RH4Fg
    kkeki4vO3tzE5uvDF5RU5gN3gASOre8EPtt3ffAA4J5e+Unh8A6f5PRtmUh6
    kKy8AAtMpXzbvcDhW6gZqJxST6iItK+1K5HOU0qPNe63QdxgrvRArLVfUSyf
    HIZNkUUGymNFK9jGbGMJpYcC5TsykFuHysd8VlAlJy3oiL6YnLilVhLzDXdx
    HxPSIFvIiHKi5YlLClNLCSw4VTt+eHyvogLiFab9XLlHRJgI1gverJLHbWgX
    UDXpr4Y14AuRhVIDAQ.sUAbdFUDjUGapQm85t6UWt6Wsz1FS5HVbx5f3htLV
    8LUSe0Fs0VW55t6cczxoisWZ9QPtnwvJXtYXbcehOkgTzs3yXFN04ncPJba3
    W9bBw4jgyZasohi7iF4pxi7q3p1C87kGmok7zLd6vJO9lZuPSH4wYZIOJ60T
    RdPiF+Q9m5slqkNjG+wy+iuIxy34ODhLQdVLt9mAlveFG4Q4Z4ZxCZ73ONNl
    5ObDkmID9bRnoK3edjjGjo9mGQ7YJYuvSq3Em358o6+AilV1KjIwuPiW7KjI
    1KzhQi+Xh6Y3HF9xDwwYTEGvzBctp3.FMwwDWy2psRWG+IeeRRA4juKoS9lj
    N86QRra+Z9+Q9bgI+
    -----------end_max5_patcher-----------

  • That's certainly another way to go about it.