Post new topic    
Sound effects affected by 'set music volume (n)' 
 PostWed Jul 31, 2013 12:59 am
Send private message Reply with quote
It used to be that sound effects were not affected by the plotscript, 'set music volume' (around pre-2011 I'd say) but now both sound effects and music is affected by the command, which screws up the parts of Kitty House where the music is muted but sound effects are still needed to play.

Any way to get the old way back, or even a plot script that will affect music and sound effects separately?
Liquid Metal King Slime
Send private message
Re: Sound effects affected by 'set music volume (n)' 
 PostWed Jul 31, 2013 3:51 pm
Send private message Reply with quote
Only One In All wrote:
It used to be that sound effects were not affected by the plotscript, 'set music volume' (around pre-2011 I'd say) but now both sound effects and music is affected by the command, which screws up the parts of Kitty House where the music is muted but sound effects are still needed to play.

Any way to get the old way back, or even a plot script that will affect music and sound effects separately?


This is really a problem with our music backends.

the music_sdl backend keeps separate volume mixers for MIDI and for everything else. We used to only set the midi mixer, which meant that the volume commands were broken for sound effects and for ogg music. In 2010 we changed the music_sdl backend to change the overall volume, so it would work for both types of music. If we change it back to get the old sound effect behaviour, it will break volume support for ogg music.

Meanwhile, the music_native backend has no support for adjusting midi volume at all, so on that backend, volume adjusting commands will adjust ogg music and sound effects, but will have no effect on midi

It sucks, and we need a new music backend, but that is a whole lot of hard work, which is why we have not gotten around to it yet :(

It might be better to mute the song with "stop song", and then re-start it with "play song" after the sound effect.
Metal King Slime
Send private message
 
 PostWed Jul 31, 2013 4:55 pm
Send private message Reply with quote
We do NOT set the volume for sound effects in music_sdl ever. I've just looked through the SDL_mixer source and confirmed that setting the music volume does not affect the sound effects volume.

It turns out that this is actually a bug or purposeful anti-feature in Windows Vista and 7 (and 8 I assume). Other people have devised elaborate workarounds for this bug, or ditched the Windows MIDI synth entirely:
http://www.doomworld.com/vb/source-ports/49379-windows-7-midi-volume/

There is a not-hacky solution, which is to modify the volume on a MIDI note-by-note basis instead of setting the global volume. This requires modifying SDL_mixer (which I'd rather dump instead)

Strangely enough any time we have a problem with SDL_mixer I google it, and some thread at doomworld.com is always the best result. They really know what they're doing, and I'd like to look into borrowing some of their code.
 
 PostWed Jul 31, 2013 6:36 pm
Send private message Reply with quote
Yeah, I was thinking about the possibility I might have to resort to just using stop song. V It would just make the cinematic events more awkward. Would a 'pause song' command of some sort, similar to 'pause sound' work?
Liquid Metal King Slime
Send private message
 
 PostWed Jul 31, 2013 7:04 pm
Send private message Reply with quote
Ah! I stand corrected! I should have tested sound effect volumes myself before I misspoke :)
Metal King Slime
Send private message
 
 PostThu Aug 01, 2013 5:14 am
Send private message Reply with quote
Well funnily enough SDL_mixer's function to pause the song didn't work last time we tried it. That's why we can't have nice things.
 
 PostFri Aug 02, 2013 7:24 pm
Send private message Reply with quote
Just wanted to add, if you change the volume with the command, then play an OGG, the volume change does NOT take effect. You need to play a MIDI in order for it to do so.

I just had a problem with my volume being at 4 when there was a clear plotscript command indicating it should be 255. The OGG played at 4, but when I swapped it out for a MIDI, it played it at 255.
Display posts from previous: