Add Min and Max Values to Driver Expression? I have a driver using a scripted expression: var*2. It's working great but the values it's outputting range from .005 up to about 1.5. I'd like to limit the range of the output to something like a minimum of .5 to a maximum of 1.25. Is it possible to do this within the expression itself?

Edit: A little more information, I'm trying to use a sound file to drive a particle value. "Bake Sound to F-Curves" provides me with a non editable F-curve so I'm trying to use a driver to increase the amplitude of the baked F-Curve.
Min max

Use the expression min(max(v, 0.5), 1.25) or its dual max(0.5, min(v, 1.25)) where v is the driver variable (sound curve value)

&gt;&gt;&gt; v = 0.05
&gt;&gt;&gt; min(max(v, 0.5), 1.25)
0.5

&gt;&gt;&gt; v = 3
&gt;&gt;&gt; min(max(v, 0.5), 1.25)
1.25

&gt;&gt;&gt; v = 1.1
&gt;&gt;&gt; min(max(v, 0.5), 1.25)
1.1


If you wish to double the variable v simply replace v with 2 * v in expression.

I would recommend you normalize the values in some way What&#39;s the range of values on a sound-baked f-curve?

Related

How to set driver distance max and min influence?