Skip to content
BossCrafty edited this page Nov 8, 2023 · 15 revisions

The EarthBound Music Editor is a weird relic of a program, with a pretty bad learning curve. However, it can be used to turn EarthBound into a versatile musical instrument, and this tutorial will help you practice! (wip, incomplete)

(Here is a link to download the latest version of EBMusEd.)

Loading a ROM

To load a copy of the game into EBMusEd properly, you'll need an identical copy of it, named something like Reference.smc. This is required to let you save your changes.

You can use CoilSnake to expand the base ROM. It has to be least 3 MB, and make sure you've got a header on your ROM. You can add a header to your ROM with CoilSnake.

Instrument packs

Here is a list of all of the instrument packs in EarthBound and what they contain.

So the SPC700 has some pretty restrictive limitations. The note data, instrument samples, and the echo buffer (if you use it) all have to fit into the same 58K [citation needed] of memory. EarthBound has loads of long samples with big filesizes, so the way it gets around it is that it only loads certain ones into memory at a time. Think of the SNES like a makeshift recording studio in a small apartment. You can't fit an upright bass player, an organist, a guitar player, a flute player, and three violinists all in that small room for the entire recording session!

After you click on a song, look at this part of the screen:

(The instrument pack part of the screen)

So there's a lot to unpack here. The group of textboxes on the right show which packs will be used if you play back the song in EBMusEd itself. When you're making a song from scratch, use this to experiment and listen to various instrument packs to decide which one would sound cool/be appropriate for your song.

The group of textboxes on the left show what's currently saved in the ROM. If you want to listen to your song in an emulator and you want to use a different instrument pack, type it in and hit save. This is separate from File → Save, which saves the note data you edit in the Edit Song tab.

The Song Address dropdown controls which song is currently loaded into EBMusEd/displayed in the Edit Song tab, and ready to play (and save). It corresponds with information on the SPC Packs tab, which is going to be a massive pain to explain. heck. more on that later??

The noise generator-based instruments don't work properly in the program itself, but you can save your changes and listen in an emulator if you want to use and fine-tune them. They make excellent shaker sounds, or cymbals if combined with volume fade. They also sound pretty cool if you use pitch bend on them.

Editing note data

Entering notes

The main way of entering notes is through the keyboard. The keys are divvied out like a piano, with white keys and black keys. When you press a key, it'll insert the corresponding note, but it won't give any auditory feedback. If you're used to doing things by ear and this infuriates you, try using PK Piano, a program I made to solve this specific problem.

Note lengths

Unlike most tracker formats, Nintendo's proprietary music data format uses codes to specify how long notes are. A note length code sets how long the next notes will last, and this stays the same until you put in another note length code - you don't have to put one in for every note. Here's an example using Beethoven's Fifth:

Da da da daaaaaa, da da da daaaaaa

[06] note note note note [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] note note note note [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8] [C8]

The above uses only one note length, [06], but to stay on beat, I had to put a bunch of [C8] notes (a kind of blank note that makes it just keep playing the previous note) to pad out the timing. This will sound good if you play it back, but it'll take up a lot more valuable ROM space than it should. To save space, let's get clever with note lengths!

[06] note note note [4E] note [06] note note note [4E] note

That's much more efficient! I got the new value by counting the number of [06]-length notes that I wanted to consolidate, and adding them up (the lengths, not the note values themselves lol). You can do this with any hex calculator.

I used to use an iOS app called DevCalc because I didn't like having too much stuff onscreen at once (my computer for the past few years wasn't the best), but Windows' default calculator has a "Programmer Mode." which is quite useful. I also made a dedicated control for these calculations in PK Piano. (TODO: Take a screenshot)

Staccato and volume

Now that you have a good idea of how normal note lengths work, let's complicate things a bit! Hah!

So far I've only showed note length commands with one number in them, but they can have two numbers as well. This extra number is used to set volume on the fly (not to be confused with the dedicated channel volume command, [ED XX]), as well as staccato.

The highest staccato/volume value you can have is 7F. So, if you have a note with [06 7F] before it, it'll play at full volume and full length. However, if you use [06 0F] instead, the note will play at full volume, but it'll be extra short!

The first digit (7) sets staccato, and the second digit (F) sets volume. If you're making a song from scratch, you have to include this second number when you set note length for the first time, or you won't be able to hear anything. Just like normal note lengths, once you set this stuff, it persists until you put in another command to change it.

A word of advice

When using control codes in this program, DO NOT USE 00 as it will crash.

You cannot have two note length codes in a row, or it will cause issues. Ex. [18 7C][60] will not work, it needs to be combined into [60 7C].

This part isn't a technical explanation, but you might want to brush up on music theory, or practice making arrangements of things in other music programs to get the feel for it. I've been through piano lessons in elementary school and choir in high school, but all anyone needs is practice! OpenMPT is pretty similar to EBMusEd in terms of layout, but it's much less obtuse, and a lot easier to have fun with, though the learning curve is still there.

With enough practice, you too can be a SOUND PROGRAM just like those folks in end credits sequences!

Special effects

Set channel Volume

Don't set global volume to be FF, the vanilla game uses D0 (iirc. double-check that)

To keep track of syntax for all of these commands, use EBMusEd's Help menu, PK Piano, or make your own text file. For the longest time I used a HALP.TXT file, ordered by how often I found myself using each command.

Things like pitch bend last until you explicitly turn them OFF

If you abuse the pitch bend commands, weird stuff happens like in the underground/cave theme.

Set echo information!

You might not necessarily want echo in the song you're making, though... If you don't turn it off at the beginning ([F6] is the Echo Off command) and don't include any commands to set it either, it'll inherit the previously-playing song's echo settings, which can make for some weird-sounding glitches.

Experimenting with the feedback parameter is fun

Catador posted these tips about echo:

For the echo buffer size, each 16 milliseconds of delay uses 0x800 (2048) bytes of ARAM, growing downwards from $FF00 So if you use echo delay of 5, $FF00-(0x800*5) = $D700

Echo filter values and what they do:

  • 00 - [the echo is unfiltered]
  • 01 - high pass filter
  • 02 - low pass filter
  • 03 - band pass filter

Here's these four values in the loveemu disassembly.

Saving your changes

TODO: explain the SPC Packs tab and how all of that works

TODO: explain the offset dropdown

Import and Export

IMPORTANT NOTE: With the release of Coilsnake 4.2, you can add songs to your projects without modifying a ROM directly. See this page for details on the new method.

You can use File → Export to save a backup of your work, in case the base ROM you're building breaks from too much mucking about with the SPC Packs tab

To import, first choose which song you want to import over

Then use Song → Clear to clear it

Now go to the song tab (so you can see the empty song) and go to File → Import

Now go to the SPC Packs tab and look at that mess. eugh

Look for the one that's just 21 bytes. That's the empty song you imported over, delete it and take note of what offset the thing you imported starts

Go to the first tab and use the dropdown to choose that offset.

Hit CTRL-S to save the song data and the save pack info button to save pack info

Check the song tab one last time to see if it plays back properly!

Custom Instrument Packs

NOTE: The instructions here are still relevant, but the instrument packer is now built into Coilsnake directly, meaning you can skip using the instrument packer yourself!

Thanks to Olivia, custom instrument packs are now relatively easy! To start, download the Instrument Packer from this page!

Before you start using the program, however, there's some setup you need to do. The SNES' instrument samples come in a file format called .BRR, so the sounds you want to use need to be in that format. (TODO: Include information about making BRR samples) For now, you can try googling a tutorial, or search for BRR sounds that other people have made. smwcentral.net has quite a few you can look through!

Once you have your samples, you'll need to make a config file. This is a simple text file that includes which instrument pack number you want to replace in the game, technical information about where to insert the files into the ROM, and a list with each sample's name and ADSR/tuning information. The Instrument Packer's GitHub page has some examples, take a look at them to see how they're structured.

"But wait! What the heck is ADSR, and how do I know what numbers to put there?" Well, ADSR is what's known as an "Envelope," which controls how the sample is played. Notice how different instruments have different characteristics. Some fade in slowly, some start loud and instantly but fade away over time. ADSR is a thing outside SNES music, it applies to all of real world music composition, and is outside the scope of this tutorial (or at least, outside of how much I'm willing to write here, someone else please add info if you feel like it). If you find BRR files online, they will likely come with this information as well, so you can copy and paste it without worrying too much about it. (This paragraph is getting rather long, but if you really want to make your own sample with your own ADSR, Livvy also posted a convenient calculator on her website!)

Once you have your samples and your config.txt, using this tool couldn't be easier Guess what? It got easier. Instead of using the instrument packer, you can simply put your samples and config inside of the music folder in your coilsnake project, as described in the Music Directory page!

Here are the old instructions though in case you still want to use the standalone packer for some reason: All you do is take a folder with your custom instrument samples on it, and drag it onto the EXE! If everything goes correctly, a .CCS file will be made. All you have to do now is take that CCS file, put it into the ccscript folder of your project, and compile it! Now if you open the ROM in EBMusEd, you can select your brand new instrument pack using the number you specified in the config!

Some things to note:

There's a limit to how much can be loaded into the SPC700 at one time. (TODO: what is it exactly?). Obviously, this means you can't use super huge, realistic instrument samples, but it also means that there's a limit to how much you can have before you run out of room for echo. The instrument packer will tell you how much room is left over for echo when it's done.

Common sound effects, like door and telephone sounds, are also instruments in the packs, meaning if you want door, phone, bird chirp, or other such sounds in the same area as your song plays, you'll need to include those sounds in your pack, and they need to be the right numbers. (TODO: Uh, I'll find more about this and report specifics)

Here's an ancient relic from a time before the Instrument Packer, kept here for the sake of preserving history:) Pinci made this tutorial a while back, try it if you dare

Listening to your masterpiece

Load up the ROM in SNES9X, BSNES Plus, or whatever you like using! Not zsnes though. zsnes sucks

Use these instructions to invoke the Debug Menu, either by using the game genie codes (I've never tried this), or by editing those three digits in a hex editor.

EBMusEd displays the number you'll need to put into the Debug Menu as both a hexadecimal number and a normal/decimal number. The Bootup Debug Menu (the one with Kirby in it) lets you put the numbers in as hex, and the in-game debug menu lets you put the numbers in as decimal. In CCScript, you can go either way - music(0x30) and music(48) would play the same song.

Do you like how the echo sounds?

Do you hear any signs of low Audio RAM? (instruments cutting out, unholy screeching, the SPC700 having a heart attack) If so, you probably used too much echo. Generally, this happens if too many samples are loaded at once.

Inaccessible Music

It is now possible to edit certain songs that EBMusEd can't normally modify thanks to Gabbi (Rickisthe1.) You can download the patch here: EB_Inaccessible_Music_Patch

Clone this wiki locally