-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add global Audio Volume setting to REPL #1166
base: main
Are you sure you want to change the base?
Conversation
Allows for adjusting the global volume/gain of the REPL. Set default global value to 50%. Acts similarily to `gain()`, but without modifying the code, so passerbys who don't know how to use the tool can adjust the volume too). The volume slider uses a logarithmic scale, so it adjusts better to human sound perception.
Awesome, I've been finding 50% works well for me as well.. |
The recently merged PR #1160 added an 'audio engine target' option. The audio volume slider doesn't have any effect when the 'osc' option is selected. Would it be possible to hide or grey out the audio volume slider when webaudio isn't selected? I don't think it would make too much sense to have the slider change the gain control or something like that, as it would need a different default to match superdirt (probably 1). |
…correctly when step < 1 If we keep flooring the value, but have a step of, e.g., 0.1, then we are never going to reach the next whole number value. This applies specifically to the Audio Volume slider.
This is a bit overkill, but this way we can somewhat adjust the width of the input so no symbols are cut off (either by the input being too small, or the up/down arrows from the browser). I am not happy about having to use `calc()` with some magic numbers either, but this is what looked nicest to me and had the least effort.
This ensures the audio volume is synced across tabs, since changing the volume in one tab would retrigger the effect in the other tabs. It also means we can remove the explicit call to `setGlobalAudioVolume()` from <SettingsTab>
Got a few suggestions from Discord (namely, the new algorithm to calculate resulting gain), as well as a couple things I found while retesting. |
Allows for adjusting the global volume/gain of the REPL. Set default global value to 50%.
gain()
, but without modifying the code.I also wanted to add a volume slider to the MiniRepl. But because multiple MiniRepl's can be on a page at the same time, while this setting is global, really makes it hard to implement.