Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Sound Modifiers
- - By Sven2 [us] Date 2015-08-28 04:13
I've just committed sound modifier functionality. For a quick tryout, you can e.g. start a scenario, enable debug mode (Ctrl+F5) and apply a modifier to all sounds:

/script SetGlobalSoundModifier(Ambience.CaveModifier)

Full documentation on how to use the modifiers is in the repository, in docs/sdk/script/SoundModifiers.xml

There is also echo (to be used for big caves) and equalizer (to be used for underwater sound modulation). Unfortunately, the autobuilds don't support the equalizer effect due to an old version of OpenAL, which will hopefully be updated when the next Debian stable is out, i.e. in about 18 months (Isilkor). Until then, you can:
* Linux: Compile yourself with OpenAL_soft 1.16 or greater
* Windows: Just download the snapshot and download a current OpenAL soft binary from here: http://kcat.strangesoft.net/openal-soft-1.16.0-bin.zip - unpack the zip and rename oal_soft.dll (32 bit or 64 bit depending on which snapshot you downloaded) to OpenAL32.dll and put it into your Snapshot folder. The DLLs are compatible so just replacing that DLL should make the equalizer work.

If all effects are loaded, the OpenClonk.log file will contain a line like:
OpenAL extensions loaded. ON: 1, 4, 12. OFF: .
For old OpenAL32.dll, the line will look like:
OpenAL extensions loaded. ON: 1, 4. OFF: 12 (invalid parameter).
in that case, equalizer is unavailable.

Please let me if it works :-)

Btw, the mac autobuilds fail now:
/var/cache/ocbuild/source/src/platform/C4SoundIncludes.h:35:12: fatal error: 'OpenAL/alext.h' file not found

It's probably just missing a file in the dependencies (that I hope exists for mac?). Could someone add that?
Parent - - By Isilkor Date 2015-08-28 09:13 Edited 2015-08-28 09:24

> Btw, the mac autobuilds fail now:
> /var/cache/ocbuild/source/src/platform/C4SoundIncludes.h:35:12: fatal error: 'OpenAL/alext.h' file not found


Yeah you just include <alext.h>, just like the non-extension header we're including is just <al.h>.

E: Apparently we're using the OpenAL framework that ships with OS X for al.h. Idk maybe I've compiled openal-soft for OS X separately, but I don't think I did? Either way, you should be able to find <alext.h> if you don't specify a path. Should probably check for it with CMake though.
EE: Ok looks like I did compile openal-soft for OS X. Just use that and kick Mortimer in the butt at some point for adding hard-coded paths for Apple everywhere instead of doing things like a reasonable person and make CMake handle that stuff. Also make CMake handle that stuff.
Reply
Parent - - By Sven2 [us] Date 2015-08-28 16:00
So I just change OpenAL/alext.h to alext.h?

But the original line in sound includes was:
#      ifdef __APPLE__
#              include <OpenAL/al.h>


So where is al.h now? Should I remove the OpenAL/ from that as well? Are al.h and alext.h in different folders?
Parent - - By Isilkor Date 2015-08-28 19:58
(On the build slaves,) al.h is both in $SYSROOT/usr/include/AL/ (because openal-soft is installed) and $SYSROOT/System/Library/Frameworks/OpenAL.framework/Headers/. alext.h only exists in the former. You should make CMake look for both al.h and alext.h and add their paths to the include path, and just include <al.h> and <alext.h> without any folder names.
Reply
Parent - By Sven2 [us] Date 2015-08-29 01:18 Edited 2015-08-29 01:20
Done.

CMake now looks for alext.h and uses that as include path. If alext.h is not found, it looks for al.h and uses that and disables sound modifiers. Let's see if all compilers are happy now.
Parent - - By Pyrit Date 2015-10-02 21:32
/script SetGlobalSoundModifier(Ambience.CaveModifier)

Works for me, but the effect is so subtle, it's practically unhearable...
Parent - By Sven2 [us] Date 2015-10-02 21:38
The newest version should have it activated by default when you're underground.

Hm I found it OK and got positive feedback. Remember you hear this effect pretty much 50% of the time in a typical clonk round because most action happens underground. So it shouldn't be too strong.

For your glacier scenario you may want to create a custom reverb effect that's more ice-cave-like instead. You can also try the Echo modifier!

Remember to turn off the normal Ambience controller (overload InitializeAmbience in the scenario). Otherwise, it will always reset the global modifier.
Up Topic Development / Developer's Corner / Sound Modifiers

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill