Custom Levelmusic

Lithtech Jupiter engine

Post Reply
User avatar
Spawn
Admin
Admin
Posts: 1310
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

Custom Levelmusic

Post by Spawn » Fri Jul 28, 2006 7:35 pm

Just a quick summing up how to add custom levelmusic,
played through the worldproperies like the other gamemusic.

Using serveral segment like in the game is optional,
the purpose of those is to change music when facing AI's and stuff like that.
you can also use a whole song as a 1 segment.

I'm doing all of this with free/shareware software and that complicates things a bit


1. Splitting the wave into several files

This can be done by a mp3/wave splitter
For instance Cool mp3 splitter which is a shareware.

Image

Load the mp3 file you want to split into smaller pieces
and choose method 2, (by time about 10 seconds) or 3 (by size about 300kb)

Image

Set a output directory/name and process it. Just make sure that it keeps
the '%track%' in the name and no spaces or capital letters.
I'll refer to this folder as 'TEMP' from now on

Image

You should now have a folder that looks similar to this one..

2. Make them the right fileformat.

the codec used in the game is a MPEG Layer-3 audio codec
licensed from Fraunhofer IIS and Thomson multimedia.
The only problem is that I didn't figure out which codec to use :P

Windows XP has a builtin codec for this but it can only make them
Mpeg Layer3 56 kBit/s, 44,100 Hz, and that's terrible :o

The fileformat is Wave with extention .wav but with a mp3 codec, meaning it
will have a mp3's size. Renaming a mp3 doesn't work either even if you can play
it in Windows Mediaplayer afterwards.

My solution to this problem was the LameACM codec
There is also a tutorial on this site about how to install the codec.
Complete step 1 to 3..

I'll use 'Windows soundrecorder (sndrec32.exe)' to give the files the right codec,
unfortunatly.. winamp mistakes the LameACM codec for beeing a normal
mp3 codec and won't save it as .wav.

But in order to do so we have to convert the mp3 into normal PCM wave files.
(since sndrec32.exe isn't that fond of mp3 files)

You can easily do this part with winamp.. Tutorial here
But choose a high resolution PCM format instead of the IMA ADPCM

You should now have a brand new set of PCM wave files that sndrec32.exe can use
and of course there is a new setback, you can only convert one file at the time:(

Click 'start-->programs-->accessories-->entertainment-->sound recorder' in
order to start sndrec32.exe

'open' a wav file from the folder,

Image

and choose 'save as' and 'Change' then select the right format.

Image

And repeat this nice job until all waves are converted :thumb:

3. Create the SGT files

There's a .sgt file for each .wav file and they are created with
Microsoft's Direct Music Producer which is a free downloadable
direct X tool thingy :)

Get it here

Image

Now click 'open' and create a new project

Image

And give it a name, I'll name mine 'Nolf2'

Image

Import all the files from the wavfiles from the 'TEMP' folder, you can select
all the files at the same time :) (finally)

after this is done.. click 'file' and select 'Runtime save all files:Project Nolf2'

You'll figure out that the files ends up in a folder in
'my documents' called 'DMUSProducer'.
There should be a folder called 'Nolf2' there and a folder called 'RuntimeFiles'
inside it.. that's where the finished segment are stored.

Select all the SGT files and copy them into the 'TEMP' folder
(don't copy the wav files from the 'runtimefiles' folder, they are ruined)

4. Import the music into the game

Open the Nolf2/CJ projectfolder (GAME), then go to the folder called 'Music'
create a new folder there and give it a name.. I'll name mine 'SPAWN'

Now copy all the .sgt & .wav files from the 'TEMP' folder into the 'SPAWN' folder
you should also copy a file called SILENCE.SGT from one of the other
gamemusic folders and paste it into the 'SPAWN' folder.


5. Make a music Controlfile

You can go really advanced here with transitions,
how the song changes from one mood to another mood
(when meeting a enemy for instance)

I'll just stick to the 'runtime' mood, the one that is normally playing

Open 'ISLAND.TXT' from the 'ISLAND' folder and use that one as a template

Note the text that is marked with purple, blue & orange..

NUMINTENSITIES 15 (since there are 15 of them.. 14 wavs & 1 silence)
INITIALINTENSITY 2 (the level runtime music will start on this one)
VOLUMEOFFSET -1250 (tune this until you're happy with the musicvolume)

Image

Now you need to insert the segments into the file as 'INTENSITIES'.
This works kindof like a playlist of what to play, it will just work its way
down the list..

Scroll down until you find something that is similar to the text below.

Silence.sgt will run when the gamemusic is turned off (as I understand it)

Image

The value in the red cell tells the engine how many times it should be played
before moving on to the next Intensity '-1' means repeat.
The value in the green cell tells the engine what to play next.

After editing this file. save it in the 'SPAWN' folder and give it a nice name
for instance.. 'level1music.txt'

6. To get this bugger to play in the game

Now you need to go into the 'ATTRIBUTES' and edit 'MUSIC.TXT'
Just copy from one of the other levels and paste it at the bottom
then edit the name and intensities..

Image

The red values are 'intensities' from the music controlfile..

None0 = 1 (the silence.sgt)
Routine0 = 2 (this is the normal walk around and explore music)
Investigate0 = 55 (when a AI hear that you're nearby it will change to this one)
Aggressive0 = 66 (This one will be played when the AI attacks you)

The values 55 % 66 doesn't exist.. and the music won't change if any AIs appear
but you can add segments for that as well..

Example:

Image

None0 = 1
Routine0 = 2
Investigate0 = 31
Aggressive0 = 51

To mount the music to a level, simply select the 'level1music.txt'
in the worldproperties.. :thumb:

Hope I spared Jiao and at least 1 other a lot of thinking,
the docs doesn't even mention this stuff :P
Image

User avatar
Jiao
Member
Member
Posts: 5
Joined: Fri Dec 24, 2004 3:48 pm

Post by Jiao » Fri Jul 28, 2006 8:31 pm

B) Kewl. Have you tried using Goldwave at all, A? If so, how did you like it? I've been converting and downsizing some wav music from mp3 format and so far it seems to be going alright - course, if my sodding computer keeps freezing we may never groove on down to 'Yojimbo' in a NOLFing environment... :bonk:

User avatar
Spawn
Admin
Admin
Posts: 1310
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

Post by Spawn » Fri Jul 28, 2006 8:37 pm

Yeah, I tried Goldwave.. got a silly conversion error there :o
it can save up to 56bit mpeg layer3 wav but seems to have a
problem with the Lame codec

Btw, I'm still writing the tutorial.. hehe :)

Good to see you Jiao ((awwsmile))
Image

User avatar
Jiao
Member
Member
Posts: 5
Joined: Fri Dec 24, 2004 3:48 pm

Post by Jiao » Fri Jul 28, 2006 8:39 pm

Lovely to see you too, hon. :D

Um... was I s'posed to wait for the final draft of that tutorial? :banana:

User avatar
Spawn
Admin
Admin
Posts: 1310
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

Post by Spawn » Fri Jul 28, 2006 9:38 pm

K, couldn't put more images in that post :P

Yes Jiao.. It might be of some use then! lol


6. To get this bugger to play in the game

Now you need to go into the 'ATTRIBUTES' and edit 'MUSIC.TXT'
Just copy from one of the other levels and paste it at the bottom
then edit the name and intensities..

Image

The red values are 'intensities' from the music controlfile..

None0 = 1 (the silence.sgt)
Routine0 = 2 (this is the normal walk around and explore music)
Investigate0 = 55 (when a AI hear that you're nearby it will change to this one)
Aggressive0 = 66 (This one will be played when the AI attacks you)

The values 55 % 66 doesn't exist.. and the music won't change if any AIs appear
but you can add segments for that as well..

Example:

Image

None0 = 1
Routine0 = 2
Investigate0 = 31
Aggressive0 = 51

To mount the music to a level, simply select the 'level1music.txt'
in the worldproperties.. :thumb:

and 'msg music i <intensity>' from triggers or similar to change music for special events

Hope I spared Jiao and at least 1 other a lot of thinking,
the docs doesn't even mention this stuff :P
Image

sonic goo
Senior Member
Senior Member
Posts: 258
Joined: Sun Oct 02, 2005 9:36 pm

Post by sonic goo » Fri Jul 28, 2006 10:21 pm

I remember using goldwave a long long time ago. Never had any problems. Must be just Spawn. :P :P :P
Image

User avatar
Spawn
Admin
Admin
Posts: 1310
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

Post by Spawn » Fri Jul 28, 2006 10:26 pm

For the same purpose?

to make Mpeg Layer3 128 kBit/s, 44,100 Hz wav files?
Goldwave can only create Mpeg Layer3 56 kBit/s, 44,100 Hz
before installing any codec..

It won't use the LameACM codec, but there might be different ones
Image

User avatar
SPYDAVE
Pegasus Modteam
Pegasus Modteam
Posts: 302
Joined: Sat Aug 14, 2004 4:52 am
Contact:

Post by SPYDAVE » Sat Jul 29, 2006 1:22 am

Spawn wrote: Yes Jiao.. It might be of some use then! lol
Hey chill out and lay off of Jiao Spawn!!!

... I would gladly fight any man (no make that a horde of men) ... for that woman ...
Image

User avatar
Spawn
Admin
Admin
Posts: 1310
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

Post by Spawn » Sat Jul 29, 2006 1:24 am

Oh no.. hiding in Russia again :unsure:
Spydave wrote:... I would gladly fight any man (no make that a horde of men) ... for that woman ...
hmm.. hey! I was saving a similar line myself for some suitable occasion!
Image

sonic goo
Senior Member
Senior Member
Posts: 258
Joined: Sun Oct 02, 2005 9:36 pm

Post by sonic goo » Sat Jul 29, 2006 2:18 am

Why don't we just have one big cagefight and get it over with?

*dibs on the chair*

Anyway, I messed around with goldwave because I wanted to put some radios in my map. Got it to work on one radio but didn't use it in the end.
Image

User avatar
Dark_Dominion
Senior Member
Senior Member
Posts: 227
Joined: Mon Jan 09, 2006 5:49 pm
Location: Norway

Post by Dark_Dominion » Sun Aug 06, 2006 9:08 pm

Cagefight? I'll bring the popcorn and beer! :thumb:

As for GoldWave...that program sux! :grin:
You are all figments of my imagination!
When Jesus died it took him 3 days to respawn due to lag."
"In the Beginning there was nothing, which exploded."
Image
Image

User avatar
Spawn
Admin
Admin
Posts: 1310
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

Post by Spawn » Sun Aug 06, 2006 10:22 pm

Mmmmmm.. beer :beer:
Image

Post Reply
jedwabna poszewka 50x60