Recent topics
Recent Comments 
Mathematical Expressions: Snapping to a valueHi guys, I'm not so hot on my maths, can anyone explain how I might accomplish the following in QC? I have a slider input from 0.8 to 0.8. However, I want the output to jump up in 0.2 increments. This could be achieved with the Mathematical Expression patch, right? I'm just not sure how to use MAX/MIN etc...
More like this

floor(a * 5) / 5
or
max(0.8, min(0.8, floor(a * 5) / 5))
Cheers for the quick reply  so what does the floor expression do?
Rounds a number down, toward zero, to the nearest multiple of significance.
e.g if the significant number is 5 and you've got an actual amount of 113 the nearest result is 110.
That's cool didn't know you could have two arguments to the floor() function. Very handy.
The other alternative is to have sliders going from 0 to 1 (I tend to have all my sliders in this range), then scale, offset and quantize as necessary to get the result in the right range. This way, you can also use an Interpolation patch to have different curves to the slider values. This is really useful, and something I use all the time. I can provide more details on how to hook this up if you're interested.
ax
Hi,
i'm having the same math noobie issues... I would be really interested in your further explanations on this, Toneburst.
On the Interpolation patch expose Patch Time by making it external, then hook an input set to 0,1 to Patch Time. You'll see some version of this technique often in .qtz's posted in these forums.
(Note: input doesn't have to be 0,1  referring here to Toneburst's post).