Forums > MaxMSP

Incoming Float value as Volume – needs conversion

April 30, 2013 | 7:30 pm

Hi everyone!

I’ve been reading and looking around for an answer but here is my problem;

i want a visual feedback of an incoming OSC value.

One of my application has a master volume with a range of -90 ( -inf ) and +10 but it sends a float so -90 = 0. and +10 = 1.

so 0 dB = 0.735

I want to interpret this value the same way the master fader behave in the other application so I can create a patch for monitoring.

I just can’t get my head around it.

Any help would be really appreciated.

Thanks


April 30, 2013 | 7:47 pm

Hello, this patcher has two [expr] objects that approximate the behavior of the gain~ object. Gain controls tend to use logarithmic scaling. What scalar formula does the incoming OSC have?
[atodb] and [dbtoa] may also be helpful.

– Pasted Max Patch, click to expand. –

April 30, 2013 | 8:14 pm

@ 32bit:

Thanks for the reply!

About the scalar formula I really can’t help you!

[atodb] and [dbtoa] doesn’t give me the right number and the expr you gave me doesn’t give me a number when I attach a float to the output.

I’m a newb here.


April 30, 2013 | 9:31 pm

OK, The scalar stuff has to do with the way volume (also known as gain or amplitude) is processed by whatever is transforming incoming numbers (or signals) into other numbers (or signals) to outgoing numbers. The main things to consider are:
when you write: One of my application has a master volume with a range of -90 ( -inf ) and +10 but it sends a float so -90 = 0. and +10 = 1.
First of all, is this application a max app? if so, what object(s) are used to generate the -90 to +10 range?
If it’s not a Max app, what is it?
If the value is an "incoming osc value" what is it addressing within Max? if the goal is to scale the -90 +10 to a number that can be used to set the settings of [gain~] try this quick way:

– Pasted Max Patch, click to expand. –

April 30, 2013 | 9:49 pm

OK!

Not it is not a max patch

It’s a software that controls a hardware rig that i’m using. It’s called Cue Station.

I’m receiving a float in max so that’s why I wrote: "a master volume with a range of -90 ( -inf ) and +10 but it sends a float so -90 = 0. and +10 = 1."

Master Volume in Cue Station range is -90 > +10

Max receives 0. > 1.

where -90. = 0. and +10 = 1.

I can use [scale] with that float but it doesn’t match the value that my master fader indicates in the other application.

I want to get the exact number to monitor within a Max Patch.

Is it more clear?


April 30, 2013 | 10:20 pm

Yes that’s clearer. Without seeing the output of the Cue Station fader values I can’t help with the scaling. Maybe someone on this forum knows.
If [atodb] doesn’t match the Cue Station it may be a matter of playing with numbers in [exp] or [linedrive] until a close match is found…


April 30, 2013 | 10:20 pm

"One of my application has a master volume with a range of -90 ( -inf ) and +10 but it sends a float so -90 = 0. and +10 = 1.
so 0 dB = 0.735"

…nö.

you´d better assume 0dB = 1.0, and +10dB = more than 1.0. thats how all audio software handles it (and yes, linear to db/A conversion also works above 1.0).

so … if your input has a range of 0-1 where the 1 should mean +10db, you should scale this input so that it fits to the conversion [atodb] or similar objects perform.


Viewing 7 posts - 1 through 7 (of 7 total)