# Basic Use

## How do I insert music?

1. Obtain the custom music you with to use. A large collection of songs to use may be obtained here. Only .txt files are usable; MIDI, MP3, WAV, etc. will not work!

2. Once you have your song, open up "Addmusic_list.txt".

3. Add a new line at the bottom of the file, type in an unused number, and then the song's filename. For example, "34 My Song.txt" (without the quotes). This will be the song number that you will use in Lunar Magic.

4. Copy and paste the text file into the folder named "music". If there are any samples (these end with ".brr"), then copy and paste them into the "samples" folder.

5. If the song comes with a custom bank file (a file that ends with ".bnk"), you do not need to do anything except copy that bank file into your samples folder. Do not use Sample Tool.

6. Run the program. You will be promped for your ROM name. Make sure that your ROM is in the same directory as the program and that its name does not contain any spaces, then type in the name and hit ENTER.

7. Some text will appear on the screen describing details of each song you've inserted. Examine it if you like, then exit the program.

8. You can now use custom music. A file named .msc should have appeared when you ran the program. Lunar Magic can use this to determine the names of your songs, so be sure to keep it in the same directory as your ROM. Of note: If Lunar Magic is not displaying the song names for some reason, don't worry: your songs are still there. Just use the song number you entered in "Addmusic_list.txt" as the song to use in your level.

## I downloaded a soundtrack project, and I'm getting an error about samples?

For a soundtrack song, you must find the sample bank for the song that you want to use, then you must add the following text to the top of the text file:
`#samples
{
"XXXXXXXX.bnk"
}`
where XXXXXXXX.bnk is the name of the bank file. DO NOT use Sample Tool, just add this bit of text. You will also need to copy and paste this bank file into the "samples" folder.

## What about AddmusicM songs?

AddmusicM songs require some extra steps:

1. Open up your song's text file.

2. Look for a line or lines that look like sXX_10_14_13_12_16_15_FF or something similar.

3. At the top of the file, add the following text:
   `#samples
   {
   #default
   #AMM
   "sample1.brr"
   "sample14.brr"
   "sample13.brr"
   "sample12.brr"
   "sample16.brr"
   "sample15.brr"
   }`
   Where "sample10.brr" is the sample in blist.txt at slot 10, "sample14.brr" is the sample in blist.txt at slot 14, etc. The order of the samples must be in the order that the sXX line specified, so be careful!

4. Delete the sXX line, save the file, and then exit.

5. Copy the sample files (probably in a folder named "brr" or "samples") into your sample folder.

Let's look at an example:

1. Suppose the music file's "s" line looks like s09_10_11_14_12_FF.
2. Now suppose that that music's "blist.txt" looks something like this:

       	10  Trumpet.brr
       	11  Strings.brr
       	12  Bass.brr
       	13  Snare.brr
       	14  Cymbal.brr
       	15  Organ.brr
       	16  Choir.brr

3. Add the #samples definition.
4. The first sample would be "Trumpet.brr". The second, "Strings.brr". The third, "Cymbal.brr. The fourth, "Bass.brr".
5. All in all, the #samples definition should look like this:
   `#samples
   {
   #default
   #AMM
   "Trumpet.brr"
   "Strings.brr"
   "Cymbal.brr"
   "Bass.brr"
   }`

## Echo buffer exceeded total space in ARAM?

This is an error that may occur with some frequency with older songs (and some new ones under certain circumstances). If you get this error, there are three possible solutions. In order of effectiveness:

1. Open the offending file. Find the text "#default" and replace it with "#optimized". If this text does not exist (and the text "#samples" also does not exist), then add the following to the top of the file:
   `#samples
   {
   #optimized
   }`
   Otherwise, move on to the next step.

2. Find something that looks like "$F1 $XX $YY $ZZ", where XX YY and ZZ are numbers. Decrease $XX until you don't get any more errors. This may make the song sound a bit different, however.

3. If you've reached this step, this song is simply too big for your hack. You will either have to delete some sound effects, or remove a global song (explained in the advanced section). This should hopefully never happen, however.

## When the timer drops below 100 seconds and I die, the music doesn't slow back down!

This is a very simple error to fix. Simply find all songs that should be "immune" to this increase in tempo (such as the death theme, the game over theme, or whatever), and add "#tempoimmunity" (without the quotes) to the top of the music text file. That should solve the problem.

## The overworld songs are mixed up! The "Welcome to Dinosaur Land" music isn't playing!

Yep. The fixes for these are simple: just reset them in Lunar Magic. You'll only have to do this once.

## My sound effects aren't echoing correctly!

By default AddmusicK disables echo for sound effects. This is so that, for example, if you're using a song in a sky level, and that song uses an echo effect, your sound effects won't also echo and sound weird. To turn echo on, here is what you do:

1. Download uberASM from SMWCentral's patches section.
2. In the "code" folder, open up "level_init_code.asm"
3. You should see a bunch of labels that look like "`levelinit0`", "`levelinit1`", etc. Go to the label that corresponds to the level you want echoey sound effects in. For example, for level 105 you'd go to "`levelinit105`".
4. Insert this code after the label but before the `RTS`:
   `LDA #$06
   STA $1DFA`
   So all in all, that part of the file should look like this (if we're using level 105):
   `levelinit105:
   LDA #$06
   STA $1DFA
   RTS
   levelinit106:
   RTS
   `
   (etc.)
5. And that's it! Patch uberASM to your hack, and just repeat steps 2 - 5 for any level in which you want sound effects to echo.

## Converting older hacks

No extra steps should be necessary in order to convert hacks that currently use AM4 or AMM; just run the program like normal. However, it is highly recommended that you make a backup before attempting this!
Note, however, that you will need to either redownload your old songs or convert them manually. AM4Batch.exe and AMMBatch.exe may help if you decide to go with the latter, as they will automatically add the correct #am4 or #amm identifiers (though you will still need to add the #samples command; follow the same instructions as you would for a soundtrack song, which are mentioned above).

Return to the main page