Page 1 of 2

Problems with adding music. [Solved]

Posted: Tue Aug 05, 2014 10:13 am
by thelegend
Hey all,
I thought it would be nice adding custom music to my map. So I have read Mav's tut. about adding custom music. I think I understood it as well but my problem is my efx.lvl is just 5kb size. I munged with the munge.bat in Bfbuilder/ DataEFX/ _BUILD_PC and with the munge.bat in Sound (same directory).

I never changed any files I had to download in this tut (EFX folder by Mav). I just added my music1.wav-music4.wav to DataEFX/ Sound/ Worlds/ EFX/ Streams.
Anywone know what I may did wrong? Because in Mav's tut I had not to change any files. Just my lua file.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 10:14 am
by Marth8880
Please post REQ, STM, SND, MUS, and LUA files.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 10:20 am
by thelegend
Ah Ok..sry... Here are my:
EFX.req:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
"efxcw_music"
}
REQN
{
"lvl"
"efxcw"
}

}
EFXcw.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
}

REQN
{
"config"
"efxcw_music_config"
"efxcw_music"
}
}
efxcw_music.stm:
Hidden/Spoiler:
// ----- Ambient Bleed Music ----------
Streams\music1.wav cis_kam_amb_start
Streams\music2.wav cis_kam_amb_middle
Streams\music2.wav cis_kam_amb_middle02
Streams\music3.wav cis_kam_amb_end
Streams\music1.wav rep_kam_amb_start
Streams\music2.wav rep_kam_amb_middle
Streams\music2.wav rep_kam_amb_middle02
Streams\music3.wav rep_kam_amb_end
// ----- Ambient Vehicle Music ----------
//..\nab\Streams\cis_nab1_amb_veh01.wav cis_kam_amb_veh01
//..\nab\Streams\cis_nab1_amb_veh02.wav cis_kam_amb_veh02
//..\nab\Streams\cis_nab1_amb_veh03.wav cis_kam_amb_veh03
//..\nab\Streams\rep_nab1_amb_veh01.wav rep_kam_amb_veh01
//..\nab\Streams\rep_nab1_amb_veh02.wav rep_kam_amb_veh02
//..\nab\Streams\rep_nab1_amb_veh03.wav rep_kam_amb_veh03
// ----- Win Lose Music ----------
Streams\victory.wav rep_kam_amb_victory
Streams\victory.wav cis_kam_amb_victory
efxcw_music.mus:
Hidden/Spoiler:
// ----- Republic Music -----

Music()
{
Name("rep_kam_amb_start");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(2.0);
SoundStream("rep_kam_amb_start");
}

Music()
{
Name("rep_kam_amb_middle");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("rep_kam_amb_middle");
}

Music()
{
Name("rep_kam_amb_end");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("rep_kam_amb_end");
}

Music()
{
Name("rep_kam_amb_victory");
Priority(1.0);
FadeInTime(0.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("rep_kam_amb_victory");
}




// ----- CIS Music -----

Music()
{
Name("cis_kam_amb_start");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_start");
}

Music()
{
Name("cis_kam_amb_middle");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_middle");
}

Music()
{
Name("cis_kam_amb_end");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_end");
}

Music()
{
Name("cis_kam_amb_victory");
Priority(1.0);
FadeInTime(0.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_victory");
}
efxcw_music_config.snd:
Hidden/Spoiler:
// ----- Republic Music -----

SoundStream()
{
Name("rep_kam_amb_start");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music"); //.stm file
SegmentList()
{
Segment("rep_kam_amb_start", 1.0);
}
}

SoundStream()
{
Name("rep_kam_amb_middle");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
CyclePlayback(1);
Stream("efxcw_music");
SegmentList()
{
Segment("rep_kam_amb_middle", 0.5);
Segment("rep_kam_amb_middle02", 0.5);
}
}

SoundStream()
{
Name("rep_kam_amb_end");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("rep_kam_amb_end", 1.0);
}
}

SoundStream()
{
Name("rep_kam_amb_victory");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("rep_kam_amb_victory", 1.0);
}
}



//----- CIS Music -----

SoundStream()
{
Name("cis_kam_amb_start");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_start", 1.0);
}
}

SoundStream()
{
Name("cis_kam_amb_middle");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
CyclePlayback(1);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_middle", 0.5);
Segment("cis_kam_amb_middle02", 0.5);
}
}

SoundStream()
{
Name("cis_kam_amb_end");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_end", 1.0);
}
}

SoundStream()
{
Name("cis_kam_amb_victory");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_victory", 1.0);
}
}
And my map lua file:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")


local ALL = 1
local IMP = 2
-- These variables do not change
local ATT = 1
local DEF = 2

function ScriptPostLoad()
ForceHumansOntoTeam1()
EnableSPHeroRules()

-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = false, isCelebrityDeathmatch = true}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)
end





function ScriptInit()
SetUberMode(1);
ReadDataFile("dc:Load\\common.lvl")
ReadDataFile("dc:ingame.lvl")
ReadDataFile("ingame.lvl")




SetMaxFlyHeight(115)
SetMaxPlayerFlyHeight(115)


SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo


ReadDataFile("dc:sound\\lc1.lvl;lc1cw")
ReadDataFile("dc:sound\\lc1.lvl;lc1gcw")
ReadDataFile("dc:sound\\lc1.lvl;lc1p")
ReadDataFile("dc:sound\\efx.lvl;efxcw")
ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("dc:SIDE\\niko.lvl",
"niko_inf_bellic",
"tommy_inf_ver",
"claude_inf_speed",
"helicopter",
"veh_chopter",
"police_chopter")

ReadDataFile("dc:SIDE\\cop.lvl",
"cop_officer",
"cop_striker",
"car1",
"car2",
"car3",
"car4",
"taxi",
"police",
"cop_officer2" )

ReadDataFile("dc:SIDE\\pas.lvl",
"pas_1",
"pas_2",
"pas_3",
"pas_4",
"pas_5",
"pas_6",
"pas_7",
"bus" )

ReadDataFile("dc:SIDE\\gangsta.lvl",
"gangsta",
"boss",
"gang" )


SetupTeams{
all = {
team = ALL,
units = 0,
reinforcements = -1,
soldier = { "niko_inf_bellic",0, 0},
assault = { "tommy_inf_ver",0,0},
engineer = { "claude_inf_speed",0,0},
sniper = { "",0,0},
officer = { "",0,0},
special = { "",0,0},

},
imp = {
team = IMP,
units = 55,
reinforcements = -1,
soldier = { "cop_officer",15, 25},
assault = { "cop_striker",10,20},
engineer = { "cop_officer2",5,10},
sniper = { "",0,0},
officer = { "",0,0},
special = { "",0,0},
},
}

SetTeamName (3, "passants")
AddUnitClass (3, "pas_1",20,30)
AddUnitClass (3, "pas_2",20,30)
AddUnitClass (3, "pas_3",20,30)
AddUnitClass (3, "pas_4",20,30)
AddUnitClass (3, "pas_5",15,20)
AddUnitClass (3, "pas_6",15,20)
AddUnitClass (3, "pas_7",15,20)
SetUnitCount (3, 180)
AddAIGoal(3, "Deathmatch", 100)

SetTeamName (4, "gangsta")
AddUnitClass (4, "gangsta",6,8)
AddUnitClass (4, "boss",1,2)
AddUnitClass (4, "gang",8,10)
SetUnitCount (4, 20)
AddAIGoal(4, "Deathmatch", 100)


SetTeamAsFriend(ATT,3)
SetTeamAsFriend(3,ATT)
SetTeamAsFriend(DEF,3)
SetTeamAsFriend(3,DEF)
SetTeamAsFriend(ATT,4)
SetTeamAsFriend(4,ATT)
SetTeamAsEnemy(DEF,4)
SetTeamAsEnemy(4,DEF)
SetTeamAsFriend(3,4)
SetTeamAsFriend(4,3)



-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 16)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:LC1\\LC1.lvl", "LC1_hunt")
SetDenseEnvironment("false")


-- Sound Stats


OpenAudioStream("dc:sound\\efx.lvl", "efxcw_music")
OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetAmbientMusic(ALL, 1.0, "rep_kam_amb_start", 0,1);
SetAmbientMusic(ALL, 0.99, "rep_kam_amb_middle", 1,1);
SetAmbientMusic(ALL, 0.1,"rep_kam_amb_end", 2,1);
SetAmbientMusic(IMP, 1.0, "cis_kam_amb_start", 0,1);
SetAmbientMusic(IMP, 0.99, "cis_kam_amb_middle", 1,1);
SetAmbientMusic(IMP, 0.1,"cis_kam_amb_end", 2,1);

SetVictoryMusic(ALL, "rep_kam_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "cis_kam_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")


SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);

end

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 10:38 am
by Marth8880
Hmm. Everything appears to be in order... Did you remember to normalize your music tracks in Audacity before exporting them?

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 10:46 am
by thelegend
Hm..what do you mean with normalize? I am sorry I am not an expert with music and sounds.
Note: Should they be in mono or stereo because you said music/ custom ambient sounds can be in stereo and in mav's tut he said in mono.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 10:56 am
by Marth8880
They should be stereo @ 44100 Hz (44kHz) or 48000 Hz (48kHz).
[color=#FFFFFF][url=http://www.secretsociety.com/forum/downloads/Sound%20Engine%20Guide.txt]Sound Engine Guide.txt[/url][/color] wrote:VO Wav Format - typically 22Khz 16 bit mono.
Music Wav Format - as high quality as possible, 48khz 16 bit stereo
Sound Effects Wav Format - as high quality as possible, 44 Khz 16 bit mono.

Stereo samples are needed for stereo surround sounds such as ambience (which are actually split into multiple channels/samples for front and back) and music which is 2D, otherwise samples are typically 3D and in the world so they need to be mono (positional).
To normalize a track in Audacity, select the track, go to Effect, Normalize, and click OK. Then re-export.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 11:05 am
by thelegend
Ah ok. Thank you. I am going to normalize and stereo them.
Edit: Ok. Nothing happened. I have them in stereo and have normalizen them. But if I munge (with both munge.bat's) the efx.lvl file is still 5kb size. But it should be a few Mb's because the .wav files are longer than 3 minutes and so on.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 11:22 am
by Marth8880
Hmm. What are the contents of your munged folder?

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 11:34 am
by thelegend
If do you mean in DataEFX/ _BUILD_PC/ sound/ worlds/ EFX/ munged:
There are 2 lvl and 2 config files:
-efxcw.lvl 5Kb
-efxgcw.lvl 1Kb
-efxcw_music.config 2Kb
-efxcw_music_config.config 3Kb

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 11:41 am
by Marth8880
So it appears that the STM file isn't being munged into a STR file. Open up your STM file in Notepad++ and select the Encoding menu. What is the encoding set to? (e.g., Encode in ANSI)

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 12:18 pm
by thelegend
It encodes in UTF-8 without BOM.
If I want to encode in ANSi how I can save that?

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 12:21 pm
by Marth8880
Hmm. My STM files also use UTF-8 without BOM, so I guess that isn't the issue. Regardless, try overwriting your STM file with this one: https://www.dropbox.com/s/rtd4gjg4dcjms ... _music.stm

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 12:36 pm
by Anakin
What munge.bat Files have you used? Take the once I gave you for the sounds

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 12:39 pm
by thelegend
I am soory but nothing happens. I replaced my file with your file, munge but my .lvl file is still 5kb size. And there isn't a new file in my munged folder.
Edit: anakin: Or I will test that.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 12:42 pm
by Marth8880
Dumb question, but do music1.wav, music2.wav, music3.wav, and victory.wav all exist in your Streams folder? Also, are you getting any munge errors or warnings whatsoever?

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 12:46 pm
by thelegend
victory.wav? Ah I have named it music4.wav because in mav's tut it had to be...but in my stm file there is victory.wav read. Ok I renamed the last wav and now my file is larger. I am going to test it in game.
Edit: YEAH. it works. I just had the wav file written wrong. Now the music is in game. thanks Marth and Anakin for help.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 12:59 pm
by Anakin
Glad to hear.
Music never worked for me. Now you can make that for me :P

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 1:29 pm
by thelegend
Sure. You helped me with my weapon sounds and I think I can try helping you with your music lvl. Just pm me where your issues are :P

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 1:31 pm
by Anakin
First i need to finish my Unit's. Than i'll give the music a try.

Re: Problems with adding music.

Posted: Tue Aug 05, 2014 1:39 pm
by thelegend
hm ok.
@Anakin: Off-Topic: I know I am a beginner in xsi but If you need any more help for your mod just let me know. I'd be interested in making some models for you. But not unit models or animations. Just a few props or objects.