Oolite Bulletins

For information and discussion about Oolite.
It is currently Sun Feb 24, 2019 1:57 am

All times are UTC




Post new topic  Reply to topic  [ 21 posts ]  Go to page Previous 1 2
Author Message
 Post subject: Re: Music in flight ?
PostPosted: Sat Oct 06, 2018 1:35 pm 
Offline
Mostly Harmless
Mostly Harmless

Joined: Sat Oct 06, 2018 1:27 pm
Posts: 3
Quote:
Quote:
Hmmm... Both Hyperradio and the Orchestral Demo (that's just a demo though) don't make it easy to build your own playlist.
I don't know about Hyperradio, but I can tell you that you you are wrong about Orchestral Demo. I have already built playlists in it for fight and cruising modes. Check its script.js, there is a place there reserved specifically for building such playlists. Granted that it requires file editing to work, but it is most certainly doable.
I know this is an old thread but I'd love some advice on creating playlists in script.js. I downloaded Orchestral Demo and have tried tweaking the script but can't figure out how to get several tracks per event instead of just one. Can anyone help with syntax?


Top
   
 Post subject: Re: Music in flight ?
PostPosted: Sat Oct 06, 2018 1:54 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5352
Hi and welcome. Here is how you can change your playlists for Orchestral Demo by editing script.js inside the OXP's Config folder.

If you open the script file in a text editor, you will find this very close to the top:
Code:
this.startUpComplete = function(){
	delete this.startUpComplete;
	// Add event music
	var a = this.name;
	worldScripts.Lib_Music._addEventMusic({
		aegis:{
			enter:[{snd:"lib_orch_aegis_enter03.ogg",dur:98}]
		},
		alert:{
			red:[{snd:"lib_orch_alert_red06.ogg",dur:106}]
		},
		docked:{
			any:[{snd:"lib_orch_aegis_enter04.ogg",dur:109}]
		},
		exitWS:{
			inter:[{snd:"lib_orch_exitws_inter01.ogg",dur:99}],
			standard:[{snd:"lib_orch_exitws_standard06.ogg",dur:107}]
		},
		killed:{
			any:[{snd:"lib_orch_killed_any01.ogg",dur:51}]
		},
		launch:{
			any:[{snd:"lib_orch_launch_any01.ogg",dur:92}]
		},
		planetIn:{
			enterMain:[{snd:"lib_orch_planet_enter_main01.ogg",dur:65}],
			enterSun:[{snd:"lib_orch_planet_enter_sun02.ogg",dur:92}]
		},
		rescued:{
			any:[{snd:"lib_orch_killed_any01.ogg",dur:51}]
		}
	},a);
The possible events that the OXP responds to are titled aegis, alert, docked, exitWS, killed, launch, planetIn and rescued. Inside each event, you can find the arrays of music files to play for each event, surrounded by '[' and ']'. .To change the playlists, you simply add, remove or change the filenames inside those arrays. For more than one song to choose from for a particular event, you just add music files like in this example:
Code:
rescued:{
	any:[{snd:"lib_orch_killed_any01.ogg",dur:51}, {snd:"mySong01.ogg",dur:100}, {snd:"mySong02.ogg",dur:125}]
}
The number that follows dur: is the duration of the file to play in seconds. Make sure that your song files are inside the OXP's Music folder and you should be good to go.


Top
   
 Post subject: Re: Music in flight ?
PostPosted: Sat Oct 06, 2018 2:35 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Oct 20, 2007 2:52 pm
Posts: 2365
A third option for tracks is available - reduce volume. Range is [0...1].

So
Code:
{snd:"mySong01.ogg",dur:100}
becomes
Code:
{snd:"mySong01.ogg",dur:100, vol:0.7}
This way you can adjust the songs to your needs.

btw: The demo does not use the full range of possibilities. See [EliteWiki] Lib_Music for more.


Top
   
 Post subject: Re: Music in flight ?
PostPosted: Sat Oct 06, 2018 5:03 pm 
Offline
Mostly Harmless
Mostly Harmless

Joined: Sat Oct 06, 2018 1:27 pm
Posts: 3
Quote:
Hi and welcome. Here is how you can change your playlists for Orchestral Demo by editing script.js inside the OXP's Config folder.

If you open the script file in a text editor, you will find this very close to the top:
Code:
this.startUpComplete = function(){
	delete this.startUpComplete;
	// Add event music
	var a = this.name;
	worldScripts.Lib_Music._addEventMusic({
		aegis:{
			enter:[{snd:"lib_orch_aegis_enter03.ogg",dur:98}]
		},
		alert:{
			red:[{snd:"lib_orch_alert_red06.ogg",dur:106}]
		},
		docked:{
			any:[{snd:"lib_orch_aegis_enter04.ogg",dur:109}]
		},
		exitWS:{
			inter:[{snd:"lib_orch_exitws_inter01.ogg",dur:99}],
			standard:[{snd:"lib_orch_exitws_standard06.ogg",dur:107}]
		},
		killed:{
			any:[{snd:"lib_orch_killed_any01.ogg",dur:51}]
		},
		launch:{
			any:[{snd:"lib_orch_launch_any01.ogg",dur:92}]
		},
		planetIn:{
			enterMain:[{snd:"lib_orch_planet_enter_main01.ogg",dur:65}],
			enterSun:[{snd:"lib_orch_planet_enter_sun02.ogg",dur:92}]
		},
		rescued:{
			any:[{snd:"lib_orch_killed_any01.ogg",dur:51}]
		}
	},a);
The possible events that the OXP responds to are titled aegis, alert, docked, exitWS, killed, launch, planetIn and rescued. Inside each event, you can find the arrays of music files to play for each event, surrounded by '[' and ']'. .To change the playlists, you simply add, remove or change the filenames inside those arrays. For more than one song to choose from for a particular event, you just add music files like in this example:
Code:
rescued:{
	any:[{snd:"lib_orch_killed_any01.ogg",dur:51}, {snd:"mySong01.ogg",dur:100}, {snd:"mySong02.ogg",dur:125}]
}
The number that follows dur: is the duration of the file to play in seconds. Make sure that your song files are inside the OXP's Music folder and you should be good to go.
Thanks so much. I nearly figured this out but didn't think to put commas between the entries, I just used new lines.
By the way the demo is already great but it's nice to know how to adapt it. I am a musician so might get around to writing some tracks one day.


Top
   
 Post subject: Re: Music in flight ?
PostPosted: Sat Oct 06, 2018 5:07 pm 
Offline
Mostly Harmless
Mostly Harmless

Joined: Sat Oct 06, 2018 1:27 pm
Posts: 3
Quote:
A third option for tracks is available - reduce volume. Range is [0...1].

So
Code:
{snd:"mySong01.ogg",dur:100}
becomes
Code:
{snd:"mySong01.ogg",dur:100, vol:0.7}
This way you can adjust the songs to your needs.

btw: The demo does not use the full range of possibilities. See [EliteWiki] Lib_Music for more.

Thanks svengali, and thanks for creating this! I did read the wiki entry but I struggled to translate it into practice. I just find it much easier when I can see a full example and adapt.


Top
   
 Post subject: Re: Music in flight ?
PostPosted: Sun Oct 07, 2018 11:05 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Oct 20, 2007 2:52 pm
Posts: 2365
Quote:
I am a musician so might get around to writing some tracks one day.
Musician, eh? Welcome to the club .-)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 21 posts ]  Go to page Previous 1 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited