Incoming Float value as Volume – needs conversion
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.
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. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 594.3ocwU9saZCCEF+5vSwYV6B.kFYm+yj1E6AX2s6ZQUlfI3tfcjiCksptm 8Y6.T1JgV0FsIAI5b7wGNe+xmIOLxCsPti0ffOAWCddOLxyykxlvaerGZCcW QEswUFRvtWt3Nje2RZ1NsKcEWvVp3aY.ILCHAlO3THBenPQ6FtnhocMIbexZ ptXMWTdqhUn6FBRlYi9PLNHwGHoXaPnIEL+oFIa0G5DYe1URgtg+SlKWjYSc o4KcCmYfuhjiNoVAciqVzWTbZ0gU5Zr9G0rtgAgf41UdbzH6E+WIhJobwudi Bmj3Tb3LWPduBO74JLEcr6Ji7zL0sLAcQkSL39jXCuTXI.f3B8aSuExMaXlM +LOgT9cvzUIbsCIyApXIbzobndahBYqPept9Crc7orpbgSLGe.eNPl7DGIIN CTTTubDeNCT34LPIWv+LfP6aq4MfTvf0zFfBJpnjAxU.9J6AKK.ofoQ1Tj.z 6lVQc9MRliS4tag3A.WQu7wsZEqwf.plKEmNRYmLR38WFTi4WkJCSUPEqoAz qYvpVQgcJf1F1RvXXKYBlhpYfQ9KXpFXko78t3gB5D7fC8vg0i1y+0y1Uqfw jfo0x6GGFjQxCyseiu4F+wVaZvzJYoo.bFIgLaxjImsxOth720MYpM6G9Ldx Egb+93X2sjjjW.ojWMRyy9m8diKh6rfXRDNrGlm7+i4jnXGyymMXLmDl9tgt aHPz55sliuli1Ntaotg42IU1vTeWHWzE5lOjhskend2KiPTkQ3ZipaUciwtz XyoIyuyii98gS+Bq -----------end_max5_patcher-----------
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.
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. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 455.3ocmTE0aiBCC9Y3WQTdlgHTZm5o6k62wooo.3xxDjTkD506l18aeNFZG cqqk0WvJ1F6uuO6jWhi3kl8fiy9A62rnnWhihHWAGQimi3cx8UsRGkFuQpz+ mmLDQ22ozsfmBkO5bqzW8jR27nEp7CkNuPjtLAMKRyPSd3qnHKMi8v6Uxz6+ XoT0TOMkOe2J9wxakcfGrOBZYYKDxHaL1PI7+cKLzWtS0nks7DFWoQr7PHsW iiCeRlIgqLcc.9yisvC6IRw+ISowXHQY6js8vY0DwnyM1lRBnoYWPkVKHgYY 1DS9WqRGJ0Fi16T+i3rH+XGlHdK4SRUixGE4WVEpM2fjro0fH4hDFco5vbPW 2s9xrtXJquJoymMoWbARmbjUGPoXJH+FaXnVH8gErRot411vzveP79oELWkr EH0K.NVvr79zyp5qtt7ttfL4Kth9Jls9Jtt99I05TAhf.uUo+3SPDOB9OU0b lda0gRMBA16DoFbdkV5UF8jbVcRNOopqA8zIZsxEFxDuxN6zatnYwLPi3FQy fTI2tcGXcikj.BtJ8rwdbIHbwa3HMH4VXm5P9zUGtzhqHdb+n2NLw1up.eD. 6yqwu8wDnwE -----------end_max5_patcher-----------
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?
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…
"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"
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.
Forums > MaxMSP