Random Sound Selection

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
staggerlee
Competent
Competent
Posts: 48
Joined: Thu Apr 13, 2006 2:24 am
Location: South Surrey, BC

Random Sound Selection

Post by staggerlee »

Instead of playing one sound e.g. laserhit.ogg - would it be possible to modify the program to select at random one of a series of sounds (laserhit1.ogg, laserhit2.ogg and so on). Each sound could be marginally different (I would happily provide a detailed sound set of my own making). This would make the sounds far more dynamic, realistic and less tiring to the ear.

If anyone wants to do this, I will make you a huge soundset using some professional equipment I have. I was wokring on a basic soundset replacement, but it occurred to me this would be MUCH better.

(I proposed this in simplfied form a while ago, but noone really indicate whether this would be possible)
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

I haven't double checked it, but I think it's in there already:

replacing

Code: Select all

"[player-laser-hit]"			= "laserhits.ogg";
with

Code: Select all

"[player-laser-hit]"			= { "laser1.ogg","laser2.ogg","laser3.ogg"};
should do the trick... :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

....

Post by Lestradae »

Looking forwards to staggerlee's huge new soundset then :wink:
User avatar
staggerlee
Competent
Competent
Posts: 48
Joined: Thu Apr 13, 2006 2:24 am
Location: South Surrey, BC

Post by staggerlee »

Wow.

That'll choose randomly from the laserhits and I can have an unlimited N of different sounds in the brackets?

How do I make an OXP of this? - I can make the soundsets no problem. But I want to be able to make a provisional oxp so I can test it.

Gimme a week or so.

I might even do a couple of themes (minimalist, loud, military, etc)

Has anyone taken advantage of this yet? All the replacement soundsets seem very basic.

Cheers!
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

Never tried hacking a plist before, so maybe it's something I wrong, but I just tried this with a negative result.

plist Excert:

Code: Select all

	"[player-laser-miss]"			= { "laser.ogg","Electrolaser.ogg"};

Log File:
[plist.parse.foundation.failed]: Failed to parse AddOns/Hawksound.oxp/Config/customsounds.plist as a property list using Foundation. Retrying using homebrew parser. WARNING: the homebrew parser is deprecated and will be removed in a future version of Oolite.
Parse failed at line 70 (char 3145) - unexpected character (wanted '=')
[plist.homebrew.parseError]: Property list isn't in XML format, homebrew parser can't help you.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

i don't know what i'm on about, but things like the exhaust list in the shipdata.plist use the round brackets ( and ) instead of the curly ones, eg

Code: Select all

	exhaust = (		
			"10.7601 6.3008 -31.8587  6.3 5.6 9.0",
			"10.7601 6.3008 -31.8587  3.0 3.0 6.0",
			"-10.7601 6.3008 -31.8587 6.3 5.6 9.0",
			"-10.7601 6.3008 -31.8587  3.0 3.0 6.0",
			);
could it be that causing the error?
does this work:

Code: Select all

  "[player-laser-miss]"         = ("laser.ogg", "Electrolaser.ogg");
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Oops! What Griff says! :oops:

Apart from my wrong use of brackets, the option isn't yet there in 1.72.

I'm enabling it now, & will commit the change to trunk asap!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
staggerlee
Competent
Competent
Posts: 48
Joined: Thu Apr 13, 2006 2:24 am
Location: South Surrey, BC

Post by staggerlee »

SIgh.
Let me know when it's ready to go - in the meantime I will release a standard soundset. Do I just release the oggs or is there a fancy way to make an OXP (I have no idea how to make an OXP)

Cheers.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Ok, it now works as expected with lines like

Code: Select all

	"[player-laser-miss]"			= ("[@witchabort]","laser.ogg","boop.ogg");
inside customsounds.plist.
For the time being, you'd have to compile Oolite from source to test the new sound options properly, though: unfortunately there's still quite a lot of bugs that need squashing before we can release 1.73.



staggerlee, all you need for a custom sounds oxp is :

a folder called something like 'newsounds.oxp'. Inside that folder, you need to have two folders, one called 'Sounds', the other called 'Config'. Inside Config you need a file called

'customsounds.plist'

You can copy the customsounds.plist file found inside Resources into your own oxp as a starting point, then put all the new sounds inside your oxp's Sounds folder. Have a look inside the existing sound packs to see what I mean.

PS: if you're on a mac, 'something-or-other.oxp' will look like a file, not a directory. If you display its contents from the context menu you'll be able to use it as a directory again... If it's all a bit too much, you can still package the new sounds & customsounds.plist in a zip file, and I'm sure we can help making it into a 'proper' OXP! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
staggerlee
Competent
Competent
Posts: 48
Joined: Thu Apr 13, 2006 2:24 am
Location: South Surrey, BC

Post by staggerlee »

cool I'll get on it. I'll trust that you guys will release 1.73 soon enough and just make the oxp anyway.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

staggerlee wrote:
cool I'll get on it. I'll trust that you guys will release 1.73 soon enough and just make the oxp anyway.
Depends on how you interpret "soon enough" ;-)
User avatar
staggerlee
Competent
Competent
Posts: 48
Joined: Thu Apr 13, 2006 2:24 am
Location: South Surrey, BC

Post by staggerlee »

another_commander wrote:
staggerlee wrote:
cool I'll get on it. I'll trust that you guys will release 1.73 soon enough and just make the oxp anyway.
Depends on how you interpret "soon enough" ;-)
I'm giving you 3 months after which I will instruct my counsel to sue for breach of contract :wink:
User avatar
staggerlee
Competent
Competent
Posts: 48
Joined: Thu Apr 13, 2006 2:24 am
Location: South Surrey, BC

Post by staggerlee »

Guys.

I have a replacement soundset for the standard sounds. Only problem is afterburner1 - the game loops the sample to make a continuous engine sound, but unless you know the specific loop time it clips and pops at the loop point. How have other sound engineers dealt with this problem?

Otherwise I can upload these sounds for criticism before I make an oxp.

Cheers.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

If IIRC, the afterburner sound starts with a few milliseconds of silence, ramps up smoothly, then ramps down at the same rate to end with a few milliseconds of silence again. Silence + silence doesn't produce any pops!

It's all white/pink noise, so not immediately obvious, but it's basically a pulse...

PS: wow, does it mean you've already got alternate laser sounds, etc? That was quick!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
staggerlee
Competent
Competent
Posts: 48
Joined: Thu Apr 13, 2006 2:24 am
Location: South Surrey, BC

Post by staggerlee »

Laser sounds = basic wave + rapid pitch shift envelope + mild delay + distortion + phaser. Synth that in about 3 minutes.

Explosions take a bit longer - lots of snare drum samples played at various speeds, distorted and patched and reverbed. Maybe 30 mins of tinkering to get a good one.

This is only a basic soundset (i.e. one sound for each event) but I want feedback before I turn it into a dynamic soundset.

Will post in few days after some school work I have to do :)
Post Reply