Previous topicNext topic

setting min/max range

Questions, comments, feedback, etc.
Post Reply
IvanJones
Posts: 28
Joined: Thu Jul 05, 2018 9:25 pm

setting min/max range

Post by IvanJones »

I'm having a time figuring out an easier way to setup a min/max range for the input to operate within, sans using complicated chains of expressions and thresholds and etc.

Is there a "range" modulator that might be named something else and I'm just not figuring it out?

E.g. I have a scale module between an image and the output. I want it to never be less than 1.0 and never to be more than 1.1, but I want the audio input (0.0-1.0) to operate between the scale of 1.0 and 1.1

Currently to do this, I would set an expression X+1 to achieve the minimum, and if there was a "limiter".... I'd set it to 1.1

Theres gotta be an easy way to do this... Mathmaticians?
IvanJones
Posts: 28
Joined: Thu Jul 05, 2018 9:25 pm

Re: setting min/max range

Post by IvanJones »

Figured it out. Offset = 1, Clamp =1.1

Sorry to waste yalls time

EDIT: this still actually does not output as I wanted, as the value remains at 1.1 for the duration that the value exceeds 1.1, I am looking for something that compresses the value as it approaches the parameter (1.1) A limiter would be exactly what I'm looking for.... Do we have this?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: setting min/max range

Post by Magic »

Try:
Scale(.1)
Offset(1)
IvanJones
Posts: 28
Joined: Thu Jul 05, 2018 9:25 pm

Re: setting min/max range

Post by IvanJones »

This is closer, but still does not achieve what I want.
offset scale.PNG
offset scale.PNG (10.66 KiB) Viewed 4357 times
The value is now just 1.0xxx, and still going through the entire range of input.

I want this value to never be less than 1.0, and never be higher than 1.3, while being compressed as it reaches the target value of 1.3

A compression ratio of 10:1 or 20:1 would be similar to how an audio limiter works. I'm literally looking for a way to mimic audio compression.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: setting min/max range

Post by Magic »

Compression can be complicated. To get it the way you want, you will probably need to start with the Expression modifier. For some easy math, you can try something like: if (x<.5, x, .2x+.4). This means that 5x compression will be applied if the input volume is greater than 50%. So your output range will be 0 to .6. Then you can do Scale(.5) to make the range 0 to .3. Then you can do Offset(1) to make the range 1 to 1.3.

Overall I'm not really sure how you want this to work in your scene, but you should experiment and see what works well for you.
IvanJones
Posts: 28
Joined: Thu Jul 05, 2018 9:25 pm

Re: setting min/max range

Post by IvanJones »

Thanks Eric! I didnt know I could use "If" statements in the expression field. That makes this much more handleable, and also much more powerful!
IvanJones
Posts: 28
Joined: Thu Jul 05, 2018 9:25 pm

Re: setting min/max range

Post by IvanJones »

Here's what I've been trying to achieve with this compression expression. limiting the X and Y with compression makes it look much more like an actual spectrum response, which can now be applied to any image, shape, etc.


Video example:
https://drive.google.com/open?id=1OYuPw ... CXaJcb3SW3
Post Reply