Custom Music (replace in-game music)

Models + Mapping, Computer & SOF Problems.
Post Reply
Reactions: 0
Posts: 8
Joined: 23 Nov 2015, 16:19

Custom Music (replace in-game music)

Post by asymcon »

Hi there,
I'm trying to replace campaign game music with my own files - how is it actually done?
Based on what I found out:
- game uses 4-bit IMA ADPCM music files, encoded headerless at 22.05kHz mono
- prefix "l" and "r" marks the left and right channel
- using "Pak Explorer" it's possible to extract the in-game music, which can be then converted to PCM Wave using SoX:

Code: Select all

sox -t ima -r 22050 -c 1 -e ima-adpcm ltension.adp left-tension-tdp1.wav
However how does one convert 16bit stereo wave to headerless IMA, that is compatible with SoF1?
All my experiments turned out to be failures resulting in game crashes.

Thanks
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: Custom Music (replace in-game music)

Post by Trekker »

I recorded me playing parts of a Classical Guitar piece using my cell phone (.wav) and just changed the name to the file that was being called by the script in the map without having to convert it or anything. This was dust2dust with the bird, sheep and the rest of the zoo.

The other one, I used part of Wish You Where Here for the map carrera. This one, ended up being too big of a file for players to download. So, if you do get it going, either upload the file here or try to make it as small as you can.

To change the in-game music as in:
"musicset" "dm3"
"startmusic" "1"
would be a different thing.

I think I still have software and files to edit skins and music somewhere on one of my many back up drives.
Reactions: 0
Posts: 8
Joined: 23 Nov 2015, 16:19

Re: Custom Music (replace in-game music)

Post by asymcon »

Honestly I could not understand one bit of information from your message. :confused:
Let's break it down:
What formats can SoF1 recognize?
One of them being 4-bit IMA ADPCM headerless, one file per channel.
I recorded me playing parts of a Classical Guitar piece using my cell phone (.wav) and just changed the name to the file that was being called by the script in the map without having to convert it or anything.
So by "recording on your phone", what format is it????? 8-bit unsigned? 16-bit? PCM? How many channels are there? Does it implement compression? If so, what algorithm is used? MPEG1 Layer 3? IMA ADPCM? Microsoft ADPCM? OKI ADPCM?
This was dust2dust with the bird, sheep and the rest of the zoo.
That part I could not understand at all.. :unsure:
The other one, I used part of Wish You Where Here for the map carrera. This one, ended up being too big of a file for players to download.
What was the format of that song? How was it encoded?
So, if you do get it going, either upload the file here or try to make it as small as you can.
It's difficult without knowing what codecs are supported by SoF1, e.g. what SoF1 understand as sound. Again, I'm missing vital points here.
To change the in-game music as in:
"musicset" "dm3"
"startmusic" "1"
would be a different thing.
Where to set such variables?
I think I still have software and files to edit skins and music somewhere on one of my many back up drives.
Could you at least point me towards where to find such software? Or, how is it called?

PS: Header data of one of those files (lDM5.adp):

Code: Select all

000: 22 56 00 00  07 77 77 8C  "V...ww.
008: EC DB BA 91  37 44 23 21  ....7D#!
016: 19 AD BC CA  AA 82 35 43  ......5C
024: 33 21 09 CC  CB BB 98 13  3!	.....
032: 45 44 22 10  9A CC CA BA  ED".....
040: 99 81 14 43  33 20 9B EB  ...C3 ..
048: CA BB BA 81  55 43 42 30  ....UCB0
056: 0A BD CB AB  A9 81 34 43  ......4C
064: 33 20 8A DD  CC AA 98 02  3 ......
072: 34 44 33 22  08 AC CB CB  4D3"....
080: A9 98 23 54  33 21 8A AC  ..#T3!..
088: BB BB B9 13  75 43 33 32  ....uC32
096: 09 BD CC AB  99 81 24 35  	.....$5
104: 23 22 0A CC  CB BA 98 14  #"......
112: 45 34 23 11  9B CC BB CB  E4#.....
120: A9 90 24 44  32 28 8B CD  ..$D2(..
Does not suggest any sort of header I'd recognize - I think my experiments fail as the start offset is wrong.
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: Custom Music (replace in-game music)

Post by Trekker »

I just "noticed" the word "campaign" sorry. Need a PAK Explorer to go through pak0. 1 2 and 3 to see then make your own combat sound .pak.

dust2dust map comes with, birds.wav, birds2.wav, hopper.wav, hopper2.wav and sheep.wav I changed them with the recording I made. didn't check all the details you are talking about (I used Audio recorder that was included in Samsung Galaxy Core) it worked and I had no reason to dig further.

I'll check for the software but have 2 days of training out of town, so it'll be some time.
Reactions: 0
Posts: 8
Joined: 23 Nov 2015, 16:19

Re: Custom Music (replace in-game music)

Post by asymcon »

Replacing ambient sound with music was not my intention, and would provide limited scope of resolutions - then action sequences would be rendered with the same music, that'd be embedded in the background as ambient sound.
I haven't checked the format for sounds though, good idea! As it'd hint what file types are supported.
In SoF2, music is stored in pak0.pak under:
sound > music > [level]

I meant to replace the files directly in pak0.pak.

EDIT: No, it doesn't work with regular wav files - sounds are stored as 16bit 22.05kHz mono - even with edited dms files (to point to wav alternative), the game still crashes.
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: Custom Music (replace in-game music)

Post by Acadie »

I guess the only thing left is to compress your .wav file into .adp with their left/right channel

my sof crashed too when i tried to edit .dms files
Reactions: 0
Posts: 8
Joined: 23 Nov 2015, 16:19

Re: Custom Music (replace in-game music)

Post by asymcon »

Please be more specific how to compress them. ADP is not valid extension, it's abbreviation of ADPCM. How many times does it need repeating? SoF1 needs headerless format with (likely) zero sample start, WAV does have header.
Key points of this thread:
Which formats are compatible with SoF1 game engine?
How to produce music file compatible with SoF1?

...are still left unanswered.

PS: DMS files must be edited with hex editor leaving their full length, as they're binary in nature.
Reactions: 6
Posts: 2254
Joined: 10 Dec 2011, 17:07

Re: Custom Music (replace in-game music)

Post by Fuckemup »

I have a solution, instead of wasting time at this bs.
Goto sof settings/sounds turn down the music volume then goto youtube - make your own favourite music list, or the music you like when chillingkilling explode heads in sof or getting killed i don't know your taste.
Press play, load sof kaboom, problems solved.
Reactions: 0
Posts: 409
Joined: 04 Dec 2011, 12:07

Re: Custom Music (replace in-game music)

Post by CheaterSkeeter »

Very esoteric subject :confused:

Why do you want to do this exactly? and you've done it for other games i see. Seems like alot of effort to just 'change the music'.. for what?

you can try sending an email to sof1 at megalag.org, maybe he can give you some answers
Reactions: 14
Posts: 4055
Joined: 23 Nov 2011, 14:56
Location: Netherlands

Re: Custom Music (replace in-game music)

Post by Evil4N »

Luxury problems. While I am dealing with players who can't get their sof to work on their modern computers, there are others who want to costumize their SoF. But when I want to add customization for SoF CE everyone starts crying at me. pff.
Reactions: 0
Posts: 8
Joined: 23 Nov 2015, 16:19

Re: Custom Music (replace in-game music)

Post by asymcon »

It is indeed luxury problem - I got older machine just for older software. But it took me quite some time to decide to give SoF1 another go, since the last time I played it (April 2012) I promised myself never to install that crap ever. Times have changed, I took it way too seriously back then. Custom music could make campaign walkthrough less repulsive, daunting and boring than how it currently is.

It helped (quite) tremendously with SoF2, where I cut my own cues (action/suspense, both from my TrailerMusic collection and some 'my own' orchestral tracks) and it 'felt' like a completely different game. Music makes 60% of the enjoyment. But it was easy with SoF2 as the game uses regular MP3s.
Reactions: 0
Posts: 8
Joined: 23 Nov 2015, 16:19

Re: Custom Music (replace in-game music)

Post by asymcon »

I got it working, finally.
Reactions: 6
Posts: 2254
Joined: 10 Dec 2011, 17:07

Re: Custom Music (replace in-game music)

Post by Fuckemup »

Hey AsymCon, do you only play the singleplayer? Tryout multiplayer.
I wanna play sudctf1 a multiplayer map, to this song
https://www.youtube.com/watch?v=cNOP2t9FObw" onclick="window.open(this.href);return false;

Omfg, heads will roll.....
Reactions: 0
Posts: 8
Joined: 23 Nov 2015, 16:19

Re: Custom Music (replace in-game music)

Post by asymcon »

That's basically one bar of swinged eight 16th notes repeated over the course of 11 minutes with some changes to the instrumentation. It doesn't sound bad for 2 mins, but gets very repetitive.
This are my tips:
https://www.youtube.com/watch?v=1o4B7U-Sb_A" onclick="window.open(this.href);return false;
https://www.youtube.com/watch?v=HwUja-6bimM" onclick="window.open(this.href);return false;
https://www.youtube.com/watch?v=QM4dTkkdisg" onclick="window.open(this.href);return false;

and why not:
https://www.youtube.com/watch?v=iMo_afWD98A" onclick="window.open(this.href);return false;

To fill in the depressive atmosphere with uplifting cues.
Reactions: 0
Posts: 1
Joined: 26 Mar 2016, 07:08

Re: Custom Music (replace in-game music)

Post by User5000 »

Can you please tell me how you managed to get it working?
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests