audio feedback for UI elements #61

Closed
opened 2021-07-18 01:43:00 +00:00 by coolestskinnieinthejungle · 15 comments

pretty self explanatory: sounds / audio cues for certain UI elements, including but not limited to:

  • ui button clicks and or hovers
  • notification/top left menu popup

@mapanon has some awesome sound fx prepared for this already, just needs to be programmed in. will upload the sounds in the following post.

pretty self explanatory: sounds / audio cues for certain UI elements, including but not limited to: * ui button clicks and or hovers * notification/top left menu popup @mapanon has some awesome sound fx prepared for this already, just needs to be programmed in. will upload the sounds in the following post.
coolestskinnieinthejungle added this to the Patchy-Patch5.1.1 milestone 2021-07-18 01:43:00 +00:00
coolestskinnieinthejungle added the
Low Priority
label 2021-07-18 01:43:00 +00:00
No description provided.
Member

Note that these sounds and how I named them are absolutely flexible, use them however you see fit. If you need more sounds or revisions to those sounds, ask away.

Note that these sounds and how I named them are absolutely flexible, use them however you see fit. If you need more sounds or revisions to those sounds, ask away.
Member

While I appreciate the sounds, I am not sure if we need them. The menu music is so good that a ui sound would feel a bit jarring.
I am happy to jump on this and start working on it if the "head honchos" decide we need them.

While I appreciate the sounds, I am not sure if we need them. The menu music is so good that a ui sound would feel a bit jarring. I am happy to jump on this and start working on it if the "head honchos" decide we need them.
Member

Kind of what I feel too. I just conceptualized them and asked them if this was alright to put in and they said yes, so I figure if they don't work they can always be stubbed out later or replaced with silence.

Kind of what I feel too. I just conceptualized them and asked them if this was alright to put in and they said yes, so I figure if they don't work they can always be stubbed out later or replaced with silence.
Member

In my fork, I added the sounds for the UI. I used uiClick for most stuff, with the exception of the Update functions (request, fail and success).
I wanted them to go on a separate channel, but apparently you can't have that with buttons. Or at least I could not find a way in the docs, so they are currently piggibacking on sounds (and the volume control is there too).
Have a look - and if anyone knows more about channels + buttons please enlighten me. Aside from custom functions, I can't see an official way of doing this. If we need to separate out the volume control for these ui sounds at all, that is.

In my fork, I added the sounds for the UI. I used uiClick for most stuff, with the exception of the Update functions (request, fail and success). I wanted them to go on a separate channel, but apparently you can't have that with buttons. Or at least I could not find a way in the docs, so they are currently piggibacking on sounds (and the volume control is there too). Have a look - and if anyone knows more about channels + buttons please enlighten me. Aside from custom functions, I can't see an official way of doing this. If we need to separate out the volume control for these ui sounds at all, that is.
Member

Have a look - and if anyone knows more about channels + buttons please enlighten me. Aside from custom functions, I can't see an official way of doing this. If we need to separate out the volume control for these ui sounds at all, that is.

@Nio Chuck it into voice

define config.has_voice = True

define config.play_channel = "voice"
> Have a look - and if anyone knows more about channels + buttons please enlighten me. Aside from custom functions, I can't see an official way of doing this. If we need to separate out the volume control for these ui sounds at all, that is. @Nio Chuck it into voice ``` define config.has_voice = True define config.play_channel = "voice" ```
Member

@Nio Chuck it into voice

define config.has_voice = True

define config.play_channel = "voice"

Happy to do this, though I'm not sure if it will solve the issue of not having fine control over the volume of the UI sounds specifically as the issue is I can't see where the sound played by the button is actually assigned to a channel. I think that it is assigned to the sounds channel by default and there is no built-in renpy way of assigning it to a different channel (hence I mentioned a hack could do it potentially, but it will likely not be pretty).

> @Nio Chuck it into voice > ``` > define config.has_voice = True > > define config.play_channel = "voice" > ``` Happy to do this, though I'm not sure if it will solve the issue of not having fine control over the volume of the UI sounds specifically as the issue is I can't see where the sound played by the button is actually assigned to a channel. I think that it is assigned to the sounds channel by default and there is no built-in renpy way of assigning it to a different channel (hence I mentioned a hack could do it potentially, but it will likely not be pretty).
Member

I was originally going to replace uiClick with something else, but my attempts didn't feel as correct as with the OG uiClick. You can have my attempts and use them if you want.
What I am replacing is uiNotification, just to remove the little click that's in it.

I was originally going to replace uiClick with something else, but my attempts didn't feel as correct as with the OG uiClick. You can have my attempts and use them if you want. What I am replacing is uiNotification, just to remove the little click that's in it.
coolestskinnieinthejungle modified the milestone from Patchy-Patch5.1.1 to Monster-Update-6 2021-07-21 17:43:27 +00:00

(low prio + dont want to rush this so i'm moving to back to update-6 for now)

(low prio + dont want to rush this so i'm moving to back to update-6 for now)
Member

Do we need to go down the custom function route for this one or is it OK as is? Not entire sure what other sounds use the "sounds" channel.
If we go down the alternate route, my current understanding is that we need to have a separate channel for the UI sounds, separate control slider and a custom function to add as an action to all buttons (so that it ties the right channel to it). I can do all that, but I would like to know if we are going for that or if how it is currently implemented in my fork fits what we need just fine.

Do we need to go down the custom function route for this one or is it OK as is? Not entire sure what other sounds use the "sounds" channel. If we go down the alternate route, my current understanding is that we need to have a separate channel for the UI sounds, separate control slider and a custom function to add as an action to all buttons (so that it ties the right channel to it). I can do all that, but I would like to know if we are going for that or if how it is currently implemented in my fork fits what we need just fine.
Member

Do we need to go down the custom function route for this one or is it OK as is? Not entire sure what other sounds use the "sounds" channel.

@Nio, as I said before, you can set the hover sounds into 'voice'

define config.play_channel = "audio"
    The name of the audio channel used by renpy.play(), hover_sound, and activate_sound.

there are actually multiple channels that aren't listed (or easy to find documenation on) but few mixers (sound, music, voice, audio)
so you could make a new channel + put it into different mixer altogether
renpy.music.register_channel(name, mixer=None, loop=None ..

> Do we need to go down the custom function route for this one or is it OK as is? Not entire sure what other sounds use the "sounds" channel. @Nio, as I said before, you can set the hover sounds into 'voice' ``` define config.play_channel = "audio" The name of the audio channel used by renpy.play(), hover_sound, and activate_sound. ``` there are actually multiple channels that aren't listed (or easy to find documenation on) but few mixers (sound, music, voice, audio) so you could make a new channel + put it into different mixer altogether `renpy.music.register_channel(name, mixer=None, loop=None ..`
Member
define config.play_channel = "audio"
    The name of the audio channel used by renpy.play(), hover_sound, and activate_sound.

Ah OK, this was the missing bit. Will do this then, thanks.

> ``` > define config.play_channel = "audio" > The name of the audio channel used by renpy.play(), hover_sound, and activate_sound. > ``` Ah OK, this was the missing bit. Will do this then, thanks.
Member

This is ready for inspection in my fork. I have put it on the voice mixer, in a new channel called 'uisounds' .

The docos are hinting at there being a way to register a new mixer, I think. But I couldn't get any further info on it yet. Starting to think that this is a running theme with Renpy (or maybe I just haven't found the better sources yet).

EDIT: If anyone was looking, sorry, I forgot to push... It is really in there now.

This is ready for inspection in my fork. I have put it on the voice mixer, in a new channel called 'uisounds' . The docos are hinting at there being a way to register a new mixer, I think. But I couldn't get any further info on it yet. Starting to think that this is a running theme with Renpy (or maybe I just haven't found the better sources yet). EDIT: If anyone was looking, sorry, I forgot to push... It is really in there now.
Member

The docos are hinting at there being a way to register a new mixer, I think. But I couldn't get any further info on it yet. Starting to think that this is a running theme with Renpy (or maybe I just haven't found the better sources yet).

@Nio, You can't directly register mixers but when it creates all of the mixers it looks into the registered channels' mixers.
renpy/audio/audio.py

def init():
    ...
    
    # Find all of the mixers in the game.
    mixers = [ ]

    for c in all_channels:
        if c.mixer not in mixers:
            mixers.append(c.mixer)
    ...
    

so all you really have to do is

init -1 python:
    renpy.music.register_channel("uisounds", "ui", loop=False, stop_on_mute=True)

The only thing left after doing some of the changes and the prefrences UI is to merge with the MU6 branch, briefly looking at your repo.

> The docos are hinting at there being a way to register a new mixer, I think. But I couldn't get any further info on it yet. Starting to think that this is a running theme with Renpy (or maybe I just haven't found the better sources yet). @Nio, You can't directly register mixers but when it creates all of the mixers it looks into the registered channels' mixers. `renpy/audio/audio.py` ``` def init(): ... # Find all of the mixers in the game. mixers = [ ] for c in all_channels: if c.mixer not in mixers: mixers.append(c.mixer) ... ``` so all you really have to do is ``` init -1 python: renpy.music.register_channel("uisounds", "ui", loop=False, stop_on_mute=True) ``` The only thing left after doing some of the changes and the prefrences UI is to merge with the MU6 branch, briefly looking at your repo.
Member
so all you really have to do is

init -1 python:
renpy.music.register_channel("uisounds", "ui", loop=False, stop_on_mute=True)


The only thing left after doing some of the changes and the prefrences UI is to merge with the MU6 branch, briefly looking at your repo.

Thanks, I've added this to my fork.

I need to get into the habit of looking into the renpy code for the nitty-gritty.

> ``` > so all you really have to do is > ``` > init -1 python: > renpy.music.register_channel("uisounds", "ui", loop=False, stop_on_mute=True) > ``` > > The only thing left after doing some of the changes and the prefrences UI is to merge with the MU6 branch, briefly looking at your repo. Thanks, I've added this to my fork. I need to get into the habit of looking into the renpy code for the nitty-gritty.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Cavemanon/SnootGame#61
No description provided.