Forums > MaxMSP

The "operation" patch – don't touch the edges! (re my onebang gripes)

May 17, 2012 | 3:00 am

Used for cheap gesture detection. Includes Peter McCulloch’s fantabulous onebang patch.

– Pasted Max Patch, click to expand. –

The general idea is to wait until the cursor moves all the way to the left. Once that happens I wait until I get "far enough" to the right and then draw a rectangle across the entire area of operation, whose height is equal to (cursor position +/-5). As long as I stay in the rectangle and get "close enough" to the right edge, the whole system sends a bang. If I leave the rectangle before I get to the right edge, the system locks until I go back to the left.

Switching directions and making a vertical rectangle should be trivial.

Yes, I know I’m doing some things wrong probably, but this is what I mean when I say that sacrificing flexibility for speed often results in reduced speed. For example, I’m positive that the ggate is being used incorrectly. Likewise I really shouldn’t have to connect to both inlets of the messageboxes. However, overall I think the patch is far messier than it has to be. For instance there has to be a better way of doing the last 2 operations (+>sel2>).

Also – see how the cursor leaves the lcd completely in the bottom right corner? Can I fix this? I assume this is because I drew the sprite wrong.

Many thanks in advance


May 17, 2012 | 4:11 pm

bump


Viewing 2 posts - 1 through 2 (of 2 total)