Forums > MaxMSP

Setting the domain with a dial

March 28, 2014 | 10:21 am

I’m trying to alter the domain X axis of a function object with two dials.  My domain is currently set to 0 – 127, but I want to be able trim the top and bottom end of the X axis.  For example, trim crop the domain from 15-100.  I’ve tried "setDomain" as I want all the data points to move when trimmed, but I can’t get it to function.


March 28, 2014 | 11:26 am

I’m confused. The X axis is left-right. You say you want to trim the top and bottom of the X axis, do you mean the Y axis? If so, that’s the range message to the function object.


March 28, 2014 | 11:29 am

Yes, sorry I got a bit confused. The Y axis is from 0-127 and I want to be able to set a low and high threshold with the dials. So where do the two dials plug into on the range message object?


March 28, 2014 | 11:36 am

Is this what you are trying to do?

<code>

– Pasted Max Patch, click to expand. –

</code>


March 28, 2014 | 11:54 am

Thanks, its close. My X-axis (domain) is 0-127, and my Y-axis is the same (0-127). I have a bell shape curve I have drawn in with about 4 data points that starts at 0 and ends about 50 (domain). I would like to slide all of the data points up and down the X-axis with a dial without losing the shape of my curve. Your patch did something similar, but it was moving the points up and down the Y-axis.


March 28, 2014 | 12:59 pm

Ah, I see. Unfortunately, range doesn’t move the breakpoints, it moves the "view" of the breakpoints. If you want to move the breakpoints, you will need to send messages to each of them to change their Y values without changing the X values. Take a look at the function help file to see how to do that.


March 29, 2014 | 12:49 pm

Many thanks, will do.


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