Page 1 of 3

Change music?

PostPosted: Fri May 23, 2014 2:27 am
by fstltna
Hi, how can i change the music on my server?

Re: Change music?

PostPosted: Fri May 23, 2014 1:15 pm
by lugdunon
Hi there!

Are you wanting to add your own music, or change the tracks that currently are available in a given instance?

Re: Change music?

PostPosted: Fri May 23, 2014 10:35 pm
by fstltna
Change what is already there, for now...

Thx!

Re: Change music?

PostPosted: Sat May 24, 2014 12:53 am
by lugdunon
Ok, so all music in Lugdunon (and all audio / image / sprite assets for that matter) are loaded from mods. To add new music will require the creation and installation of a mod, which is fairly straightforward. Mods take the form of .jar files, which are simply .zip archives that follow an expected path structure.

You must provide both .ogg and .mp3 (.mp3 may be changing to .m4a very soon however) versions of your audio files.

An example mod, named 'com.fstltna.music', and consisting of a single music track named 'MyMusicTrack' would be structured like this:
Code: Select all
META-INF/
  MANIFEST.MF
com/
  fstltna/
    music/
      MyMusicTrack.mp3
      MyMusicTrack.ogg
      mod.json

The META-INF/MANIFEST.MF file is a plain-text file that must contain the following:
Code: Select all
Manifest-Version: 1.0
Lugdunon-Asset-Provider: true

The com/fstltna/music/mod.json file is a plain-text file containing the mod definition in json format, and might look something like this:
Code: Select all
{
   name       :"FSTLTNA's Music",
   description:"Provides FSTLTNA's musical score in Lugdunon.",
   version    :"0.0.1",
   manifest   :{
      AUD:
      [
         {key:"MUSIC.MY.MUSIC.TRACK",def:"com.fstltna.music.MyMusicTrack"},
      ]
   }
}

Once you have created your mod file structure, zip it up, and rename it to com.fstltna.music.jar. You can then place it into your SERVER-ROOT/dat/world/mods/ directory, then edit the SERVER-ROOT/dat/world/etc/mods.json file to add your mod "com.fstltna.music". NOTE: This step will be changing slightly for 0.6.4, and I will update it next week when the release actually goes out.

Once that is done, you should be able to start up your server and play the new music track in game by typing the following into the chat console and hitting enter:
Code: Select all
/ex game.playMusic("MUSIC.MY.MUSIC.TRACK");

I hope this helps, and tomorrow I will post up instructions on how to make specific tracks play automatically for a give instance.

Cheers,
Chris

Re: Change music?

PostPosted: Sat May 24, 2014 12:56 am
by fstltna
Thats great, thanks! Ill wait till you post how to autoplay the tracks to try it...

Re: Change music?

PostPosted: Sat May 24, 2014 8:16 am
by fstltna
Ok, i tried this but i don't seem to get any music playing when i do this, just the default music. I tried 22khz/64kb and 44khz/128kb for the music files. Any more tips?

Re: Change music?

PostPosted: Fri Jun 06, 2014 1:52 am
by fstltna
Any updates on this? I know you are on vacation so no hurry :) what formats should the music be in, kbps and samp,e rate i mean...

Re: Change music?

PostPosted: Fri Jun 06, 2014 4:11 pm
by lugdunon
Hey there,

Apologies for not replying before heading out for vacation. I'll be back on Monday and will provide a much more detailed reply.

Current formats are ogg and mp3. MP3 may be replaced by m4a in the future however. Bit and sample rates can be whatever you like, however you should try to find the best balance between size and quality to prevent longer load times.

Cheers,
Chris

Re: Change music?

PostPosted: Sat Jun 07, 2014 1:13 am
by fstltna
I tried replacing the default audio.music jar file with my own mp3&ogg files, but i dont hear any music when i try it out in the client... Ill wait for your tips...

Re: Change music?

PostPosted: Fri Jun 20, 2014 3:10 pm
by lugdunon
Could you post your music .jar here, or email it chris@lugdunon.net? I'll take a look at it and see what needs fixing.