Inverting values for module parameters

Mon May 19, 2014 9:03 pm

EDIT: In Magic 1.63, the Invert modifier is an easier way to invert a value. However, the tutorial below is still useful for understanding modifiers in general.

A question I get asked a lot is, "How can I invert a value for a module parameter?"

For example, let's say you want Volume to control Brightness in the ColorHSB module. But, when Volume is high, you want Brightness to be low, and when Volume is low, you want Brightness to be high.

To begin with, we can link Brightness to Volume just by clicking on the link button. In this case, when Volume is 0, Brightness will be 0, and when Volume is 1, Brightness will be 1:

That's the way it works by default. But what if we want the opposite? What if we want Brightness to be 1 when Volume is 0, and Brightness to be 0 when Volume is 1?

We can accomplish this by using two simple modifiers, Scale and Offset:

You can see that the resulting value has gone from .0012 to .9985.

To understand how this works, keep in mind that all features (Volume, Tone, etc.) are in the range of 0 to 1. By adding a Scale modifier with a value of -1, we have now made the range be -1 to 0. To move that range back into positive territory, we use an Offset modifier with a value of 1.

Algebraically speaking, what we've done is this:
(Volume * -1) + 1 = Brightness

Which can also be written as:
1 - Volume = Brightness

To generalize it for any module parameter, we can say:
1 - Feature = Parameter

So, adding the Scale and Offset modifiers with the above values will let you invert any parameter you want.
Site Admin
Posts: 3230
Joined: Wed Apr 09, 2014 9:28 pm

Return to Tutorials, etc.

© 2022 Color & Music, LLC • This web site is mobile-friendly