mc.*~ deviate by integer range not float range

Matt Romein's icon

Curious if there's a way to use the deviate message to specify only deviating between integers rather than floats. I want an incoming sig~ value to be multiplied by a deviating integer. Right now when I use deviate it only seems to allow for a deviation of values in a float range. Is there a way to change that behavior of deviate. The final value may still be a float since the sig~ value is a float, I just want to make sure it's only multiplied by an integer. Patch attached to explain further.

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

testcase's icon

think you might need to insert something like [mc.round~ 1 @nearest 0] after the [mc.*~ @chans 4] object

Matt Romein's icon

I don't think that quite works. From what I can see it only allows me to round the values coming out of the mc.*~ object. I still need the object to return floats but what I'm hoping is to find a way where the deviation values are always truncated.

For example if the sig~ was a value of 0.5 and I used mc.*~ with a (deviate 2 2) message it would only return either, 0, 0.5, 1.0, 1.5, or 2.0. Right now (deviate 2 2) gives me any float value between 0.0 and 4.0.

testcase's icon

ah i see. i don't think there is a way to do it with the deviate message to mc.*~ but i think you can do something like this:

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

Matt Romein's icon

Ahh that's exactly it. I was focused on changing the behavior of deviate I didn't think about how I could achieve it before I got to the mc.*~ object. Thank you!