Forums > MaxMSP

Looking for change in specific range

March 8, 2012 | 3:37 am

I get an incoming value x between 0. and 1. and want to trigger specific actions if a new range (f.e 0.25 – 0.5) is entered:
x < 0.02: 0;
x > 0.02 && x 0.25 && x 0.5 && x 0.75 && x 0.98: 0;
While my solution is working (see attached patch) I am sure that there should be more elegant solutions….

– Pasted Max Patch, click to expand. –

March 8, 2012 | 3:50 am

I might use split for this.

– Pasted Max Patch, click to expand. –

March 8, 2012 | 4:12 am

Yeah, that’s much better!
Thanks!


March 8, 2012 | 7:14 am

Hi,

let me take the opportunity for some self-promotion and let you suggest to try my [sadam.split] object for this. Using that object, you won’t need cascaded splits, instead, you would have a single one with multiple limits.

Available in The sadam Library here: http://www.sadam.hu/software

Best,
Ádám


March 8, 2012 | 8:56 am

For these kinds of problems also simple math will do.

– Pasted Max Patch, click to expand. –

March 8, 2012 | 9:03 am

ha, that’s cool! @jvkr


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