combining keys / controller buttons
How can I combine two keyboard keys to create a specific function? I have a patch with four buffers, and what I’m trying to do is to use the ‘c’ key, in conjunction with numbers 1, 2, 3 or 4 4, to clear the audio in one of the numbered buffers. So when the keys ‘c’ AND ‘1’ are depressed at the same time the relevant bang occurs to wipe buffer one, and so forth…This must be so straightforward but I can’t work it out!
Something else I’m trying to do is much the same but for the data output by my game controller via the HI object. How would I combine the effects of two trigger buttons, so an action is only done when both are pressed at the same time? I know how to route this data, scale it etc but no idea how to do the above.
Any help much appreciated
using Key and Keyup, you can make it so pressing "c" sends a 1 and releasing c sends a 0. use a "sel 99" and trigger a message saying "1" or "0". (i think c is 99, from memory) use those to open and close a gate object. (put a toggle in between for your visual comfort!) make keys 1 2 3 4 come through that gate so they only do what they do when c is down.
"hi" outputs 1s and 0s already, rather than different objects for press and release, so it’s the same principle but even easier!
hope that helps
Thanks man, think I’m on the right track now – I’ve got it so the number keys only do something when C is down. I’m still unsure as to how to use this gated info, as all that passes through the gate is a bang through its one outlet. Do I need to use more gate outlets or something? Because I’d need one bang message going to each buffer section if you know what I mean. So I tried 4 outlets but only the first sends out a bang
I’ve attached what I’ve got so far from what you suggested. Which reminds me – how do you export a patch into code so you can paste it onto this forum? When I save a patch as text it doesn’t resemble what people post here..its far longer and doesn’t end with end_patcher or whatever…
Moving the [select] to the other side of the [gate] should do the trick.
----------begin_max5_patcher---------- 616.3ocyXtrbaBCFEdM9oPiV6lQW3l5t7bjISGrsJQofviQL0oYx6dQBbCkX iTIboarFDXw47oC+9275FO3thy7RH3qfG.ddutwyyLkdBu1i8f4Im2mkTZtL 3tJkpPB21bpiIp8OIjoe6DeupYYvr36PaAjv.y.5xmfGa+NxpbgLiqLqG98I KpT8mUbvbOK187WBubKatL0KG4M2O3tDYJD7n9rusYi9isSlWhnygW7WEu3y lCuPlAuH4+rdourvJ9YiEfk7LfOCDf.AXP.YHuR7M1iRzCXbjYHtiY+dgTIS xMZEd+IQRFzcLDzYQJE+xrHXMP+.cvD7v7Y6sGmqbPKal3b.lhmgjfpHMMia 2M3nno0MD5MciPplzX8O3uLjAiQcLX.6tfwkjQW059tmjwQCRjsWaXTXJmWV ljx+.mPCQovlX.0Po5G60TJ7emRjACHtPIzMozjFZRSTN7XAAY3Qj+XSMeZd fHSLOtU5.O.MhYcCGn0JbvBmXVXuVe6iEXxjVcjQWiFXZ2EmZurvMvvX12uh aBpitqkqGTINGTiYVaZYY4RyV+pik3kEK0MFTczdZIjrtcFDuTMFLp9mZhNq NineRFYDLLSH6+u0MVVO+eCtxhpS6ubK9SmIf2M9AdoRHSTh5ZtctJceuctp mDGNvkcIPt3vwhZ40JiarQ5ppz+j3+ehh3fn5o74VS5ZO10DYY4D0kMud4tY GTLW.0xFnLuE..0hnBWAMQrnI+UPSXKZhrBZxZJmhWVUgHNU3bgUk9cDXWUF siWtJBtTlpW80YWSt.pdkxl+jN04cuwpp5CdayuANO2jKC -----------end_max5_patcher-----------
select all then choose copy compressed from the edit menu instead of using apple-c
Ahhh, all seems clear now. Thanks fellas
Forums > MaxMSP