Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Questions about making an audio OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Questions about making an audio OXP

Post by Corny »

Hey there,
while my previous attempt to make an audio OXP resulted in letting other people do the work and then acting like a diva for not getting 1000+ instantly and therefore not finishing my own version, I'd like do it properly this time. :)
However, I'm lacking the answers for the questions "what's scriptable" and "how to script that". One of the main problems I had with making the Crew Sound Pack was that I couldn't get it done that the same event wouldn't be triggered before the sound file of the first even finished playing, which was a bit unfortunate. However, this seems to be possible somehow, at least the sound for scooping works properly in the BGS.

For example, sounds I'd like to make would be different engine sounds for different ships and different conditions. A Ferdy should be much quieter than a Python, and an Anaconda should sound more calm and majestic than an Adder (in my opinion, that is). Also, I'd like to include different engine sounds for damaged or unmaintained ships. Would that be scriptable?
Oh, and higher speed should result in a faster (more high-pitched) engine, but I think Oolite itself can't pitch, right?

Also, as far as I know, Oolite itself can't fade, is that right? iTunes can, but it only does if it's the next item on a playlist, so that wouldn't apply to Oolite starting another song (e.g. transition between condition green and condition red). Plus, it'd be a Mac-only feature.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Questions about making an audio OXP

Post by Svengali »

Corny wrote:
For example, sounds I'd like to make would be different engine sounds for different ships and different conditions. A Ferdy should be much quieter than a Python, and an Anaconda should sound more calm and majestic than an Adder (in my opinion, that is).
With BGS it is already possible to use a different set of sounds by simply adding script_info keys in shipdata.plist.

Code: Select all

script_info = {"bgs_engine" = "myEngine.ogg"; "bgs_engineUp" = "myEngineUp.ogg"; "bgs_engineDown" = "myEngineDown.ogg";};
Corny wrote:
Also, I'd like to include different engine sounds for damaged or unmaintained ships. Would that be scriptable? Oh, and higher speed should result in a faster (more high-pitched) engine, but I think Oolite itself can't pitch, right?

Also, as far as I know, Oolite itself can't fade, is that right? iTunes can, but it only does if it's the next item on a playlist, so that wouldn't apply to Oolite starting another song (e.g. transition between condition green and condition red). Plus, it'd be a Mac-only feature.
Yep - no pitch, no fades, no volume control. Switching sounds on the fly may result in a somewhat annoying gap. And without a smooth transition between sounds it won't work well.
User avatar
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Re: Questions about making an audio OXP

Post by Corny »

Oh, nice! I didn't know that. That does work as a separate oxp, right? So I could make a ship engines-OXP with only the script_info for each ship in the .plist, and it plays nicely with the shipdata.plists of other OXPs?
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Questions about making an audio OXP

Post by Svengali »

Corny wrote:
Oh, nice! I didn't know that. That does work as a separate oxp, right? So I could make a ship engines-OXP with only the script_info for each ship in the .plist, and it plays nicely with the shipdata.plists of other OXPs?
No. It's a bit more complicated, because script_info entries in shipdata.plist are not merged together, they are overriding each other.
Using it via like_ship or shipdata-overrides.plist is no option, because it may discard existing script_info entries.
And the scriptInfo is read-only, so you can't expand/change it via script.

The option in BGS was added specifically for ship creators. To make it more flexible BGS could check if a playership has script properties with the same name (bgs_engine, bgs_engineUp, bgs_engineDown).
User avatar
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Re: Questions about making an audio OXP

Post by Corny »

Svengali wrote:
The option in BGS was added specifically for ship creators. To make it more flexible BGS could check if a playership has script properties with the same name (bgs_engine, bgs_engineUp, bgs_engineDown).
Does that mean BGS can do that already and I have to tell it to, or that it will be able to do that in the future?
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Questions about making an audio OXP

Post by Svengali »

Corny wrote:
Does that mean BGS can do that already and I have to tell it to, or that it will be able to do that in the future?
Yes, BGS reads the script_info keys since it was released in 2010.
I'll add the checks for properties for the next version.
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Re: Questions about making an audio OXP

Post by pagroove »

Svengali answered a lot of questions already. BGS was indead designed around the principle that it is modular. A plan I had was to make different engine sounds. However looping is tricky so you have to use a good sound editor for it. I use Soundforge but there are tons of audio editors out there.

For making sounds I use various forms/blends of sampling an synthesizers.

The output format of your sound has to be in .ogg. If your source material is in .wav then you can convert it to .ogg with programs such as (win)lame.
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Re: Questions about making an audio OXP

Post by Corny »

Thanks for the tips, pagroove. I'm working with Logic Pro 9, so I guess I have enough synthies to work with already.
For converting, I use Max, which can convert from and to every audio format I've ever heard of - plus a few more. Did I mention it's free and open source?
If anyone is looking for tools, be aware that both of these softwares are mac-only.
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Re: Questions about making an audio OXP

Post by pagroove »

For engine sounds a noise generator always comes in handy. If you got a synth with more oscillators then you can provide a low sine on osc1 and a noise generator on osc2 and then blend the sounds. Making sounds at different pitch already gives more variety in engine sounds.

When making sounds it always comes in handy to read about synthesis. :).
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
Paradox
---- E L I T E ----
---- E L I T E ----
Posts: 607
Joined: Wed Feb 20, 2013 1:24 am
Location: Aboard the D.T.T Snake Charmer: My Xanadu
Contact:

Re: Questions about making an audio OXP

Post by Paradox »

Svengali wrote:
With BGS it is already possible to use a different set of sounds by simply adding script_info keys in shipdata.plist.

Code: Select all

script_info = {"bgs_engine" = "myEngine.ogg"; "bgs_engineUp" = "myEngineUp.ogg"; "bgs_engineDown" = "myEngineDown.ogg";};
Where do I need to put the sound (.ogg) files when I am setting this up?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Questions about making an audio OXP

Post by Commander McLane »

Paradox wrote:
Svengali wrote:
With BGS it is already possible to use a different set of sounds by simply adding script_info keys in shipdata.plist.

Code: Select all

script_info = {"bgs_engine" = "myEngine.ogg"; "bgs_engineUp" = "myEngineUp.ogg"; "bgs_engineDown" = "myEngineDown.ogg";};
Where do I need to put the sound (.ogg) files when I am setting this up?
In a folder named "Sounds" in your OXP.
User avatar
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Re: Questions about making an audio OXP

Post by Corny »

Can I influence if a sound is looped? Is the length of a clip fixed?
E.g. I noticed that there's the clip in the BGS that says "scoop active", but it would always start the next loop after "scoop" already, so you hear the "...active" only when the scoop is actually no longer active. So... just making sure, the answers are "No" and "Yes" respectively?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Questions about making an audio OXP

Post by JensAyton »

Corny wrote:
Can I influence if a sound is looped? Is the length of a clip fixed?
E.g. I noticed that there's the clip in the BGS that says "scoop active", but it would always start the next loop after "scoop" already, so you hear the "...active" only when the scoop is actually no longer active. So... just making sure, the answers are "No" and "Yes" respectively?
You can loop a sound by using the loop or repeatCount property of SoundSource.

The length of a clip is the length of the sound file.

You can play multiple overlapping copies of a sound using multiple sound sources playing the same sound. The BGS scoop case is happening because only one sound source is used for that sound, which is played periodically, and the sound provided is way too long.
User avatar
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Re: Questions about making an audio OXP

Post by Corny »

Ah, that's awesome, thanks! I don't really get the length issue, though.
The length of the clip is the length of the sound file, but still the scoop-sound is too long...? How can it be too long if the length of the sound file defines the length of the clip? Or is it just the scooping interval (which calls the sound again) which is fixed?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Questions about making an audio OXP

Post by JensAyton »

For scooping in particular, the sound is played at a fixed interval using a single sound source.
Post Reply