Jump to content
Sign in to follow this  
warghost20

Music In Chopper

Recommended Posts

Try de-pbo'ing music.pbo and make a custom class based on a song that you know already works. At least you'll figure out if your custom file is the problem or the class definition.

And, the obvious: Arma2 music volume turned up? Don't laugh, I've done it myself :D

Share this post


Link to post
Share on other sites

King Nothing thx for the song but the one im using right now is 2,75 mb, so i dont think its that, well i am giving up on this, spent way too many hours on this, i only wanted a stationary chopper were my own music was comming out, too bad it doesent works

1 more time the script, i have already cranked up the db, but still no

class CfgMusic

{

tracks[]={};

class Musictrack1

{

name = "Music_1";

sound[] = {"\sound\filename1.ogg", db+15, 1.0};

};

};

////////////////////////////////////////////////////////////////////////////

class CfgSounds

{

sounds[] = { MyNamMusic };

class MyNamMusic

{

name = "MyNamMusic";

sound[] = {\sound\MyNamMusic.ogg, db+15, 1.0};

titles[] = {};

};

};

Share this post


Link to post
Share on other sites
And, the obvious: Arma2 music volume turned up? Don't laugh, I've done it myself :D

That's a good point actually, I can't think of anything else rational why the music is working for me but not for warghost20 in the same mission.

@warghost20

Are the stock arma 2 songs working for you ok though? And one more thing you could try, export your mission to sp missions and test it there, that's how I've got some some problems fixed related to the game not updating some configs and new files.

Edited by King Nothing

Share this post


Link to post
Share on other sites

Hi,

warghost i think the comment in your triggers activation field should look something like this;

playSound "soundname";

not

PlaySound 'soundname'

hope that helps,

Share this post


Link to post
Share on other sites

HI there

you could add the show script error syntax to your ArmA II launch icon. In case there is some script errors in the description.ext then it will show up, so at least you know if it's script related or there's something wrong with your music file. Never had any problems using custom music files in game.

regards

nettrucker

---------- Post added at 01:58 PM ---------- Previous post was at 01:28 PM ----------

King Nothing thx for the song but the one im using right now is 2,75 mb, so i dont think its that, well i am giving up on this, spent way too many hours on this, i only wanted a stationary chopper were my own music was comming out, too bad it doesent works

1 more time the script, i have already cranked up the db, but still no

class CfgMusic

{

tracks[]={}; ---- Here you must also define the music track see example below

class Musictrack1

{

name = "Music_1";

sound[] = {"\sound\filename1.ogg", db+15, 1.0};

};

};

////////////////////////////////////////////////////////////////////////////

class CfgSounds

{

sounds[] = { MyNamMusic };

class MyNamMusic

{

name = "MyNamMusic";

sound[] = {\sound\MyNamMusic.ogg, db+15, 1.0};

titles[] = {};

};

};

Just noticing a couple of things though in the upper example you are using as defined class music, but your music file has been placed into the sound folder which won't work, because the game searches for a music class and therefore the musicfile must be located in the music folder otherewise the game will tell you no file found.

Here's a small example I used and it works without problems.

class CfgMusic
{
// List of tracks (.ogg files without the .ogg extension)
tracks[] = {ALCHEMY_INSTRUM};

// Definition for each sound
class ALCHEMY_INSTRUM
{
	name = "ALCHEMY_INSTRUM"; // Name for mission editor
	sound[] = {\music\ALCHEMY_INSTRUM.ogg, db + 0, 1.0};
	titles[] = {0, ""};
};
};

I evidenced the part where in my opinion is a mistake. First one is that you have placed your musicfile in a sound folder not withstanding you declared it as music class. So the game is looking in the wrong folder ergo it won't find it.

Second remove the quotes as seen in example I posted below. Third, you used 3 different names in the class definition, one you named Class Musictrack1, the line below you called it Music_1 and then filename1.ogg.

That will never work because you have to use always one identical name for your your music/soundfile.

Now when using sounds the properties of the sound file are important. It must be mono, 16 bit, 44.100 kHz. Music can be stereo though, sounds not.

The example of the definition I send works perfectly in ArmA II for me. Music should be always located in the music folder meanwhile sounds in the sound folder.

I know that you are most probably frustrated right now, which reminds me of my first attempts to import custom music or soundfiles into the game. It tooik me some time to figure it out but once you got a hang on it . . . it's a piece of cake.

I hope that helps.

regards

nettrucker:D

Edited by nettrucker

Share this post


Link to post
Share on other sites

Sorry nettrucker, i desperately need to rip your post apart.

Just noticing a couple of things though in the upper example you are using as defined class music, but your music file has been placed into the sound folder which won't work, because the game searches for a music class and therefore the musicfile must be located in the music folder otherewise the game will tell you no file found.

True. he just had to set it to sound and it should be fine.

I evidenced the part where in my opinion is a mistake. First one is that you have placed your musicfile in a sound folder not withstanding you declared it as music class. So the game is looking in the wrong folder ergo it won't find it.

False. I playerd around with it often (mostly with OFP, RES and ArmA, now even with ArmA 2). It doesnt matter how you define it, THE PATH to the file is important.

Third, you used 3 different names in the class definition, one you named Class Musictrack1, the line below you called it Music_1 and then filename1.ogg.

That will never work because you have to use always one identical name for your your music/soundfile.

Do so, never ment to have everything like the example - mybe that will do.

Now when using sounds the properties of the sound file are important. It must be mono, 16 bit, 44.100 kHz. Music can be stereo though, sounds not.

I have Mono and stereo music in sound-folders, with 32bit and 16 bit and never had a problem....don't put up any false statements here.

I know that you are most probably frustrated right now, which reminds me of my first attempts to import custom music or soundfiles into the game. It tooik me some time to figure it out but once you got a hang on it . . . it's a piece of cake.

I hope that helps.

regards

nettrucker:D

I got another possibility here for not hearing the sounds:

You said, you are implementing the Music into a chopper in a mission. Did you fadeout any sound or Music before? If you don't fade in again nothing will be heard - no matter how hard you try.

Share this post


Link to post
Share on other sites
Hi,

warghost i think the comment in your triggers activation field should look something like this;

playSound "soundname";

not

PlaySound 'soundname'

hope that helps,

when i do that i says missing ;

HI there

you could add the show script error syntax to your ArmA II launch icon. In case there is some script errors in the description.ext then it will show up, so at least you know if it's script related or there's something wrong with your music file. Never had any problems using custom music files in game.

regards

nettrucker

---------- Post added at 01:58 PM ---------- Previous post was at 01:28 PM ----------

Just noticing a couple of things though in the upper example you are using as defined class music, but your music file has been placed into the sound folder which won't work, because the game searches for a music class and therefore the musicfile must be located in the music folder otherewise the game will tell you no file found.

Here's a small example I used and it works without problems.

class CfgMusic
{
// List of tracks (.ogg files without the .ogg extension)
tracks[] = {ALCHEMY_INSTRUM};

// Definition for each sound
class ALCHEMY_INSTRUM
{
	name = "ALCHEMY_INSTRUM"; // Name for mission editor
	sound[] = {\music\ALCHEMY_INSTRUM.ogg, db + 0, 1.0};
	titles[] = {0, ""};
};
};

I evidenced the part where in my opinion is a mistake. First one is that you have placed your musicfile in a sound folder not withstanding you declared it as music class. So the game is looking in the wrong folder ergo it won't find it.

Second remove the quotes as seen in example I posted below. Third, you used 3 different names in the class definition, one you named Class Musictrack1, the line below you called it Music_1 and then filename1.ogg.

That will never work because you have to use always one identical name for your your music/soundfile.

Now when using sounds the properties of the sound file are important. It must be mono, 16 bit, 44.100 kHz. Music can be stereo though, sounds not.

The example of the definition I send works perfectly in ArmA II for me. Music should be always located in the music folder meanwhile sounds in the sound folder.

I know that you are most probably frustrated right now, which reminds me of my first attempts to import custom music or soundfiles into the game. It tooik me some time to figure it out but once you got a hang on it . . . it's a piece of cake.

I hope that helps.

regards

nettrucker:D

Im going to try your script, but what name do i give the the folder containing the music files, and what do i type into the triggers?, and do i also have to put the Sound section in the script?,

the thing i want is in a mission that there is a tank driving by with my own music comming out, and i want my own music in a chopper. thx!

Edited by warghost20

Share this post


Link to post
Share on other sites

1.) Replace the ALCHEMY_INSTRUM with the name of your music file in the description.ext using the code I sent you.

2.) After that open notepad paste the code and save it as description.ext. Type of files: all files, in your mission folder.

3.) inside your mission folder create a folder named music. There you place your .ogg file you want to play in game.

4.) Open up the mission editor place a trigger in the mission

conditionfield: true

go to effect panel select music tracks scroll down to the bottom and there you should find your music file name to select. If it doesn't show up than there is maybe a mistake in the description. ext.

If it shows up than select it and your done. Save the mission and hit preview. It works believe me.

kind regards

nettrucker

Edit: Some more content and explanation for you

well I didn't want to make any false statements I expressed myself badly in the case with the sound properties. It was recommended I think to limit the filesizes of custom added sounds or music, my appologies for that. And yeah this info might be outdated since I learned this stuff way back in OFP CWC days.

Now there is a simple reason why 3 different classes are to be defined in the description.ext for custom sound and music. AFAIK there are 3 different classes.

music

sound

radio

If you open the audio options in game you'll see 3 possibilities for settings

radio

effects = sound

music

with that you can adjust you volumn settings in the audio options ingame.

Radio and other soundfiles are always been placed into the sound folder meanwhile music has it's seperate folder. Never really understood the reason why.

In any case, if you define a music track as sound instead of music you won't be able to use your music settings to adjust volumn ingame in the audio options. You will lower or higher the volumn settings when moving the effects slider and you will lower or increase both at the same time, ingame sounds and music. That's why using proper class definitions is recommended. I know that musicfiles are working when declared as sound. I could even declare a soundfile as music if I want.

Radio class:

AFAIK the radio class is defined seperately for 3 small reasons. Being able to independently increase or lower the radio files in the ingame audio option panel. Last but not least it adds a little static noise and the beep sound when ending communications ingame, to the original soundsource, when properly defined. You define custom radiofiles under sound and no beep is to be heard anymore and also the static is gone.

When creating my own custom soundfiles especially radio files, I already implement in the original sound source all kind of distortions and edit the file before defining it. But I will only hear the beep when communication is terminated in game, if I have declared the sound as radio class, otherwise it will play only the sound file.

Changing db settings manually in the description.ext has never worked for me and that since OFP days, whatever settings I used I couldn't increase the sound volumn of the source file in game, that is my personal experience on that matter in question.

I hope it will help you understand some more I try maybe to send you a small example mission but it might take some time.

Edited by nettrucker
added content

Share this post


Link to post
Share on other sites

Hi Guys, Hi nettrucker !

Ok, I like this thread and I have the similar problem..

I have already loaded sound classes in descr. ext, and songs in ".pbo sounds" file...

If I would make a sound in chopper, starting automaticallly when engine starts...

what should have I put in chopper init line? (I mean without any command displayed on screen, but just automatically, so simply: engine starts and sound song starts in chopper too)

And in trigger, what should have I put in? ... what string for this?

And then, .. I need any script??

The db+0 metod, is interesting for hear sound only in chopper... but I didn't understand how to set the db+- in order to hear sound only 1 or 2 metres far (so simulating into the chopper),..really

Could YOU explaining it to me, please ?

Regards Guys.... I hope in You...

Share this post


Link to post
Share on other sites

You need a lot of negative db in order to have a sound (not music) only be audiable for a few meters. In Domino I use:

class Funk {name="Funk";sound[]={\sounds\funk.ogg,db-30,1.0};titles[] = {};};

in order to prevent the funk sound to travel too far, but it's still much longer than a few meters.

Note that this is defined as CfgSounds, and has to be played using say command. It can only be a mono sound, so it won't work with stereo music.

Be careful with using db values on music (not sounds), as too much positive db may cause fadeMusic command to fail. I've read it somewhere, but fail to find it now.

If you absolutely must use music in a chopper, I might try to playMusic "YourTrack" on engine start and playMusic "silence" on engine stop or getOut event.

Share this post


Link to post
Share on other sites
You need a lot of negative db in order to have a sound (not music) only be audiable for a few meters. In Domino I use:

class Funk {name="Funk";sound[]={\sounds\funk.ogg,db-30,1.0};titles[] = {};};

in order to prevent the funk sound to travel too far, but it's still much longer than a few meters.

Note that this is defined as CfgSounds, and has to be played using say command. It can only be a mono sound, so it won't work with stereo music.

Be careful with using db values on music (not sounds), as too much positive db may cause fadeMusic command to fail. I've read it somewhere, but fail to find it now.

If you absolutely must use music in a chopper, I might try to playMusic "YourTrack" on engine start and playMusic "silence" on engine stop or getOut event.

Holy s**t I didn't know about the playMusic "silence" command. But won't the game engine search for a soundfile named silence when using that command. playMusic "" doesn't work said Aloha who has checked it, it comes up with an error messagge JFYI.

What about 2 triggers.

1st trigger plays music or sound only when player is in vehicle set to repeatedly

COND: player in vehicle

ON ACT: player playMusic "soundfilename"; 0 fadeMusic 1

2nd trigger 0 fadeSound 0 or 0 fadeMusic 0 when player is not in vehicle also set to repeatedly.

COND: not (player in vehicle)

ON ACT: 0 fadeMusic 0

Note that this is defined as CfgSounds, and has to be played using say command. It can only be a mono sound, so it won't work with stereo music.

Yeah sounds should be mono but AFAIK you can activate them also by the playSound command. I use the say command only for speeches ingame. If I'm using a custom combat ambient sound i'm activating it usually with the playSound command.

Kind regards

nettrucker

Edited by nettrucker

Share this post


Link to post
Share on other sites

Ah, yes you can. I just happen to avoid playSound like the plague so I never consider that :) I use say for nearly everything, speech, alarms, custom fire sounds when I need it, incoming artillery sounds. Everything to me is supposed to have a direction cue and fade effect.

Share this post


Link to post
Share on other sites

I have the same problem.

Well, may be not_english letters in the path to Sound(Music\Radio) folder cause this sort of problems. I can't see another reason for now.

Share this post


Link to post
Share on other sites

Hi Mocking-bird

please post your description ext, otherwise it's a little bit hard for us to understand if there is an error in description.ext or not.

Thanks

regards

Share this post


Link to post
Share on other sites

Hey guys.

Sorry if I dig up an old thread here.

I used the earlier example shown...

class CfgSounds

{

sounds[] = { MyNamMusic };

class MyNamMusic

{

name = "MyNamMusic";

sound[] = {\sounds\MyNamMusic.ogg, db+0, 1.0};

titles[] = {};

};

};

...Using the 'say' command on a truck the player drives, using a trigger. That all works fine, but when I leave the small range the music extends to (I'm using -35Db to keep it short-range, as it's meant to be playing through the car radio), and I return, the music is gone. How do I keep it playing even if I'm too far away to hear it, so it is still going when I come back into range?

And is there a way to fadeout a specific sound or music file on a trigger cue? Like, when the crazy stuff begins, I can fade out the nice gentle music and fade in some dramatic music?

Cheers.

EDIT: Oh, and when I change into 3rd person view of the truck, the music stops, and when I change back, it seems to be much further ahead - it's like the music speeds up in 3rd person. Any ideas?

EDIT #2: And is there a way to check when a song/sound has finished playing?

Edited by HateDread

Share this post


Link to post
Share on other sites
1.) Replace the ALCHEMY_INSTRUM with the name of your music file in the description.ext using the code I sent you.

2.) After that open notepad paste the code and save it as description.ext. Type of files: all files, in your mission folder.

3.) inside your mission folder create a folder named music. There you place your .ogg file you want to play in game.

4.) Open up the mission editor place a trigger in the mission

conditionfield: true

go to effect panel select music tracks scroll down to the bottom and there you should find your music file name to select. If it doesn't show up than there is maybe a mistake in the description. ext.

If it shows up than select it and your done. Save the mission and hit preview. It works believe me.

kind regards

nettrucker.

thanks for all your help nettrucker, but im still having loads of issues here

I have created a mission and almost got it finished how ever i want to trigger the mission impossible theme as people leave camp.

I have done the following

1. created a music folder and inthere i have placed an ogg file called mission_1.

I have added the text above to my description folder like this

// Mission Header
class Header
{
 gameType = Coop;
 minPlayers = 1;
 maxPlayers = 16;
};

onLoadMission = "REVIVE TEST MISSION";
OnLoadMissionTime = FALSE;

// description.ext settings for revive
///////////////////////////////////////////////////////////////////////////////////////////
respawn = "BASE";
respawndelay = 4;
disabledAI = 0;

#include "revive_sqf\dialogs\config.cpp"
#include "revive_sqf\dialogs\define.hpp"
#include "revive_sqf\dialogs\rev_cam_dialog.hpp"
#include "revive_sqf\dialogs\respawn_button_1.hpp"
#include "revive_sqf\dialogs\respawn_button_2.hpp"
#include "revive_sqf\dialogs\respawn_button_3.hpp"
#include "revive_sqf\dialogs\respawn_button_4.hpp"
#include "revive_sqf\dialogs\respawn_button_1b.hpp"
#include "revive_sqf\dialogs\respawn_button_1c.hpp"
#include "revive_sqf\dialogs\respawn_button_2b.hpp"
#include "revive_sqf\dialogs\respawn_button_3b.hpp"
#include "revive_sqf\dialogs\respawn_button_4b.hpp"
#include "revive_sqf\dialogs\respawn_button_1map.hpp"
#include "revive_sqf\dialogs\respawn_button_2map.hpp"
#include "revive_sqf\dialogs\respawn_button_3map.hpp"
#include "revive_sqf\dialogs\respawn_button_4map.hpp"
#include "revive_sqf\dialogs\OK_map.hpp"
#include "revive_sqf\dialogs\dead_cam_dialog.hpp"
#include "revive_sqf\dialogs\rev_cam_dialog_blank.hpp"

///////////////////////////////////////////////////////////////////////////////////////////
class Params
{
       class DayTime
       {
	//paramsArray[0]
               title = "Time Of Day";
               values[] = {-6, 0, 8, 13};
               texts[] = {"Morning", "Clear day", "Sundown", "Night"};
               default = 0;
	};
       class Revive
       {
	// paramsArray[1]
               title = "Number of Revives:";
               values[] = {2000,1000,20,10,7,5};
               texts[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7  - Hard","5  - Extreme"};
               default = 10;
       };
       class CfgMusic
       {
      // List of tracks (.ogg files without the .ogg extension)
          tracks[] = {mission_1};

      // Definition for each sound
  class mission_1
  {
	    name = "mission_1"; // Name for mission editor
	    sound[] = {\music\mission_1.ogg, db + 0, 1.0};
	    titles[] = {0, ""};
  };
};
};

3. I went into game set the trigger activated by blufor present went into effects but the ogg file was not in the tracks list???

I know theogg file works as its in my sounds folder for use in game anyway,

and help would be appreciated

thanks

Share this post


Link to post
Share on other sites

You can't have class cfgMusic within class Params. You need to put it in the root of description.ext afaik.

class Params
{
blablabla...
}; //End of params
class CfgMusic
{
all music classes
}; //End of cfgMusic

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

ok my eyes are bleeding from doing this all today i know this sounds cheeky but could you re-write the desricption file for me?

Edited by =WBG=cpt_custard

Share this post


Link to post
Share on other sites

Lol, what? Ok, since my PC is busy anyways and I'm bored :D

NOT tested, I don't know if there are spelling mistakes, but I ended up with this:

// Mission Header
class Header
{
gameType = Coop;
minPlayers = 1;
maxPlayers = 16;
};

onLoadMission = "REVIVE TEST MISSION";
OnLoadMissionTime = FALSE;

// description.ext settings for revive
///////////////////////////////////////////////////////////////////////////////////////////
respawn = "BASE";
respawndelay = 4;
disabledAI = 0;

#include "revive_sqf\dialogs\config.cpp"
#include "revive_sqf\dialogs\define.hpp"
#include "revive_sqf\dialogs\rev_cam_dialog.hpp"
#include "revive_sqf\dialogs\respawn_button_1.hpp"
#include "revive_sqf\dialogs\respawn_button_2.hpp"
#include "revive_sqf\dialogs\respawn_button_3.hpp"
#include "revive_sqf\dialogs\respawn_button_4.hpp"
#include "revive_sqf\dialogs\respawn_button_1b.hpp"
#include "revive_sqf\dialogs\respawn_button_1c.hpp"
#include "revive_sqf\dialogs\respawn_button_2b.hpp"
#include "revive_sqf\dialogs\respawn_button_3b.hpp"
#include "revive_sqf\dialogs\respawn_button_4b.hpp"
#include "revive_sqf\dialogs\respawn_button_1map.hpp"
#include "revive_sqf\dialogs\respawn_button_2map.hpp"
#include "revive_sqf\dialogs\respawn_button_3map.hpp"
#include "revive_sqf\dialogs\respawn_button_4map.hpp"
#include "revive_sqf\dialogs\OK_map.hpp"
#include "revive_sqf\dialogs\dead_cam_dialog.hpp"
#include "revive_sqf\dialogs\rev_cam_dialog_blank.hpp"

///////////////////////////////////////////////////////////////////////////////////////////
class Params
{
class DayTime
{
	//paramsArray[0]
	title =	"Time Of Day";
	values[] = {-6,	0, 8, 13};
	texts[]	= {"Morning", "Clear day", "Sundown", "Night"};
	default	= 0;
};
class Revive
{
	// paramsArray[1]
	title =	"Number	of Revives:";
	values[] = {2000,1000,20,10,7,5};
	texts[]	= {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7 - Hard","5 - Extreme"};
	default	= 10;
};
};
class CfgMusic
{
// List of tracks (.ogg files without the .ogg extension)
tracks[] = {mission_1};
// Definition for each sound
class mission_1
{
	name = "mission_1";	// Name	for mission editor
	sound[]	= {\music\mission_1.ogg, db + 0, 1.0};
	titles[] = {0, ""};
};
};

Edited by CarlGustaffa
Whups, ran a spacesToTabs thingy that was a bit too good. Corrected.

Share this post


Link to post
Share on other sites

cheers m8 ill give it a try tomorrow and post back here to let you know.

---------- Post added at 12:45 AM ---------- Previous post was Yesterday at 11:27 PM ----------

Your script worked fine buddy however ive just tried it now i reset the trigger to activation blufour present then in effects selected the tracks ( mission_1 ) and it didnt work....so set activation to playMusic "misson_1"; yet still didnt work.

What am i doing wrong lol?

Share this post


Link to post
Share on other sites

Checked against the way I use it.

* I leave tracks empty (shouldn't matter).

* I don't use underscores in these classes (shouldn't matter).

* I put filename and path in "", i.e. "\music\Groven_Orions_End.ogg", ...

* I don't have spaces in db, db + 0 for me is db+0.

* Uhm, titles? I've never seen those been used with music before.

Try a vanilla tune (de-pbo music.pbo and grab one to your music folder), and mess around with description.ext until it works. Also remember to save the mission each time you make changes to description.ext, or the game won't reload it. If you get the config to play a vanilla tune, you know at least that part is correct. Only thing left now is the actual audio file.

Share this post


Link to post
Share on other sites

Follow this little tutorial:

In your mission folder, create a file called Description.ext.

Inside this put:

//Declare custom Sounds

class CfgSounds

{

sounds[] = {};

class soundName

{

name = "soundName";

sound[] = {"sounds\soundName.ogg", db+1, 1.0};

titles[] = {};

};

};

Then, to make the sound play just use:

playSound "soundName";

_neo_

Share this post


Link to post
Share on other sites

Just want to stress that the tutorial shown is for CfgSounds and not CfgMusic. So you'd have to use playSound (or similar) instead of playMusic (or similar). There are reasons to choose either approach. You can't accidentally play two Music (only one at a time). That can happen with playSound (for sounds, that's normally desired, but for music it would be really ugly), but playSound now has that nice alternate syntax for automatic attenuation of the sound during speech. At least I assume that's what it's for :)

Share this post


Link to post
Share on other sites

I added the above text to the description file but every time i load the mission up in the editor it just crash oa completely

Share this post


Link to post
Share on other sites

With what error message? Normally it gives you some clues where to look. But smells like wrong use of curly braces, missing semicolons, or already defined classes. For now, forget about sounds, make music work first - one problem at a time.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×