Home   Help Search Login Register  

Author Topic: Music&Sound&Radio tutorial  (Read 22353 times)

0 Members and 1 Guest are viewing this topic.

Navy_Seals

  • Guest
Music&Sound&Radio tutorial
« on: 05 Nov 2002, 15:46:47 »
Well look who's back, eh? Did ya miss me?! :D Anyways i got some bad news and i got some really bad news. The bad news is
that the Music&Sound tutorial is back online "well its about time d00de :P" and realy bad news is that it got updated in
a whole new way, much better, plus we got so long waited Radio tutorial "finaly revealed" ;) Besides that, thas all the news
except that i've been away from the community for quite a while (sorry guys it took a while) and yeah guess thats all :D
Ok so let's move on to the fun part. Sounds and music is a great aspect in game, which creates a wonderful atmosphere
surrounding us. And today im gonna explain how to get everything working so u can get all ur stuff rolling. Ok I assume
that u r a complete newb don't take it personally and im gonna explain step by step how to do everything, so u can
relax, grab a bottle of cola cos u gonna have to read a lot, not just read, but understand also!

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #1 on: 05 Nov 2002, 15:47:17 »
Very Important: When converting music, the files recomended to be converted at Frequency 44100 hz max, Bit Rate 128kbps,
16 bit, stereo, Encoding - Constant Bitrate. (Note: 16 bit option is not included in dbPowerAmp, but don't worry about that)
For sounds, like speech: Frequency 44100 hz, 16 bit, mono, Bit Rate in ranges from 80 - 112kbps, Constant Bitrate
Also very important thing. Don't use big names and upper case letters. Try using one word for the name of ur song,
like rock, u2, party, sunrise, etc... whatever is in ur mind, otherwise if u'll have let's say for instance
Red Hot Chilli Peppers or like Eagle Eye Cherry, the game won't be able to read them, so try to keep it simple, but u can
write like this - RHCP or lets say Mick_Jagger, no spaces. Ok and now it appears to be that the file size of the music file can be unlimited *well sorta, i dont think u gonna use 15 megs song or something like that  ::) * Alright, let's see what we have got here...
Let's move on. First what u need is a program to convert ur music to ogg. U see the game doesn't support standard
 files like mp3 or wav. that's why we have to convert them to be able to hear them ingame. Also the advantage of ogg.
file is it's size, it can be the same quality as mp3 but the size can be up to 2-3 times smaller, cool ah?! Alright so
here r the two proven and tested programs which u can download for free. U can use either of them, but I recommend both,
 the choice is yours.  Here is the first one,
dBpowerAMP Music Converter grab it here -> http://www.dbpoweramp.com/bin/dMC-r8.exe and an ogg. plugin for it so u'll be
 able to convert ur music to ogg. format -> http://www.dbpoweramp.com/codecs/dBpowerAMP-codec-ogg.exe.
The second one is GoldWave, u can grab it here http://www.goldwave.com/gwave426.exe and also an ogg. plugin for it
over here -> http://www.goldwave.com/calogg00.zip. Ok so now u have ur programs on ur hard drive, install them where u
want (C: D: E: don't know what u got there) Great so now u have ur progys installed. What?! Tired?! hehe don't worry
that's just the easy part, ;).
Now im gonna explain how to use the first program dBpowerAMP Music Converter.
Will be working with music first, cos it's not so difficult as it seems to be, and will move on to the sound later on.
Open the program and a window will pop-up asking u which file would u like to convert. Choose the song u want and click
Open, now u'll see another window which will show u the list of file formats u have. Choose ogg. Now pay attention cos
its important!!! U can leave the channels: stereo, Bit rate must be 128kbps-standard and BIS used it too, Encoding
 should be Constant Bitrate (a must) and Frequency-44100hz. Now choose the folder where u want to save ur file and
click convert, simple as that. I have also attached a picture for u to make it easy if u won't understand. Take a look ->
« Last Edit: 22 Nov 2002, 15:03:02 by Navy_Seals »

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #2 on: 05 Nov 2002, 15:47:53 »
Here im gonna tell u about GoldWave. This is also a great program, it supports many formats and very useful. I usually
 use it more found sounds and editing. U can do a lot of things like noise reduction, shape volume (one of my favorites)
pitch, and many more! But u can also use it for converting ur music. So open the progy, a window will pop-up, don't
really pay much attention to it unless u want to, and click ok. Then choose the file u want to convert and open it.
Then simply click file->save as and choose ogg. format and here we are! (also I suggest unless u won't be doing anything
with the sound like changing it or do some editing I suggest u simply use the dBpowerAMP Music Converter ;), for ease of use)
So u have converted ur music into ogg, then create a folder in the mission where u r currently working on, lets say
 E:\OperationFlashpoint\Users\Charlie\missions\assault.Eden and name the folder Music, this is where we r going to
store our converted music files.
So now we will create a description.ext file in a notepad. U'll probably say, hey what a hell is this stuff?!
Description.ext is a special file created simply in notepad. It contains all the info above;
Extra information about the mission (weather, place,ect...)
Information about the player and other units (face, glasses, rank, type,ect...)
Weapons in the game and ammunition (also can be add-ons)
How to add sound or music in game! <- we'll be working with that part of file.
And many more...

Ok, now we know what a description.ext is, that means we can do some writing.
Create an empty file in notepad and write this down and then im gonna explain what everything stands for, alright.
class CfgMusic
{
   tracks[]=
   {
       jade, blink
   };
   
   class jade
   {
       name = "jade";
       sound[] = {\music\jade.ogg, db+0, 1.0};
   };
   class blink
   {
       name = "blink";
       sound[] = {\music\blink.ogg, db+0, 1.0};
   };
};

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #3 on: 05 Nov 2002, 15:48:31 »
Simple isn't it? Ok now lets' see what we got here. First, the class CfgMusic. This defines a new class for all our music.
 Brackets like this one -> { } r very important when writing and defining classes, if u missed one somewhere the whole
file is not gonna work. The syntax in OFP is very important so pay attention to it when creating files like this one or
scripts for example which we r not going to cover here. Also semicolon is very important here, don't forget it to put it
 almost after each line except when defining a class like class CfgMusic or class CfgSounds, etc... Well in tracks u
simply define which tracks u have in ur Music folder. Now lets' take a close look at the first class jade, shall we...
   class jade <- here we define the new class for the song we specified in the tracks
   {
       name = "jade"; <- this is the name that will be displayed in the trigger-effects-music drop down menu, but we'll
 talk about this later. If u leave it blank then in the editor u'll see only an empty space.
       sound[] = {\music\jade.ogg, db+0, 1.0}; this line tells the game which music is going to be used. Don't forget that
 u have places ur music in the Music folder, that's why we write \music\jade.ogg, db+0 is the volume of the sound. If u
leave 0 then it will play at the volume u have specified in the game options and 1.0 is a pitch of the music.
};  <- and the closing brace with a semicolon showing that the definition of this class is finished
Now save this file as All files name it exactly description.ext. The common problem is sometimes people give it the same
 name, but save it as text file, which then creates a lot of problems for them. And u know why? No?! Ooh come on that's
so simple, its because the file appears to be description.ext.txt which OFP will not read, that's all!!! ;)

Well... looks like we have done the big and difficult part of the job, aren't we. Hehe, probably u r tired of reading all
 that crap, sitting at ur home and saying, oh come on man I wonna hear some music playing!!! Well don't worry we r nearly
 there. Now launch ur game and open ur mission editor(choose any island u want, I suggest desert island cos it loads at
no time). Now a simple test, to see if ur music is working. Place a unit- the player of course and put a trigger not far
away from him in the trigger choose activated by west and when present. Then u'll see a button in the lower left corner
 called Effects. Press it and a new wndow will appear. Wow!!! Look at that we got so many different thing in here, but
 all we care about now is music, so find the music drop down menu and got to the bottom until u find the name of ur song.
 Choose it and click ok, u'll return to trigger window again, don't change anything there, just press ok and preview.
 Now run in the direction of a trigger and...what looks like I hear something ain't I yeah it's the music file which
I have converted!!! Uuupii!!! I can hear it, I can hear it. Well we all did have our moments of joy when after trying
to do something difficult we finally succeed.
Well u can take a big brake, and we'll be right back with editing sounds now, stay tuned


Now I assume that u know how to create description.ext files and how to get the music in game. Now we gonna work with
sound files. Later on u will see that sounds as speech play where important role in the game. It creates a whole new
atmosphere and this gives a game a big plus, especially using speech during cutscenes.
So for this task I suggest u use the GoldWave as u can record ur voice through microphone and it saves really good to
wav. file. U'll probably ask me, why wav. file I can save directly to ogg. and don't bother myself with that crap. Well
u see why. To be able to use speech in the game u need not only ogg. files, but also lip. files which will make the mouth
of the unit move. So what u need is simple program  wav2lip converter.
U can download this program here ->  ftp://www.flashpoint1985.com/doc/wav2lip.zip
Now here we go, open the GoldWave and create a new file. Then record something using ur mic and save it as wav. 16 bit
mono, signed. It will be set by default. Now locate the folder where u have saved ur wav file and copy it by using Ctrl+C
or better cut it with Ctrl+X and go to the folder where u have placed wav2lip program. Simply drop the wav. file into
the program and in few seconds it will create a lip file with the same name.
Don't suggest u putting this program on desktop cos it won't work. Trust me.
Now u can open the dBpowerAMP Music Converter and this file to ogg. or just use GoldWave and save this file with the
same name just in ogg. format.

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #4 on: 05 Nov 2002, 15:49:10 »
So now we r ready to go on with our tutorial. U r already familiar with the description.ext so just open the one we have
 created before. Done? Alright!!! Now write this down after the class CfgMusic.

class CfgSounds
{
   sounds[] =
      {
         speech1, speech2
      };
   
   class speech1
   
   {
      name = "speech1";
      sound[] = {"\sounds\speech1.ogg", 1, 1.0};
      titles[] = {   };
   };
   class speech2
   
   {
      name = "speech2";
      sound[] = {"\sounds\speech2.ogg", 1, 1.0};
      titles[] = {   };
   };
};

Well difficult? Not at all! As u can see its almost the same as classCfgMusic  expect here we have this line
(titles[] = {   };) It is used for stringtable.csv which we gonna cover a bit latter, but u don't really need to do
stringtable.csv for sounds, its up to u.
So now we r set and ready to go. Put ur converted ogg. files and lip. files in the Sounds directory. Open the editor
and put a trigger again or use the existing one if u have saved the mission about adding music. Now do the same go to
effects, but not music! But voices drop down menu. At the bottom as well u'll see ur files. But we r not going to use
 triggers for speech. U can either use waypoints if u have only one speech like man comes to the Officer and tells him
something. That's all, in all other cases we use simple script and use the command line unitname say "speech1".
That's all, this simple.

Since u already know how to create ur own speech, work with description.ext, etc... we just gonna jump right down to the
point of making everything look and sound good. Ok lets say u already have a sound file which u recorded at 11025 - 44100Hz
Frequency, 16 bit, mono, Constant or Average bitrate. (Note: the lower the settings the crappier the sound will be, so feel
free to tweak all the stuff)
Since now we have our ogg. file we gonna use Excel a bit to create a stringtable.csv which is also can be used for sounds,
but the truth i never did it for sounds cos..... i just didn't do it and it doesn't matter whether u have it or not the
choice is urs. But anyways the stringtable should look like this
Language      English      <- here we gonna write what every radio
                  file contains (BIS did the same for sounds, i don't)

Comment            ---stuff---
STRD_D01v01      Butthead u dumbass         <- write what the original radio file contains
STRD_D01v02   R u threatening me? Im the great cornolio i need TP for my bunghole   <- same here
STRD_D01v03   Beavis, erh Beavis, shut up!       <-same here

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #5 on: 05 Nov 2002, 15:49:42 »
As u have noticed i began using the BIS stile which is better and more convinient for me and i don't mix up anything like i
did before. STRD is simply an abriviation (string something...), u can write whatever u want but the main body of the name
in this case D01v01 should be the same as the ogg. file in sound directory which is d01v01.ogg - Upper or lower case letters
don't matter here, so don't worry much about it. So for instance u can have charlie_Green01 or papaBear_Advise or anything u
can think of, any name as long as its easy and convinient for u (note: don't forget to save the file named as stringtable
and from "Save As" drop down menu choose CSV (Comma Delimited) and voila. Ok then looks like we almost set, just few more
tweaks with description.ext and we r ready to Lock&Load.

class CfgRadio
{
   sounds[] =
   {
      R01v01, R01v02
   };

   class R01v01
   {
      name = "R01v01";
      sound[] = {"R01v01.ogg", db+40, 1.0};
      title = $STRD_R01v01;
   };
   class R01v02
   {
      name = "R01v02";
      sound[] = {"R01v02.ogg", db+40, 1.0};
      title = $STRD_R01v02;
   };
};
Alright lets do it quickly, cos u r familiar with most of the stuff from music&sound example.
sounds[] = {   R01v01, R01v02   };  <- radio sounds which we have
class R01v01     <- create class for the first radio file
   {
      name = "R01v01";    <- name...says it all
      sound[] = {"\sounds\radio\R01v01.ogg", db+40, 1.0};   <- directory where file is, its volume and pitch.
      //note that u can create another folder in sound folder, called radio and place ur radio files there or
         have them in the same folder with sounds, therefor u would write
      sound[] = {"\sounds\R01v01.ogg", db+40, 1.0};
      title = $STRD_R01v01;      <- for stringtable.csv to read
   };

Ok so now we r done with description.ext, almost there, just few more tricks and u r set.
Alot of times people ask how to use Papa_Bear or Base or Airbase, well its simple and the answer is right here
This is what u have to do
[west, "Base"] sideRadio "black_02";
[west, "HQ"] sideRadio "02r1"; <- HQ, Base and Papa_Bear no matter what u'll type u will always get Papa_Bear radio message
[west, "AirBase"] sideRadio "R01v02";
aP globalRadio "R01v01";     <- these r simple commands on how to make someone speak on the radio
aP sideRadio "R01v02";      <- same here, but side radio is only for units on ur side, enemy units won't recieve it
Well, well, well looks like u made and i guess i'll have to say that, thats it for today folks. Now u should have a strong
background and knowledge on how use ur own music and sounds in game, how to create description.ext and stringtable.csv,
use programs like GoldWave and dBpowerAMP or others if u don't feel comfortable with these onse. Well guys to tell u the
truth now I am tired like hell. So here we r that concludes our tutorial for this time, hope u enjoyed it and happy
music and sound editing. Thank you for reading this so called "trash" should i say :D have fun and ill see ya around,
cheers!

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #6 on: 05 Nov 2002, 16:41:06 »
Oh and here r just couple of tricks u can do with the sound and music
;small script for looping music or sound
_i = 0;
#loop
_i = _i + 1
playmusic "name of ur song"
~70 - the length of the song
? (_i <= 5): goto "end"
goto "loop"

#end
ForceEnd

If u want the music to come out of the radio or anything else
u should make ur ogg file with the same specs as u do for sound, then we place a radio in the editor and write
this exec "music.sqs" and now we'll write a music.sqs file.
So lets say that the length of ur music file is 1:20, so u'll write
in the notepad like this

#loop
_this say "name of ur song"
~120 - //the actual lenght of the song, we use it if u want the song to loop over
goto "loop"

Well that should bring some more fun to ur mission, well thats all, cheers ;)

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Music&Sound&Radio tutorial
« Reply #7 on: 06 Nov 2002, 00:27:12 »
Now here's someone who knows how to make an entrance ;)

* Muffled sounds of Sui taping Navy_Seals to the top of the forum

There we are... ;D


Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #8 on: 06 Nov 2002, 00:39:03 »
Thanks alot Sui and yeah its good to be back..........so much changed, all the new stuff, just like breathing new air lol. Anyways if u got any questions or suggestions guys, go ahead, ask'em, :D
 :beat: :joystick:Cheers

red devil

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #9 on: 09 Nov 2002, 21:11:30 »
Hey Navy I missed u i bet u dont remember me but u helped me loads back in the day good 2 c ur back spredin the love c ya the Red guy

long distance snip

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #10 on: 20 Nov 2002, 01:15:33 »
hey navy seals, cool tut but i have a question.  I did everything you said but the title doesnt show up in the music directory.

class CfgMusic
{
  tracks[]=
  {
      good, good
  };
 
  class good
  {
      name = "good";
      sound[] = {\music\good.ogg, db+0, 1.0};
  };
  class good
  {
      name = "good";
      sound[] = {\music\good.ogg, db+0, 1.0};
  };
};

please help!

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #11 on: 20 Nov 2002, 04:37:16 »
Well first of all a question for u, why do u have two classes with the same name and everything, i think that this might be the problem, though i never experienced anything like this cos i never had the same class, name, etc...
Anyways try renaming it to anything else u want and see if it works, if not well see whats the problem then, cheers ;)

P.S. red devil, nah i havent forgoten u man, i remember how u were moking with one mission where US guys where on patrol and u wanted russkies to surrender to them as soon as they saw them or something like that.... *mumbles...*
Ahem, yes anyways thanks for the welcome and see ya around, cheers ;) :joystick:

Shashman

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #12 on: 20 Nov 2002, 14:58:43 »
Hi Navy Seal! ;D
That's a really well made tut you did there! ;)But I got a prob   ???...
here's what my description.ext file looks like :

class CfgMusic
{
  tracks[]=
  {
      forever
  };
 
  class forever
  {
      name = "forever";
      sound[] = {\music\forever.ogg, db+10, 1.0};
  };
};
I created a player and a trigger,but in the trigger's music drop down menu I don't see my music  :'(
I followed what you said to the word,so I'm really confused and disappointed(not with you of course ;) )  :'(


long distance snip

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #13 on: 20 Nov 2002, 18:02:58 »
I changed the .ext file so it looks like shashman's .ext but the same things happens to mine.  Please help!

Navy_Seals

  • Guest
Re:Music&Sound&Radio tutorial
« Reply #14 on: 21 Nov 2002, 19:52:46 »
Ok people, the truth is i really have no idea of what u r doing wrong now, except maybe that u saved ur description.ext file in txt. format, thus it looks like description.ext.txt which of course wont work, but if its not this, then when i get back home ill make a small mission with music, radio, sounds and stuff and put it for download, this way ull check urs files with mine and see what u r doing wrong, besides that im really out of ideas, sorry  

Cheers ;) :beat: :joystick:

P.S. Ohh while havent forgot, next time please provide more info like whats not working and what kind of error messages u get and what they say and so on, this way it'll be easier to figure out whats the freaking problem is
Thanks  :wave: :hmm:
« Last Edit: 21 Nov 2002, 20:04:30 by Navy_Seals »