Page 1 of 1

Custom Music doesn't work [Solved]

Posted: Fri Aug 15, 2014 9:58 am
by Anakin
Hi,

i tryed to get custom music ingame. But there is no music ingame. Maybe you can tell me what the problem is.


rcm.req:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"str"
"align=2048"
"rcm"
"rcm_music"

}
REQN
{
"lvl"
"comSnd"
"sspSnd"
"music"
}
}[/code]
music.req
Hidden/Spoiler:
[code]ucft
{
REQN
{
"bnk"
"align=2048"
}

REQN
{
"config"
"rcm_music_config"
"rcm_music"

}
}[/code]
rcm_music_config.snd
Hidden/Spoiler:
[code]SoundStream()
{
Name("rcm_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("rcm_music"); //.stm file
SegmentList()
{
Segment("rcm_amb_start_01", 0.25);
Segment("rcm_amb_start_02", 0.25);
Segment("rcm_amb_start_03", 0.25);
Segment("rcm_amb_start_04", 0.25);
}
}

SoundStream()
{
Name("rcm_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("rcm_music");
SegmentList()
{
Segment("rcm_amb_middle_01", 0.25);
Segment("rcm_amb_middle_02", 0.25);
Segment("rcm_amb_middle_03", 0.25);
Segment("rcm_amb_middle_04", 0.25);
}
}

SoundStream()
{
Name("rcm_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("rcm_music");
SegmentList()
{
Segment("rcm_amb_end_01", 0.25);
Segment("rcm_amb_end_02", 0.25);
Segment("rcm_amb_end_03", 0.25);
Segment("rcm_amb_end_04", 0.25);
}
}

SoundStreamProperties()
{
Name("shell_soundtrack");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("shellmusic");
Looping(0);
Pan(0.0);
Mode3D(0);
CyclePlayback(3);
Stream("rcm_music");
SegmentList()
{
Segment("shell_soundtrack", 1.0);
}
}
[/code]
rcm_music.mus
Hidden/Spoiler:
[code]// ----- Republic Music -----

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

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

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

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


[/code]
rcm_music.stm
Hidden/Spoiler:
[code]streams\rcm_amb_start_01.wav rcm_amb_start_01
streams\rcm_amb_start_02.wav rcm_amb_start_02
streams\rcm_amb_start_03.wav rcm_amb_start_03
streams\rcm_amb_start_04.wav rcm_amb_start_04

streams\rcm_amb_middle_01.wav rcm_amb_middle_01
streams\rcm_amb_middle_02.wav rcm_amb_middle_02
streams\rcm_amb_middle_03.wav rcm_amb_middle_03
streams\rcm_amb_middle_04.wav rcm_amb_middle_04

streams\rcm_amb_end_01.wav rcm_amb_end_01
streams\rcm_amb_end_02.wav rcm_amb_end_02
streams\rcm_amb_end_03.wav rcm_amb_end_03
streams\rcm_vode.wav rcm_amb_end_04

streams\rcm_vode_voice.wav shell_soundtrack

[/code]

odf:
Hidden/Spoiler:
[code] OpenAudioStream("dc:sound\\rcm.lvl", "music")
OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rcm_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rcm_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rcm_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_cor_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_cor_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_cor_amb_end", 2,1)[/code]

first i had some nameing problems (middel and middle) but i checked this twice and all wav files listed in the stm file are in my stream folder. There are no munging problems, and the sounds (you see in the rcm.req file) are working, too. The lvl file raised from 7.026KB to 75.029KB. So there need to be something gone right. But there is no music ingame.

Re: Custom Music doesn't work

Posted: Fri Aug 15, 2014 10:34 am
by JimmyAngler
As far as I know, you only need one .req file.
Try combining this stuff together to make it look something like this:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"bnk"
"align=2048"
}

REQN
{
"config"
"rcm_music_config"
"rcm_music"

}
REQN
{
"str"
"align=2048"
"rcm" <--(Leave this only if it is your Voice Overs)
"rcm_music"

}
REQN
{
"lvl"
"comSnd"
"sspSnd"
}
}[/code]
And this :
Hidden/Spoiler:
[code]SoundStreamProperties()
{
Name("shell_soundtrack");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("shellmusic");
Looping(0);
Pan(0.0);
Mode3D(0);
CyclePlayback(3);
Stream("rcm_music");
SegmentList()
{
Segment("shell_soundtrack", 1.0);
}
}[/code]
If you're trying to do menu screen music, you have to do that in the data_rcm\Sound\shell folder

This part:
Hidden/Spoiler:
[code]// ----- Republic Music -----

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

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

Music()
{
Name("rcm_amb_end");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("rcm_amb_end");
}
Delete if menu screen music.
Music()
{
Name("shell_soundtrack");
Priority(1.0);
FadeInTime(0.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("shell_soundtrack");
}
[/code]
Pretty sure you want to change the all the Priority(0.0); to 1.0 or something..

I think that's it.. Post back if it doesn't work. Don't forget to copy over the .lvl file

Re: Custom Music doesn't work

Posted: Fri Aug 15, 2014 3:49 pm
by Marth8880
What JimAng said.

Code: Select all

OpenAudioStream("dc:sound\\rcm.lvl", "music")
Also, the second argument (in this case, "music") needs to be the name of your .stm file.

Re: Custom Music doesn't work [Solved]

Posted: Sat Aug 16, 2014 8:54 am
by Anakin
seams to work now. Now i need to figure out if there are always the same sounds, or if the random thing is working :D


==EDIT==

can someone tell me what these lines are good for??
I want to set up the music a bit better, so i thought some of these lines are good for the time how often it is played, how long,... But i don't know exactly, and i thought it is much easyer to aske instead of trying different values and play the map all the time.

Priority(1.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(2.0);

Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Looping(0);
Pan(0.0);
Mode3D(0);

and what are these values good for:
SetAmbientMusic(REP, 1.0, "rep_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_amb_end", 2,1)

Re: Custom Music doesn't work [Solved]

Posted: Sat Aug 16, 2014 9:12 am
by JimmyAngler
Priority(1.0); <-- A higher priority increases the likeliness of the music track to play. Very helpful when juggling multiple tracks.
FadeInTime(1.0); <-- How long the fade in time of the music is.
FadeOutTime(1.0); <-- How long the fade out time of the music is.
MinPlaybackTime(20.0); <-- You music will only play for 20 seconds (I think) with this setting on 20.
MinInactiveTime(2.0); <-- The minimum time between tracks that the music doesn't play.

The only other one I know is Looping(0); which will play the music/sound effect continuously when set to 1.

Re: Custom Music doesn't work [Solved]

Posted: Sat Aug 16, 2014 9:28 am
by thelegend
And I think Mode3D(0) to 1 (a BIG Maybe) allows 3D soudn box user to hear the music in 3D. Dont know everything but I think that should it be.

Re: Custom Music doesn't work [Solved]

Posted: Sat Aug 16, 2014 11:42 am
by Marth8880
thelegend wrote:And I think Mode3D(0) to 1 (a BIG Maybe) allows 3D soudn box user to hear the music in 3D. Dont know everything but I think that should it be.
No, Mode3D needs to be set to 0 for ambient and music streams. Setting Looping to 0 should fix your problem.

Re: Custom Music doesn't work [Solved]

Posted: Sat Aug 16, 2014 4:57 pm
by Anakin
JimmyAngler wrote: MinPlaybackTime(20.0); <-- You music will only play for 20 seconds (I think) with this setting on 20.
So if there are tracks longer than 20 sec only the first 20 sec will be played?? Makes more sense, if every track is played 20+ sec.

Re: Custom Music doesn't work [Solved]

Posted: Sun Aug 17, 2014 1:21 am
by Marth8880
Anakin wrote:
JimmyAngler wrote: MinPlaybackTime(20.0); <-- You music will only play for 20 seconds (I think) with this setting on 20.
So if there are tracks longer than 20 sec only the first 20 sec will be played?? Makes more sense, if every track is played 20+ sec.
No, MinPlaybackTime determines the absolute minimum number of seconds the track can play before the track is allowed to switch. The track automatically switches after MaxPlaybackTime elapses. Track switches only occur when the MaxPlaybackTime elapses and when other music such s vehicle, hero, victory or defeat music is triggered.

Re: Custom Music doesn't work [Solved]

Posted: Sun Aug 17, 2014 5:29 am
by Anakin
Ok thank you. In mav's example music files were no maxplaybacktime. So what is the default value??

Re: Custom Music doesn't work [Solved]

Posted: Sun Aug 17, 2014 8:13 am
by thelegend
I think it's MaxPlaybackTime(value)

Re: Custom Music doesn't work [Solved]

Posted: Sun Aug 17, 2014 8:19 am
by Anakin
i wanted to know what the default value is, when i haven't set anything for MaxPlaybackTime();

Re: Custom Music doesn't work [Solved]

Posted: Sun Aug 17, 2014 12:17 pm
by Marth8880
I typically use the longest track's duration in seconds multiplied by 5.