ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Adding A Song: Difference between revisions

From ModEnc
Jump to navigation Jump to search
TAK02 (talk | contribs)
Added an alternative way using Audacity. Please rechk this. Thx.
TAK02 (talk | contribs)
New Section: Format Factory
 
(12 intermediate revisions by 3 users not shown)
Line 4: Line 4:


=== Step One: ===
=== Step One: ===
First, open Winamp and press Ctrl + P to go the Preferences menu. Go to the Output Plugins, and select the [[XCC:IMA ADPCM WAV Writer Plug-In|XCC IMA ADPCM WAV Writer Plug-In ]] plugin. Go to configure, and select your RA2 directory (usually C:\Westwood\RA2\) as the output directory. Now select "Close", and play the song that you wish to add. It will play real fast, and you will hear no sound, but that means that it is coverting the file. When it’s done, change back to your normal output plugin, and close Winamp.
First, open Winamp and press Ctrl + P to go the Preferences menu. Go to the Output Plugins, and select the [[XCC:IMA ADPCM WAV Writer Plug-In|XCC IMA ADPCM WAV Writer Plug-In ]] plugin. Go to configure, and select your RA2 directory (usually C:\Westwood\RA2\) as the output directory. Now select "Close", and play the song that you wish to add. It will play real fast, and you will hear no sound, but that means that it is converting the file. When it’s done, change back to your normal output plugin, and close Winamp.


Alternatively, you can use Windows Sound Recorder (in XP) to do this. Convert the file to .WAV before you begin, then open it in Sound Recorder. Save it in the RA2 directory with the options Format:PCM, Attributes: 22.050kHz, 16 bit, mono. This does the same thing as Winamp in the description above. Please note that Windows Vista's Sound Recorder is unable to do this, but XP's can be copy-pasted (it is named sndrec.exe and is in the C:\windows\system32\ directory).
Alternatively, you can use Windows Sound Recorder (in XP) to do this. Convert the file to .WAV before you begin, then open it in Sound Recorder. Save it in the RA2 directory with the options Format:PCM, Attributes: 22.050kHz, 16 bit, mono. This does the same thing as Winamp in the description above.
 
Please note that Windows Vista's Sound Recorder is unable to do this, but XP's can be copy-pasted (it is named sndrec.exe and is in the C:\windows\system32\ directory).


=== Step Two: ===
=== Step Two: ===
Now go to your [[RA2]] directory using Windows Explorer, and rename the [[WAV]] (if necessary) so that the filename is about 6-8 letters long or less.  
Now go to your [[RA2]] directory using Windows Explorer, and rename the [[WAV]] (if necessary) so that the filename is made of numbers and letters (no spaces).  


=== Step Three: ===
=== Step Three: ===
Line 20: Line 22:
Now go to the Launch menu in [[XCC:Mixer|XCC Mixer]] and select [[XCC:Mix Editor|XCC Mix Editor]]. Now click "New" to create a new [[MIX]] file. Name it expandxx.mix (xx= 1-99), and save it in your [[RA2]] directory. Now click "Insert", and select the [[WAV]] file that’s in your [[RA2]] directory. Click "Open" to add it to the [[MIX]] file. Now click "Save", "Compact", and "Close" in that order. You can now close [[XCC:Mixer|XCC Mixer]] and [[XCC Mix Editor|Mix Editor]]. All you have left to do is to delete the [[WAV]] file from your [[RA2]] directory, since it is now inside the [[MIX]] file.  
Now go to the Launch menu in [[XCC:Mixer|XCC Mixer]] and select [[XCC:Mix Editor|XCC Mix Editor]]. Now click "New" to create a new [[MIX]] file. Name it expandxx.mix (xx= 1-99), and save it in your [[RA2]] directory. Now click "Insert", and select the [[WAV]] file that’s in your [[RA2]] directory. Click "Open" to add it to the [[MIX]] file. Now click "Save", "Compact", and "Close" in that order. You can now close [[XCC:Mixer|XCC Mixer]] and [[XCC Mix Editor|Mix Editor]]. All you have left to do is to delete the [[WAV]] file from your [[RA2]] directory, since it is now inside the [[MIX]] file.  


The track should now play normally in Red Alert 2! You can also add multiple tracks by preforming the steps on multiple songs.
The track should now play normally in Red Alert 2! You can also add multiple tracks by performing the steps on multiple songs.
[[Category:RA2/YR Tutorials]]
[[Category:RA2/YR Tutorials]]


== Alternative way using Audacity ==
 
Please note this assumes you're doing only a replace (or override) of one of the game's original themes.
== Using Audacity to convert your sound files ==
If you wish to add a completely new theme, analyzing the theme(md).ini file is mandatory (or just check the tutorial above from step two onwards).
This section is an alternative Step One to the above main section's tutorial, I have added an extra section for Sound Effects and Voice Acting at the Extras chapter. Section added by TAK02 and polished by Badguy292. Audacity Version 3.0.0 and up are recommended.
=== Step Zero: ===
 
'''''Only if the original file is stereo, and not mono.'''''
When you open an audio file (or some other file with the "Import" option), you'll notice each file has its name displayed next to the cross that closes said file.
Simply click the name and pick "Split Stereo to Mono".
=== Step One: ===
=== Step One: ===
Go to "File">"Export">"Export as WAV"
Import the file of the track or sound effect you want, into Audacity. This is possible with Drag & Drop even.
 
=== Step Two: ===
=== Step Two: ===
Under "Save as type", the signed 16-bit PCM should the default selection. Else set it manually.
Change '''Project Rate (Hz)''' (Located on the lower left in the window) to '''22050'''.
This is the highest bitrate audio the game can play flawlessly, any higher does not work properly.
 
=== Step Three: ===
Go to '''File > Export > Export as WAV''' and select '''Signed 16-bit PCM'''
Then save it somewhere you can remember, with a file name only consisting of letters and/or numbers recommended.
 
 
''Now, once you have your track(s) of choice, go back up to the main section and start at Step Two.''
 
Do Note: It is said, that there are ways to make music work with higher Bitrates (Hz) than 22050.
If you figure out a consistent way to make either work, please expand this section. Thank you.
 
=== Extras: ===
The above Audacity tutorial also works for converting sound effects to work in the game too, you need to convert it to mono, but you'll need to import it in XCC Mixer via  '''Launch > XCC Sound Editor''', then insert the sound codes in Sound(md).ini instead and apply the sounds to an element in Rules(md).ini too.
 
Now give me your best impressions of Havoc or Sakura from Renegade!
''PRO TIP:'' Not everybody as a good microphone, but there are youtube tutorials on noise reduction in audacity if you plan to voice-act.
 
== A Simple way to Add Music to Yuri's Revenge 2021 (by Weavors) ==
'''Step 1'''
- All you need is XCC Mixer 1.47
- Go to Google and type in "Convert Mp3 to WAV" (without quotation marks)
- Optional settings :
+ bit resolution : 16bit
+ sampling rate : 22050 Hz
+ audio channels : Mono
'''Step 2'''
- Open up XCC mixer, File > Open, open ra2md.mix, in it you will see a lot of other .MIX archives, double click on localmd.mix, in it you will find "thememd.ini" and in thememd.ini you will see a list of tracks, if you have added sound or units into the game before, I really don't have to explain it to you, however if you are new:
 
+ Under [Themes] there is number=idname (example: '''21=BrainFreeze''')
this is the defining system in red alert 2'a code, where you make something "appear" in the game, by listing it down below.
 
+ NOW IF YOU ARE NEW TO MODDING, DO NOT, I REPEAT, DO NOT ADD A NEW TRACK!
Instead, change the name of the song in '''Step 1''', take for example "10=;200Meters" under [theme], in the INI file.
The Semi-colon ";" will make the engine ignore the line,  delete the ";" then change the name of the song
from '''Step 1''' into "200Meters" without quotation marks.
'''Step 3'''
- Drag and drop the track in '''Step 1''' that you just changed name of to 200meters into the game folder (no need to drag and drop it into thememd.mix)
- Launch the game, play Skirmish, in the settings menu, select sound and listen if your track plays when you select 200 Meters, or if that even appears. (Because that's the only way I know that to check if it's worked or not)
Good luck Commanders, May the world vibe with your new tracks.
 
==Using Format Factory==
This section only touches on the audio files themselves and how to convert them into a format the game can do something with. An alternative to Step One from the top section via Format Factory.
 
===Step One:===
In the side-bar on the left look for Audio -> WAV and click it.
 
===Step Two:===
The new window will ask you to specify the files. You can either browse the files or drag-n'-drop them.
 
===Step Three:===
This is the more important bit. The Output Setting.
 
By default, you'll get "High Quality" conversion; the actual tunes are untouched, the sample rate stays the same, and stereo/mono is preserved/carried over.
 
You can use music players like MPC-HC and go File > Properties (hotkey Shift+F10) to check the track's sample rate if you're unsure.


Don't forget to name it properly (no more than 8 characters) and save to the game's directory/folder.
Regardless, the sample rate of the ''output'' file needs to be 22050Hz at most, so if you're unsure or there are too many files to check you can just set 22050Hz for Sample rate in the Format Factory Output Setting window instead of Automatic.
To test whether or not it worked, save the WAV under the name "grinder" for RA2 (this assumes you're using vanilla theme.ini, or at leat one that doesn't change the menu's theme).
Everything else you can leave unchanged. Probably.

Latest revision as of 07:53, 14 June 2021

Adding a New Song to RA2 (By Kane 148)

Tools Needed: XCC Mixer, XCC Mix Editor, XCC IMA ADPCM WAV Writer Plug-In , Red Alert 2, Winamp or Windows Sound Recorder, MP3 song (Winamp) or Wave song (Sound Recorder)

Step One:

First, open Winamp and press Ctrl + P to go the Preferences menu. Go to the Output Plugins, and select the XCC IMA ADPCM WAV Writer Plug-In plugin. Go to configure, and select your RA2 directory (usually C:\Westwood\RA2\) as the output directory. Now select "Close", and play the song that you wish to add. It will play real fast, and you will hear no sound, but that means that it is converting the file. When it’s done, change back to your normal output plugin, and close Winamp.

Alternatively, you can use Windows Sound Recorder (in XP) to do this. Convert the file to .WAV before you begin, then open it in Sound Recorder. Save it in the RA2 directory with the options Format:PCM, Attributes: 22.050kHz, 16 bit, mono. This does the same thing as Winamp in the description above.

Please note that Windows Vista's Sound Recorder is unable to do this, but XP's can be copy-pasted (it is named sndrec.exe and is in the C:\windows\system32\ directory).

Step Two:

Now go to your RA2 directory using Windows Explorer, and rename the WAV (if necessary) so that the filename is made of numbers and letters (no spaces).

Step Three:

Now open XCC Mixer and go to the Launch menu. Select XCC Theme Writer > Red Alert 2. A box will pop up in a few seconds that says "X themes have been written to theme.ini" (X= the number of tracks). Now click "ok".

Step Four:

Go to the Launch menu in XCC Mixer and select XCC String Table Editor > Red Alert 2. Look in the bar on the left and select "THEME". Now find the tag for the song you added. It should be named "THEME:xxxx" (xxxx=the filename of the WAV you added). Click on it once, and then click the Edit button. In the big box it should say the track's filename. Now change that to be whatever you want the song to be called in the Music Tracks list in Red Alert 2. (example: if the filename is killer.wav, the tag will be THEME:KILLER, and you should change "killer" in the big edit box to be the song's title). Now click "Ok" to close the edit box, and click the "Ok" button near the bottom of the screen. You will be taken back to XCC Mixer.

Step Five:

Now go to the Launch menu in XCC Mixer and select XCC Mix Editor. Now click "New" to create a new MIX file. Name it expandxx.mix (xx= 1-99), and save it in your RA2 directory. Now click "Insert", and select the WAV file that’s in your RA2 directory. Click "Open" to add it to the MIX file. Now click "Save", "Compact", and "Close" in that order. You can now close XCC Mixer and Mix Editor. All you have left to do is to delete the WAV file from your RA2 directory, since it is now inside the MIX file.

The track should now play normally in Red Alert 2! You can also add multiple tracks by performing the steps on multiple songs.


Using Audacity to convert your sound files

This section is an alternative Step One to the above main section's tutorial, I have added an extra section for Sound Effects and Voice Acting at the Extras chapter. Section added by TAK02 and polished by Badguy292. Audacity Version 3.0.0 and up are recommended.

Step One:

Import the file of the track or sound effect you want, into Audacity. This is possible with Drag & Drop even.

Step Two:

Change Project Rate (Hz) (Located on the lower left in the window) to 22050. This is the highest bitrate audio the game can play flawlessly, any higher does not work properly.

Step Three:

Go to File > Export > Export as WAV and select Signed 16-bit PCM Then save it somewhere you can remember, with a file name only consisting of letters and/or numbers recommended.


Now, once you have your track(s) of choice, go back up to the main section and start at Step Two.

Do Note: It is said, that there are ways to make music work with higher Bitrates (Hz) than 22050. If you figure out a consistent way to make either work, please expand this section. Thank you.

Extras:

The above Audacity tutorial also works for converting sound effects to work in the game too, you need to convert it to mono, but you'll need to import it in XCC Mixer via Launch > XCC Sound Editor, then insert the sound codes in Sound(md).ini instead and apply the sounds to an element in Rules(md).ini too.

Now give me your best impressions of Havoc or Sakura from Renegade! PRO TIP: Not everybody as a good microphone, but there are youtube tutorials on noise reduction in audacity if you plan to voice-act.

A Simple way to Add Music to Yuri's Revenge 2021 (by Weavors)

Step 1 - All you need is XCC Mixer 1.47 - Go to Google and type in "Convert Mp3 to WAV" (without quotation marks) - Optional settings :

+ bit resolution : 16bit
+ sampling rate : 22050 Hz
+ audio channels : Mono

Step 2 - Open up XCC mixer, File > Open, open ra2md.mix, in it you will see a lot of other .MIX archives, double click on localmd.mix, in it you will find "thememd.ini" and in thememd.ini you will see a list of tracks, if you have added sound or units into the game before, I really don't have to explain it to you, however if you are new:

+ Under [Themes] there is number=idname (example: 21=BrainFreeze) 
this is the defining system in red alert 2'a code, where you make something "appear" in the game, by listing it down below.
+ NOW IF YOU ARE NEW TO MODDING, DO NOT, I REPEAT, DO NOT ADD A NEW TRACK!
Instead, change the name of the song in Step 1, take for example "10=;200Meters" under [theme], in the INI file. 
The Semi-colon ";" will make the engine ignore the line,  delete the ";" then change the name of the song 
from Step 1 into "200Meters" without quotation marks.

Step 3 - Drag and drop the track in Step 1 that you just changed name of to 200meters into the game folder (no need to drag and drop it into thememd.mix) - Launch the game, play Skirmish, in the settings menu, select sound and listen if your track plays when you select 200 Meters, or if that even appears. (Because that's the only way I know that to check if it's worked or not) Good luck Commanders, May the world vibe with your new tracks.

Using Format Factory

This section only touches on the audio files themselves and how to convert them into a format the game can do something with. An alternative to Step One from the top section via Format Factory.

Step One:

In the side-bar on the left look for Audio -> WAV and click it.

Step Two:

The new window will ask you to specify the files. You can either browse the files or drag-n'-drop them.

Step Three:

This is the more important bit. The Output Setting.

By default, you'll get "High Quality" conversion; the actual tunes are untouched, the sample rate stays the same, and stereo/mono is preserved/carried over.

You can use music players like MPC-HC and go File > Properties (hotkey Shift+F10) to check the track's sample rate if you're unsure.

Regardless, the sample rate of the output file needs to be 22050Hz at most, so if you're unsure or there are too many files to check you can just set 22050Hz for Sample rate in the Format Factory Output Setting window instead of Automatic. Everything else you can leave unchanged. Probably.