logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
pm  
#1 Posted : Friday, February 3, 2017 3:57:22 PM(UTC)
pm

Rank: Advanced Member

Groups: Registered
Joined: 11/28/2015(UTC)
Posts: 182

Thanks: 10 times
Was thanked: 32 time(s) in 27 post(s)
Hi

I try to set the audio volume thru API.

If I set a value of 50, then the slider moves to 50%. The XML status reports a value of 6.25
If I set a value of 75, then the slider moves to 75%. The XML status reports a value of 31.6

My final goal is to have a script which reads out current volume, set volume to 0 and fade in until the saved value is reached. But because there are different scales it's not that easy.

So it seems there is some math in between. How is the scale handled in XML status?

Regards,
Patrick
doggy  
#2 Posted : Friday, February 3, 2017 4:48:36 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,084
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
not audio expert but googled and already found this
http://www.robotplanet.d...ert.php?db=0&pct=100
DWAM  
#3 Posted : Friday, February 3, 2017 5:29:53 PM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
I was intrigued by your post so I dropped an eye on it by curiosity.

When I move the audio fader by hand in vMix, first I see that they are logarithmic. Meaning putting the fader half-way doesn't mean reducing the volume by half. If one puts his mouse over the fader, it shows the percentage.

So I put the fader at 50% (which is close to the top) and check with the API. XML value is 49.756 (close to 50%)
Do the same for 25% > XML shows 24.951
Do the same for 0 > XML shows 0

So I think XML is working as one expects. There is no math to do...

Guillaume
doggy  
#4 Posted : Friday, February 3, 2017 5:45:01 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,084
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
@DWAM

is as you describe when using the slider but not when you use the percentage values in a shortcut , then you get what PM wrote
pm  
#5 Posted : Friday, February 3, 2017 5:45:07 PM(UTC)
pm

Rank: Advanced Member

Groups: Registered
Joined: 11/28/2015(UTC)
Posts: 182

Thanks: 10 times
Was thanked: 32 time(s) in 27 post(s)
Guillaume, thanks for verifying.

That's right. If you move the fader by hand to 50% (accoring mouse over information), the XML value ist approx. 50.

But if you set the volume with SetVolume and value 50, the slider moves to the middle of the fader. Same for value 25, the slider moves to 1/4 of fader position.

Patrick
xaver  
#6 Posted : Thursday, August 17, 2017 8:34:14 AM(UTC)
xaver

Rank: Advanced Member

Groups: Registered
Joined: 11/11/2016(UTC)
Posts: 378
Man
Location: Europe

Thanks: 23 times
Was thanked: 38 time(s) in 32 post(s)
pm wrote:
Guillaume, thanks for verifying.

That's right. If you move the fader by hand to 50% (accoring mouse over information), the XML value ist approx. 50.

But if you set the volume with SetVolume and value 50, the slider moves to the middle of the fader. Same for value 25, the slider moves to 1/4 of fader position.

Patrick

Hi Patrick

did you found the solution?
same problem here
IF setvolume to 70
XLM says 24.01
pm  
#7 Posted : Friday, August 18, 2017 4:56:03 PM(UTC)
pm

Rank: Advanced Member

Groups: Registered
Joined: 11/28/2015(UTC)
Posts: 182

Thanks: 10 times
Was thanked: 32 time(s) in 27 post(s)
No, never found a solution for that. Couldn't finish my audio fadein script because of this behaviour.
pm  
#8 Posted : Tuesday, September 26, 2017 4:44:38 AM(UTC)
pm

Rank: Advanced Member

Groups: Registered
Joined: 11/28/2015(UTC)
Posts: 182

Thanks: 10 times
Was thanked: 32 time(s) in 27 post(s)
Sorry, have to bump my post.

My audio fade script is still in an unfinished state, because XML value, mouse over info and SetVolume function behaviour don't match.

Is there a chance to get this solved?

Regards,
Patrick
admin  
#9 Posted : Tuesday, September 26, 2017 4:53:57 AM(UTC)
admin

Rank: Administration

Groups: Administrators
Joined: 1/13/2010(UTC)
Posts: 5,156
Man
Location: Gold Coast, Australia

Was thanked: 4159 time(s) in 1494 post(s)
The Volume level in vMix is linked to amplitude and scales with the following formula:

Volume = 0 to 100 (used for UI volume bars)
Amplitude = 0 to 1 (used for API Meter and Volume values)
Decibels = 0 dB to -infinity

Volume = (Amplitude ^ 0.25) * 100
Amplitude = (Volume / 100) ^ 4

Example
VolumeBar = 50
Amplitude = 0.0625
MeterF = 0.0625
VolumeXML = 6.25

I will leave converting amplitude to decibels as an exercise to the reader.

Regards,

Martin
vMix

P.S meter values in XML are in Amplitude 0-1, while volume values in XML are in Amplitude 0-100
thanks 4 users thanked admin for this useful post.
DWAM on 9/26/2017(UTC), doggy on 9/26/2017(UTC), pm on 9/26/2017(UTC), stigaard on 9/26/2017(UTC)
stigaard  
#10 Posted : Wednesday, April 15, 2020 9:50:04 PM(UTC)
stigaard

Rank: Advanced Member

Groups: Registered
Joined: 5/20/2015(UTC)
Posts: 493
Man
Denmark
Location: Copenhagen, Denmark

Thanks: 382 times
Was thanked: 100 time(s) in 79 post(s)
Originally Posted by: admin Go to Quoted Post
I will leave converting amplitude to decibels as an exercise to the reader.


Perhaps this can be used to calculate dB... http://msp.ucsd.edu/tech....08/book-html/node6.html

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.