# How to add a skew factor to a map function?

**URL:** <https://forum.juce.com/t/how-to-add-a-skew-factor-to-a-map-function/40448>\
**Category:** General JUCE discussion\
**Created:** [June 30, 2020, 1:40pm UTC](https://forum.juce.com/t/how-to-add-a-skew-factor-to-a-map-function/40448 "2020-06-30T13:40:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![corder](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@corder](https://forum.juce.com/u/corder)\
**Post date:** [June 30, 2020, 1:40pm UTC](https://forum.juce.com/t/how-to-add-a-skew-factor-to-a-map-function/40448/1 "2020-06-30T13:40:30Z")

</div>

Hi,  
I need to map a variable. Its range is from 0 to 1. And I need it to be from 0 t o 1000 but this mapping should have a skew factor. Normally just multiplying it with 1000 would work for this mapping but I need a skew factor. From 0 to 0.5 it should give me 0 to 120 and for the rest it can be exponential or linear. How can I apply a skew factor to a mapping calculation?  
Thank you for your answers 🙏

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [June 30, 2020, 1:48pm UTC](https://forum.juce.com/t/how-to-add-a-skew-factor-to-a-map-function/40448/2 "2020-06-30T13:48:41Z")

</div>

How about using a [NormalisableRange](https://docs.juce.com/develop/classNormalisableRange.html#a740639acf2157636fce16138a51bbfa3)?

Just set the public skew variable…

Or add a lambda as mapping function to the NormalisableRange, then you can do anything there

---

<div class="post-metadata">

**Author:** ![corder](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@corder](https://forum.juce.com/u/corder)\
**Post date:** [July 2, 2020, 12:24pm UTC](https://forum.juce.com/t/how-to-add-a-skew-factor-to-a-map-function/40448/3 "2020-07-02T12:24:27Z")

</div>

```
 /** Creates a NormalisableRange with a given range, interval and skew factor. */
NormalisableRange (ValueType rangeStart,
                   ValueType rangeEnd,
                   ValueType intervalValue,
                   ValueType skewFactor,
                   bool useSymmetricSkew = false) noexcept

```

😃 You’re right 🙂 thank you 🙂
