Using rslider as frequency range selector

Chris Rolfe's icon

Ever wake up saying to yourself, I'm going to code a simple little Max patch this morning in about ten minutes, only to surface 4-5 hours later?

I thought to make a log frequency range selector using rslider and two number boxes, but when you mouse the number boxes directly, you get a negative range, blech. Want I wanted was for the two numbers (lo + hi) to behave like beads on an abacus, i.e., respect each other's boundaries.

Anyway, thought I'd post the result as it contains an interesting Max trick (or, perhaps someone can suggest a simpler approach?).

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

seejayjames's icon

Not sure if this will help, but thought I'd post it. I like what you did with [pvar] which is something I never use, but probably should...

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

You can also make use of [waveform~] instead of the [rslider] for a range selector, it takes a little more work to set up (not much) and gives you some more possibilities like the grid and snapping features, and the "loop" tool behaves slightly differently (expand/contract the range with the mouse more easily than the "select" a la rslider). Just set the buffer~ size to the range you want, like 155 as you have with your [rslider]. You don't need any audio in the buffer~, but you do need to initialize it with a length for it to become interactive.