Search code examples
mathexpressionrangequartz-composer

Convert a range of numbers in Quartz Composer


In Quartz Composzer I have a range of incoming numbers in the range 0 to 1, and I need to convert the range to -1 to 1. There are basic math operators or mathematical expressions I can use in patches which can be linked in any combination to achieve this. What is the simplest way to do this?


Solution

  • If you get x in the range of [0, 1], just output y = 2*(x-.5). The y value is in the range of [-1, 1].