Scaling values

vdmx
#1

Hi folks

How do I remap or scale the range of a data receiver. Do I need to use Math and the DDMathParser?

I want to map the master fader in Ableton Live to fade out all my layers. At zero DB, Live will send ~0.85 over OSC but I’d like to map that to a full 0.0 - 1.0 range on the layer opacity to have full brightness.

I’m sure I’m missing something obvious :slight_smile:

0 Likes

#2

Hi @msp,

You can set the slider range in the UI inspector for whatever the slider is.

In this example above, I set the top slider min max to 0-.85 and I set the bottom slider_2 input to be that of the first slider. This is one easy method. Additionally, if you are trying to do this with wild values over a network and only using OSC, you can look into an OSC routing application such as Osculator https://osculator.net/

A lot of this can be taken care of within VDMX.

Also in this example, you could link a control surface slider to almost anything within VDMX and set the min max in the UI slider inspector.

Does that answer your question?

1 Like

#3

Ah yes, thanks @ProjectileObjects - that did the trick!

Circling back under a bit less pressure, the simple answer is “watch the video here”:

If we want to avoid having extra, intervening sliders in play we can apply a Do Math function on the receiver like this:

(($MAX - $MIN) * ($VAL - src_min)) / (src_max - src_min) + $MIN

I’m not sure if you can define the arbitrary variables for src_min and src_max so we may just have to hard code. In my example, if my source range is 0 -> 0.85:

(($MAX - $MIN) * ($VAL - 0)) / (0.85 - 0) + $MIN

There are also a bunch of built in functions available as defined here:

https://github.com/davedelong/DDMathParser/wiki/Functions

Hope that helps someone else :slight_smile:

1 Like