New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the sound volume configuration scale/span #14696

Open
netnazgul opened this Issue Jan 8, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@netnazgul
Contributor

netnazgul commented Jan 8, 2018

I noticed long ago that the default supposedly 50% loudness setting for sound/music/video is insanely loud already. I never use values greater than ~20% of that slider, and while streaming something as much as 10 pixels of the slider is loud enough (checked in settings.yaml, that's ~3%). Seen the same behaviour for other people on streams (FiveAces, SoScared).

To make the control slider more useful across the whole span of it I suggest applying an exponential coefficient to its value, so that 100% will still be 100%, but the current 10% of the volume setting will have a better degree of control.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Jan 8, 2018

Member

👍 Human sound perception is logarithmic, so using a linear volume scale is completely wrong.

Member

pchote commented Jan 8, 2018

👍 Human sound perception is logarithmic, so using a linear volume scale is completely wrong.

@netnazgul

This comment has been minimized.

Show comment
Hide comment
@netnazgul

netnazgul Jan 9, 2018

Contributor

Well, it's not that easy there, as on a second thought this could be also an OS/soundcard issue as well. I saw at Abarrat's stream that he has volume set at ~50% and had the game running as loud as I would have at 10. But still expo scale should not break neither setting.

I'll try to look into it today or tomorrow, maybe it will be an easy task to do even for me :P

Contributor

netnazgul commented Jan 9, 2018

Well, it's not that easy there, as on a second thought this could be also an OS/soundcard issue as well. I saw at Abarrat's stream that he has volume set at ~50% and had the game running as loud as I would have at 10. But still expo scale should not break neither setting.

I'll try to look into it today or tomorrow, maybe it will be an easy task to do even for me :P

@netnazgul

This comment has been minimized.

Show comment
Hide comment
@netnazgul

netnazgul Jan 9, 2018

Contributor

Preliminary code inspection shows, that there could be 2 approaches onto the task.

  1. The harder route if we want to preserve the values already applied from the settings and only change the way slider works with the value. There are a lot of generic ties between SliderWidget and sound volume values around, so modifying that would be a bit problematic, probably requiring to implement a new kind of slider that works in logarithmic scale instead of linear.
    Although maybe not that hard, just need to inherit ExpSliderWidget from SliderWidget and override ValueFromPx and PxFromValue and then change sliders for volume settings from SliderWidget to ExpSliderWidget.
  2. The easier route is to apply the modifier somewhere in SoundEngine itself. I don't know yet how dirty that could be, and due to this change all custom settings set by users will need to be corrected and also new default value to be applied.
Contributor

netnazgul commented Jan 9, 2018

Preliminary code inspection shows, that there could be 2 approaches onto the task.

  1. The harder route if we want to preserve the values already applied from the settings and only change the way slider works with the value. There are a lot of generic ties between SliderWidget and sound volume values around, so modifying that would be a bit problematic, probably requiring to implement a new kind of slider that works in logarithmic scale instead of linear.
    Although maybe not that hard, just need to inherit ExpSliderWidget from SliderWidget and override ValueFromPx and PxFromValue and then change sliders for volume settings from SliderWidget to ExpSliderWidget.
  2. The easier route is to apply the modifier somewhere in SoundEngine itself. I don't know yet how dirty that could be, and due to this change all custom settings set by users will need to be corrected and also new default value to be applied.

@abcdefg30 abcdefg30 added the Audio label Jan 9, 2018

@netnazgul

This comment has been minimized.

Show comment
Hide comment
@netnazgul

netnazgul Jan 9, 2018

Contributor

Tried to implement the first option, looks too dirty to me. The modification itself works to some extent though - at least now it is possible to configure the sound in a wider range of thumb movement.
netnazgul@735927c

Probably implementing the second option would be a better way to go, though I don't yet get the exact points of intrusion there.

Contributor

netnazgul commented Jan 9, 2018

Tried to implement the first option, looks too dirty to me. The modification itself works to some extent though - at least now it is possible to configure the sound in a wider range of thumb movement.
netnazgul@735927c

Probably implementing the second option would be a better way to go, though I don't yet get the exact points of intrusion there.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Jan 9, 2018

Member

The simplest (and probably cleanest) option is to keep the setting linear and apply the log transform immediately before setting Game.Sounds.*Volume.

Member

pchote commented Jan 9, 2018

The simplest (and probably cleanest) option is to keep the setting linear and apply the log transform immediately before setting Game.Sounds.*Volume.

@netnazgul

This comment has been minimized.

Show comment
Hide comment
@netnazgul

netnazgul Jan 10, 2018

Contributor

yes, that's the second option I've mentioned. It's just there are quite a lot of places where it seems to be applied. Also for setting-to-volume it's exp (or rather power) transform, not log, as we are trying to expand the lower part of the setting.

Contributor

netnazgul commented Jan 10, 2018

yes, that's the second option I've mentioned. It's just there are quite a lot of places where it seems to be applied. Also for setting-to-volume it's exp (or rather power) transform, not log, as we are trying to expand the lower part of the setting.

@netnazgul

This comment has been minimized.

Show comment
Hide comment
@netnazgul

netnazgul Jan 10, 2018

Contributor

apply the log transform immediately before setting Game.Sounds.*Volume

It will still require 2-way transform (reading the setting to set the thumb position / storing the thumb position to setting), and this is done directly via binding the OnChange and Value attributes of SliderWidget to corresponding settings, I don't think you can modify it right there.
But applying the transform right before Game.Sounds.*Volume is used is what I'm planning to try next - means modifying either Sound.cs interface or OpenAlSoundEngine.cs.

Slight issue with this is that the same value in settings.yaml will correspond to different loudness in different OpenRA versions. That's why I've thought making a different slider would be better.

Contributor

netnazgul commented Jan 10, 2018

apply the log transform immediately before setting Game.Sounds.*Volume

It will still require 2-way transform (reading the setting to set the thumb position / storing the thumb position to setting), and this is done directly via binding the OnChange and Value attributes of SliderWidget to corresponding settings, I don't think you can modify it right there.
But applying the transform right before Game.Sounds.*Volume is used is what I'm planning to try next - means modifying either Sound.cs interface or OpenAlSoundEngine.cs.

Slight issue with this is that the same value in settings.yaml will correspond to different loudness in different OpenRA versions. That's why I've thought making a different slider would be better.

@netnazgul

This comment has been minimized.

Show comment
Hide comment
@netnazgul

netnazgul Jan 10, 2018

Contributor

netnazgul@2c1690b the way it can be done directly near the engine.
Stored sound volume values are the same between versions, but the way they are applied are now different (new version will be more quiet on the new version), so the values will need to be updated. 100% slider value is still the same in both versions, the scaling is just a square value.
image

Contributor

netnazgul commented Jan 10, 2018

netnazgul@2c1690b the way it can be done directly near the engine.
Stored sound volume values are the same between versions, but the way they are applied are now different (new version will be more quiet on the new version), so the values will need to be updated. 100% slider value is still the same in both versions, the scaling is just a square value.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment