Skip to content

Instantly share code, notes, and snippets.

@TheSoundDefense
Last active December 18, 2022 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheSoundDefense/128c933b629e972835afb25692f9cc2d to your computer and use it in GitHub Desktop.
Save TheSoundDefense/128c933b629e972835afb25692f9cc2d to your computer and use it in GitHub Desktop.
Creating music files for The Legend of Zelda: Ocarina of Time Randomizer

Creating music files for The Legend of Zelda: Ocarina of Time Randomizer

This Gist is intended to be both a tutorial and an information repository for creating new music tracks for the Ocarina Time Randomizer.

Things you will learn:

  • How to make an appropriate MIDI for your song
  • How to convert it to the appropriate file format
  • How to test it in-game using the offline randomizer

Things you will not learn:

  • How to use specific MIDI editors
  • How to add your song to the Darunia's Joy GitHub
  • How to make your music sound good (though the people in the Discord can help!)

More information (including video tutorials) can be found in the #resources channel in the Darunia's Joy Discord.

Instruments

Before you start making a MIDI file and all that, you'll want to know which of the game's available instruments you plan to use. This will depend on which song you're porting/creating. There are some important caveats, though, which are detailed below.

Instrument sets

The first thing you need to know is that you are limited to using one of the game's built-in instrument sets. At this time, you do not have the option of mixing and matching whichever instruments you like. There are 34 instrument sets available, and you can find the full list at DeathBasket's Lair. The most common and versatile instrument set is Hyrule Field/Main Orchestra, which is set 0x3. Whichever set you choose, make sure to note the hexadecimal set number, as you'll be using it later.

Percussion kits

Of the game's 34 instrument sets, 16 of them have percussion kits available for use. The list below indicates which percussion kits are available for which instrument set:

  • 0x3 (Hyrule Field) - Orchestra Kit
  • 0x5 (Market) - Tambourine Kit
  • 0x7 (Inside Jabu Jabu's Belly) - Beat Kit (pops)
  • 0x8 (Kakariko Village, child) - Tambourine Kit
  • 0x9 (Fairy Fountain) - Orchestra Kit
  • 0xA (Fire Temple) - Lute Kit (Plunks)
  • 0x10 (Spirit Temple) - Gong/Windchime
  • 0x12 (Warp Songs) - Orchestra Kit
  • 0x14 (Shooting Gallery) - Orchestra Kit
  • 0x15 (Zora's Domain) - Conga/Bongos
  • 0x16 (Shop) - Conga/Bongos
  • 0x1D (Kotake and Koume) - Gong/Windchime
  • 0x20 (Ganondorf Battle) - Orchestra Kit
  • 0x21 (Ending Sequence 1) - Orchestra Kit
  • 0x22 (Ending Sequence 2) - Orchestra Kit
  • 0x23 (Fanfares) - Orchestra Kit

For every instrument set, the percussion kits use program number 127. See the section on program numbers for more information on what this means.

Each of the percussion kits have certain instruments that correspond to certain MIDI pitches. Note that these drum mappings are not the same as a standard MIDI drum mapping.

The percussion instruments available on the Orchestra Kit are:

  • Kick drum (A0-C2, or 21-36)
  • Snare drum (C#2-F2, or 37-41)
  • Crash cymbal (F#2-F3, or 42-53)
  • Timpani drum (F#3-C6, or 54-84)

TODO: add more information on what each of these percussion kits sounds like.

Instrument style

Generally speaking, there are two kinds of instruments: sustained instruments and single-hit instruments. A sustained instrument will sustain its sound for as long as its note is extended, and drop off once the note ends. Clarinet, trumpet, and crash cymbal are all examples of sustained instruments. A single-hit instrument will have the exact same length regardless of how long the MIDI note is, and it generally has a strong initial hit followed by a slow drop-off. Piano, xylophone, and timpani drum are all examples of single-hit instruments.

Chiptune instruments

In addition to the standard musical instruments, there are also 17 synth-like chiptune instruments available for use on any instrument set. These instruments are available on program numbers 0x80-0x8F and 0xB0 (though we're not sure 0xB0 makes any sound). You can hear what each of these chiptune instruments sounds like by checking out this video.

Assigning these instruments is more difficult than assigning a standard instrument, and will be covered later. (We'll also discuss program numbers in a later section.)

MIDI

The bulk of the work in creating a new song is going to be in creating the MIDI file. There are a number of rules to keep in mind when creating a MIDI file, but there are also some fun things you can do with them to make your song a bit more fancy.

Basic MIDI rules and limitations

A MIDI file is basically a collection of MIDI notes, organized into various MIDI tracks. Each MIDI note has properties such as pitch, velocity (volume), and channel. A MIDI channel basically corresponds to an instrument, and a single MIDI file can support up to 16 channels.

The MIDI rules for Ocarina of Time music:

  • Your tempo cannot be any faster than 255 BPM. (If you want your song to be faster than this, you can instead cut the BPM in half, and shorten/compress the MIDI notes correspondingly.)
  • You are limited to no more than 16 MIDI tracks. Each MIDI track should use only one channel (ideally the same channel number as the track number).
  • Do not use the same MIDI channel more than once. There's nothing to gain from it and there's a good chance it will break your music file.
  • In a single channel/track, you can play up to four notes at the same time, at any given time. If you have five or more notes playing at once in a single channel/track, your song will fail to build.
  • In a single channel/track, you cannot have a MIDI note start while another is playing, and you cannot have a MIDI note end while another is playing. Your MIDI notes need to start and end at the same time.
    • The one exception to this is when the channel/track in question is using a percussion kit. Percussion channels do not have rules on overlapping notes. They are still limited to four simultaneous notes, however.

If you want a particular instrument to play more than four notes at once, or to have overlapping start/end notes, you can use that instrument on multiple channels/tracks to achieve this effect.

Specifying instruments (program numbers)

In general, a single channel in a MIDI file is assigned to a single instrument. This instrument is specified by using the program number. (You may also hear the term program change event, which is the event that describes the program number for the MIDI file.) This is the case with OoTR music tracks as well, though instead of using the standard set of MIDI instruments, the instruments used are the ones in your chosen instrument set. For example, program number 2 generally corresponds to "Electric Grand Piano", but if you are using the main orchestra set (0x3), it corresponds to a clarinet, or if you are using the Fairy Fountain set (0x9), it corresponds to a harp.

The list of instrument sets at DeathBasket's Lair will specify which instrument corresponds to which program number. That website uses hexadecimal numbers, while your MIDI editor may require decimal numbers. For every single instrument set, the percussion kit (if it exists) uses program number 127 (or 0x7F in hexadecimal).

Unlike MIDI channels, which can only be used once per file, you may use the same program number on multiple channels/tracks, in order to get more usage out of a single instrument. We currently do not know the limit of how many times a program number can be used in a single song. This is a good way of getting around the four-note or overlapping-note limitations.

Your MIDI editor may allow you to specify the program number when creating the MIDI, but it's possible that it can't, or that it's just difficult. You can add program numbers to a completed MIDI file after the fact by using a MIDI editor program such as Sekaiju, if that's easier.

Instrument ranges

For every single instrument (except for many of the chiptune instruments), there is a hard limit on the range of pitches that instrument can express. For example, in the main orchestra set (0x3), the strings are limited to the range of C1-G#6. If you try to play a note outside of the instrument's range, the note will be forcibly raised or lowered to the floor or ceiling of the instrument's range. This will generally sound very bad.

We currently know the instrument ranges for the main orchestra set (0x3):

  • Flute: C1 - G7
  • Oboe: C#1 - E7
  • Clarinet: C1 - C7
  • Bassoon: C1 - A4
  • Horn: C1 - C6
  • Trumpet: C1 - C7
  • Trombone (Trumpet 2): C1 - G6
  • Tuba: C1 - E4
  • Glockenspiel: C1 - B6
  • Strings: C1 - G#6
  • Pizzicato Strings: C1 - A#6
  • Piano: C1 - C7
  • Harp: C1 - F7
  • Xylophone: C1 - D7

Instruments in bold are a little more nuanced, as the instrment will change slightly as they move into different pitch ranges. For example, the strings will change from a cello to a violin starting at E3.

These have been captured in an image, courtesy of PolyGanon:

Instrument ranges

Chiptune instruments

Unlike other instruments, the chiptune instruments cannot be specified normally by using the program number. The MIDI program number has an upper limit of 127, but the chiptune instruments start at 128 (or 0x80 in hexadecimal). These instruments have to be assigned during the MIDI-to-SEQ conversion process.

In the meantime, it's good practice to assign each chiptune instrument to a program number that isn't used by a different instrument. If you're using chiptune 0x81, you can assign that channel program number 81. This will make your life easier down the line.

Looping

When building your song using the default build options, your song will loop and play forever, which is generally what you want. The start point for the loop is the start of the song, and the end point for the loop is as soon as the final MIDI note stops playing, or as soon as the final MIDI event (such as a tempo change) happens, whichever comes last. This may not be what you expect, and it may make your loop timing sound a little bit off. One way of getting around this is taking the final note of a single-hit instrument (see "Instrument style" above) and extending it to the point where you want the loop to happen. You can also specify a different starting point for the loop, as detailed below.

For your song, you may want to have an intro section that isn't included in the loop (think of the start of Kokiri Forest, for example). You can use MIDI markers to specify your desired loop point. In your desired MIDI editor (such as Sekaiju), place a marker with ID 1 at the very start of your song and name it "Section 0". At the desired start point of your loop (where you want the song to go back to), place a second marker with ID 2 and name it "Section 1". (I don't know if the names are necessary, but you might as well use them.) When the song first starts, it will start at the beginning, but when it reaches the end, it will loop back to wherever you placed the second marker.

It's also possible that you are creating a fanfare, and you don't want the song to loop at all. You can specify this when building your song with Seq64.

Adding loop points with SEQ64 V1

To start, your MIDI needs a marker in it for your loop point before you import it. If your MIDI doesn't have the section marker, you won't be able to make a mid-song loop point until you add one to the MIDI.

Open up SEQ64 V1, load the RomDesc file, and import the MIDI file. Navigate to the Audioseq tab, as shown below, where your converted MIDI will be shown as the Loaded Sequence.

SEQ64 - Manual looping, part 1

Click the Seq Header (which is always the first line, with address @0000) and look for Branch Abs Always amongst the commands that appear in the right pane. This is the instruction that sets where your sequence will try to jump to once it finishes (indicated by the red arrows in the below image). You'll see at the bottom that it has a value of 0009, which is the same value as the address of the first Absolute Chn Ptr for the lowest-numbered channel in your project (indicated by the green arrow). This is the start of section 0, or the intro section. These Absolute Chn Ptr commands are usually grouped together, one for each channel in the MIDI.

SEQ64 - Manual looping, part 2

To find the value to change it to, look for the second set of grouped Absolute Chn Ptr commands (each set is outlined in the picture below). We see that the address of the first command in the second set is @0014, so we change the value of our Branch Abs Always command to be 0014 (as noted by the red arrows). This exact number will change depending on how many channels your MIDI is using.

SEQ64 - Manual looping, part 3

You can now click on Save Raw to save your .seq file, which will now loop back to the marker you originally specified.

Effects

There are a number of additional MIDI effects you can use that will enhance your song, if you choose to use them.

Tempo changes

While your song will have a default tempo that it starts with, you can also change the tempo in the middle of the song. Tempo changes will apply to the entire MIDI and all of its tracks. Using your preferred MIDI editor, place a tempo change marker at the point where you want the tempo to change. Seq64 will automatically convert this to the proper command in the .seq file.

Keep in mind that if your song has a loop in it, the tempo may not be what you expect when the song loops. If your song loops back to the very beginning, the tempo should change back to the starting tempo. If your song loops to some other point, the tempo will stay the same as it was before the song looped back.

If you are already changing tempo at the loop point, you should not need to do anything. If you want your song to change tempo when it loops, and there is not already a tempo change marker at the loop point, the appropriate thing to do is to place a tempo change marker at the very end of the song. If you place a tempo change marker at the loop point, but the tempo stays the same as it was previously, Seq64 will remove that tempo change marker and you will not get the result you want.

Pitch bend

One of the fun things you can do with a MIDI that works in OoTR is pitch bend. This lets you adjust the pitch of a note while the note is still playing, so you can "scoop" into a note at the very start, or have one note gradually shift from one pitch to another. Each MIDI editor will handle pitch bend differently, but the general principle is the same.

Pitch bend does not apply to a single note, but to an entire MIDI track. (This means that you can't pitch-bend a single note on your track while leaving the others alone.) The track has a pitch-bend value that you can raise or lower at certain points, in order to raise or lower the pitch. By default, this value is 8192. You can insert multiple pitch-bend events into the track in order to create a controlled increase or decrease in pitch.

For each time you want to bend the pitch of your track, you will want to insert two pitch-bend events into your song: one at the start of the pitch bend, and one at the end. Here is the easiest way I've found to do this:

  • The notes that you are bending should be placed on the pitches you want them to start on.
  • The starting event should have the default pitch value of 8192, and have an appropriate CC shape to ensure a smooth transition to the new pitch. Generally, "linear" is a good shape.
  • The ending event should have the new, "bent" pitch value. I've found that raising or lowering the value by 1296 will increase or decrease the pitch by two semitones.
  • Once the bent MIDI note is finished, you need to reset the pitch-bend value for the whole track. You can add another pitch-bend event after the MIDI note and set its pitch value to 8192. (The previous event should have a "square" CC shape, or else the note will slowly fall back down to the default pitch over time.)

You can also do this in the opposite way, where the starting event is at the lower, "bent" pitch value, and you bend back up to the pitch's normal value of 8192. In this case, instead of resetting the pitch value at the end, you need to use an event at the very start to bring the pitch down; if your pitch bend starts at the very beginning of the note, however, you can just do this with your normal starting event. This is useful for notes that "scoop" up into their standard pitch at the start.

Note that the available range for pitch bend in Ocarina of Time is a full octave (or twelve semitones), while in a lot of other software the range is a whole step (or two semitones). The pitch bend sound you hear in your MIDI software may not be the same thing you hear in the game.

Volume bend

In addition to bending the pitch, you can also bend the volume of a track. Normally, the volume of each MIDI note is specified by its velocity, but the velocity alone doesn't give you many options. By adjusting the volume of the track, you can cause the track to increase or decrease mid-note, which lets you do things like have a trumpet slowly fade out, for example. Like pitch bend, volume applies to an entire MIDI track, and not to individual notes.

Volume changes can be made by adding MIDI CC messages to your track. In this case, the volume is controlled by CC message 7. You can specify a value between 0 (silent) and 128 (full volume). By default, all tracks start at volume 128, so you can only make your tracks quieter than the default, not louder. You can add sudden changes or gradual changes by specifying the CC shape, just like with pitch bend.

Vibrato

You also have the option of using vibrato, which is where the pitch of a note rapidly increases and decreases. Like pitch bend, vibrato applies to an entire MIDI track, and not to individual notes.

Vibrato can be used by adding MIDI CC messages to your track. There are two messages you can use: one to control the frequency, and one to control the depth.

  • The vibrato frequency specifies how quickly the pitch will increase and decrease during the vibrato. This is set with CC message 76. You can specify a value between 0 (effectively no vibrato) and 127 (fastest increase and decrease). If you specify a vibrato depth, but not a frequency, the default frequency value will be 64.
  • The vibrato depth, also known as the range, specifies how much the pitch will increase and decrease during the vibrato. This is set with CC message 77. You can specify a value between 0 (no pitch increase or decrease, which effectively means no vibrato) and 127 (maximum pitch increase or decrease). If you specify a vibrato frequency, but not a depth, the default depth value will be 64.

Like with pitch bend, you can use a linear shape (or a curved shape of some sort) to slowly increase the vibrato depth, frequency, or both. Create one event with value 0 and a linear shape at the point where you want the vibrato to start increasing or decreasing, and create another event with the ending value at the point where you want the vibrato to stop increasing or decreasing.

Reverb

Reverb is also controlled by CC messages. Specifically, you can specify the wet/dry mix with CC message 91. The value ranges from 0 to 127. A value of 0 means 100% dry, and a value of 127 means 100% wet.

TODO: figure out exactly how this affects the sound of a track.

Audio preview

While developing a song, you might want to get a good audio preview of your MIDI without going through the whole conversion process every time. You can do this with a free program called MuseScore, along with the Ocarina of Time soundfonts. To get a real-time preview of how your MIDI will sound:

  1. Download MuseScore and the OoT soundfonts.
  2. In MuseScore, add the soundfonts to the program's resources. This should be Documents > Musescore 3 > Soundfonts.
  3. Go to View > Synthesizer to see the available soundfonts, which should include the OoT ones you just added. Choose the soundfont that corresponds to the instrument set you're using.
  4. Go to the Mixer (F10) and reallocate the instrments to use the soundfont's set. By default, it will set every instrument in the MIDI to use the first instrument in the soundfont.
  5. Hit play.

You can also export this music as an MP3, in order to get a shareable preview. To do this, you can go to File > Export and change Export To to MP3 Audio. The one major difference here is that MuseScore will not limit the instruments based on the instrument range, but the game will. Always test your songs in the game before you share them with the world.

Building your music file (Seq64)

Once your MIDI file is ready to go, you will need to convert it into a SEQ file. This is done with a program called SEQ64. The newest version is SEQ64 V2, which should work for most of your needs. However, if you need to manually edit your SEQ file after it's been made (for example, if you want to use one of the chiptune instruments), you will also need to download SEQ64 V1.

Using SEQ64 V2 is easy. Open up the GUI version of the program, make sure that the "Zelda" binary format is selected at the top of the program, and click on "Import MIDI".

SEQ64 - Import MIDI

If you made the MIDI correctly, it should import with no issues; if you did something wrong, SEQ64 will throw an error, and you should be able to find the problem in the debug output. Once your MIDI has been correctly imported, click on "Export .com/.aseq" and save it as a .seq file.

SEQ64 - Export .com/.aseq

Smart loops

SEQ64 V2 is smart enough to automatically implement loops based on MIDI markers, or to loop over the entire song if no markers were used. It also is able to reduce the size of your SEQ file by identifying repeated patterns in your MIDI file and saving them as small chunks that can be called, as if they were functions in a programming language. This is good for your file size, but it can make working with chiptunes slightly more complicated.

Fanfares

If you are making a fanfare, you want to ensure that it does not loop. (If fanfares loop, they can softlock the game in the worst-case scenario.) To prevent this, before you import your MIDI, you should uncheck the "Smart Loop" and "Loops" checkboxes.

SEQ64 - Uncheck loops

Chiptunes

If you want to use a chiptune instrument, now is the time to specify that. First, open up SEQ64 V2, import your MIDI, and export it as a .seq file. Next, you need to open up SEQ64 V1. Go to RomDesc > Load... and load the oot_v1.0_info file that should have come with your download. Click on the Audioseq tab and then click "Load Raw" to open up the .seq file you just made.

SEQ64 - Load Raw

The "Sections" box should now be populated with a lot of SEQ data. What you want to find is the very first section with type Chn that corresponds to the track you want to make into a chiptune. In this example, I want to change channel 7 into chiptune instrument 0x81. Because channel values in SEQ64 start from 0 instead of from 1, I look for the Chn section for channel 6. Inside that bit of data, there is an Instrument command to specify which instrument should be used. Click on that command and change the value to what you want (in this case, the hexadecimal number 81).

SEQ64 - Change instrument

Once you're done, you can save your changes by using the "Save Raw" button. The button will being up a file save dialog instead of immediately overwriting the file you loaded, so it's safe to click.

There is an important note here: if you used the same chiptune instrument on multiple channels, and gave them the same program number when setting up your MIDI, it's possible that SEQ64 will take the Instrument command and put it somewhere you don't expect. If you open up that first Chn event and don't see an Instrument command, look for the Call Absolute command instead. The value of that command will point you toward a memory address where you can find the Instrument command, as you can see below.

SEQ64 - Call absolute command

If you click into the section matching that memory address, you will find the Instrument command you were looking for. Now you can change the value to your chiptune instrument.

SEQ64 - Call absolute memory path

If you really want to, you can delete the original Call Absolute command and replace it with the matching Instrument and Timestamp commands that you found by following the memory address. Try to avoid doing this if you can help it.

SEQ64 - Replace call absolute

Randomizer program

The best way to test your new music track in-game is by using the offline Ocarina of Time Randomizer program. (The online version will not let you use custom music.) You can download the program here. Once you've done that, here's how you can add your own song into the mix.

Create a META file

To work with the randomizer, each .seq file needs to have a matching .meta file, with the same filename aside from the extension (e.g. foo.seq should have a matching foo.meta). It's a short file that's structured like this:

Super Mario Galaxy - Beach Bowl Galaxy
0x03
bgm
Market,Mini-game,ShootingGallery,Town,Fun,Outdoors,Indoors,Overworld

The first line is the name of your song. This name needs to be unique. No two songs can share the exact same name or the randomizer will fail. Generally, "Game Name - Song Name" works, unless you're making another version of an existing song, in which case you'll want to append "(Version 2)" or something else to make it unique. Don't use quotation marks in the name. It just makes things harder for people creating cosmetic plandomizer files.

The second line is the hexadecimal value of the instrument set that you're using. For the sake of convention, the part after 0x should be two digits.

The third line specifies whether or not your song is background music (BGM) or just a fanfare (for when you find items or medallions and such). As you might expect, bgm is used for BGM and fanfare is used for fanfares. If this line is omitted, your song will be treated as BGM. It's good practice to include this line, however, and if you plan to make your song compatible with music groups, this third line will be required.

The fourth line specifies which locations are suitable for playing your song, as detailed in the section below.

You should end your file with a newline. This makes no functional difference, but it's good practice when working with GitHub and other version control systems.

Music groups

If you feel that your song would work better in some locations than others, you can specify in your .meta file which locations would work best for your song. All creators are strongly encouraged to do this with all of their songs and fanfares. We want the entire Darunia's Joy repository to be annotated with music groups.

The newest version of the offline randomizer now supports named music groups. This allows users to use a cosmetic plandomizer file to create a group of songs with a specific name, and they can then refer to that name when specifying which songs they want to use for certain locations. The randomizer will only pull from that named group when assigning music for that location. For example:

{
  "bgm_groups":            {
    "groups":    {
      "Field":      ["Hyrule Field", "TLoZ Majora's Mask - Termina Field (SPT)",  "TLoZ A Link to the Past - Hyrule Field Main Theme", 
                     "The Legend of Zelda: Spirit Tracks - Overworld Adventure", "TLoZ Windwaker - Overworld"],
      "FileSelect": ["TLoZ Majora's Mask - Astral Observatory (3P)",  "Wii Shop Channel"]
    }
  },
  "bgm":              {
    "Hyrule Field":         "#Field",
    "Fairy Fountain":       "#FileSelect",
    "Sun's Song":           ["Sun's Song",  "TLoZ Majora's Mask - Song of Double Time (SPT)"],
    "Song of Time":         ["Song of Time", "Majora's Mask Randomizer - Song of Time Fanfare"]
  }
}

This plandomizer file is creating two named groups: Field and FileSelect. The file also assigns those named groups to Hyrule Field and the Fairy Fountain, respectively, so that only those songs are randomly chosen for those locations.

The real power of named groups is that your song's .meta file can include a set of named groups. If any player uses one of those named groups for a location in their plando file, every custom song that includes that named group in its .meta file will be eligible to be chosen for that locations.

Your .meta file should include a comma-separated list of locations on the fourth line, as in the example below:

The Legend of Zelda: Spirit Tracks - Overworld Adventure
0x03
bgm
HyruleField,Fields,Outdoors,Overworld

This will automatically include the song in the HyruleField, Fields, Outdoors and Overworld named groups. A user can then reference the #Fields, #ZorasDomain or #HorseRace groups in their plando file, and this song will be a candidate for any of those locations. (Note that there is no # used in the .meta file.)

There are four levels of specificity for music groups: Exact, High, Mid, and Low. (For fanfares, high and mid specificity are the same group.) In order for our default plando files to work, you will need to include at least one group at each level of specificity. Otherwise, your song may be excluded from consideration when shuffling music. (Some groups, such as ChildDungeon, may cover multiple levels of specificity.)

We have created a standard list of default music groups that we are recommending for submissions to the repository. We also have a web tool that will automatically tell you which music groups to include, based on the locations where you want your songs to play, which you can find here. Otherwise, you can look at the list below (or look at this spreadsheet).

BGM

These are the individual groups that apply to a single song each, and they all have Exact specificity:

  • Hyrule Field: HyruleField
  • Lost Woods: LostWoods
  • Gerudo Valley: GerudoValley
  • Market: Market
  • Kakariko (child): KakarikoChild
  • Kakariko (adult): KakarikoAdult
  • Lon Lon Ranch: LonLonRanch
  • Kokiri Forest: KokiriForest
  • Goron City: GoronCity
  • Zora's Domain: ZorasDomain
  • Castle Courtyard: CastleCourtyard
  • Horse Race: HorseRace
  • Mini-game: Mini-game
  • Shooting Gallery: ShootingGallery
  • Fairy Fountain/File Select: FairyFountain
  • Temple of Time: TempleOfTime
  • Chamber of the Sages: ChamberOfTheSages
  • House: House
  • Shop: Shop
  • Potion Shop: PotionShop
  • Windmill Hut: WindmillHut
  • Inside the Deku Tree/Grotto: InsideDekuTree
  • Dodongo's Cavern/Death Mountain Crater/Dampe's Race/Gerudo Training Grounds: DodongosCavern
  • Inside Jabu-Jabu's Belly: JabuJabu
  • Forest Temple: ForestTemple
  • Fire Temple: FireTemple
  • Ice Cavern: IceCavern
  • Water Temple: WaterTemple
  • Shadow Temple/Bottom of the Well: ShadowTemple
  • Spirit Temple: SpiritTemple
  • Inside Ganon's Castle: CastleUnderground
  • Castle Escape: CastleEscape
  • Enemy Battle: Battle
  • Miniboss Battle: MinibossBattle
  • Standard Boss Battle: BossBattle
  • Fire Boss Battle: FireBoss
  • Ganondorf Battle: GanondorfBattle
  • Ganon Battle: GanonBattle
  • Title Screen: TitleTheme
  • Zelda's Theme: ZeldaTheme
  • Sheik's Theme: SheikTheme
  • Deku Tree's Theme (character): DekuTree
  • Kaepora Gaebora's Theme: KaeporaGaebora
  • Fairy/Owl Flying: FairyFlying
  • Ganondorf's Theme: GanondorfTheme
  • Kotake and Koume's Theme: KotakeAndKoume
  • Ingo's Theme: IngoTheme

High-specificity groups:

  • Fields: covers HyruleField, LostWoods, GerudoValley
  • Town: covers Market, KakarikoChild, KakarikoAdult, LonLonRanch, KokiriForest, GoronCity, ZorasDomain, CastleCourtyard
  • Fun: covers HorseRace, Mini-game, ShootingGallery
  • MagicalPlace: covers FairyFountain, TempleOfTime, ChamberOfTheSages
  • SalesArea: covers Shop, PotionShop
  • House
  • WindmillHut
  • ChildDungeon: covers all child dungeons (InsideDekuTree, DodongosCavern, JabuJabu)
  • AncientDungeon: covers ForestTemple, FireTemple
  • MysticalDungeon: covers IceCavern, WaterTemple, SpiritTemple
  • SpookyDungeon: covers ShadowTemple, CastleUnderground, CastleEscape
  • SmallFight: covers non-boss battle themes (Battle, MinibossBattle)
  • BossFight: covers BossBattle, FireBoss
  • FinalFight: covers GanondorfBattle, GanonBattle
  • HeroTheme: covers character themes for non-villains (TitleTheme, ZeldaTheme, SheikTheme, DekuTree, KaeporaGaebora, FairyFlying)
  • VillainTheme: covers villain themes (GanondorfTheme, KotakeAndKoume, IngoTheme)

Mid-specificity groups:

  • Outdoors: covers (almost) all outdoor overworld locations (HyruleField, LostWoods, GerudoValley, Market, KakarikoChild, KakarikoAdult, LonLonRanch, KokiriForest, GoronCity, ZorasDomain, CastleCourtyard, HorseRace, Mini-game)
  • Indoors: covers (almost) all indoor overworld locations (ShootingGallery, FairyFountain, TempleOfTime, ChamberOfTheSages, House, Shop, PotionShop, WindmillHut)
  • ChildDungeon: covers all child dungeons (InsideDekuTree, DodongosCavern, JabuJabu)
  • AdultDungeon: covers all adult dungeons (ForestTemple, FireTemple, IceCavern, WaterTemple, ShadowTemple, SpiritTemple, CastleUnderground, CastleEscape)
  • SmallFight: covers non-boss battle themes (Battle, MinibossBattle)
  • BigFight: covers boss battle themes (BossBattle, FireBoss, GanondorfBattle, GanonBattle)
  • HeroTheme: covers character themes for non-villains (TitleTheme, ZeldaTheme, SheikTheme, DekuTree, KaeporaGaebora, FairyFlying)
  • VillainTheme: covers villain themes (GanondorfTheme, KotakeAndKoume, IngoTheme)

Low-specificity groups:

  • Overworld: covers (almost) all overworld locations (HyruleField, LostWoods, GerudoValley, Market, KakarikoChild, KakarikoAdult, LonLonRanch, KokiriForest, GoronCity, ZorasDomain, CastleCourtyard, HorseRace, Mini-game, ShootingGallery, FairyFountain, TempleOfTime, ChamberOfTheSages, House, Shop, PotionShop, WindmillHut)
  • Dungeon: covers all dungeons (InsideDekuTree, DodongosCavern, JabuJabu, ForestTemple, FireTemple, IceCavern, WaterTemple, ShadowTemple, SpiritTemple, CastleUnderground, CastleEscape)
  • Fight: covers all battle themes (Battle, MinibossBattle, BossBattle, FireBoss, GanondorfBattle, GanonBattle)
  • CharacterTheme: covers all character themes, as well as the title theme and fairy/owl flying theme (TitleTheme, ZeldaTheme, SheikTheme, DekuTree, KaeporaGaebora, FairyFlying, GanondorfTheme, KotakeAndKoume, IngoTheme)

Ocarina Songs

These are the individual groups that apply to a single Ocarina song each, and they all have Exact specificity:

  • Prelude of Light: PreludeOfLight
  • Bolero of Fire: BoleroOfFire
  • Minuet of Forest: MinuetOfForest
  • Serenade of Water: SerenadeOfWater
  • Requiem of Spirit: RequiemOfSpirit
  • Nocturne of Shadow: NocturneOfShadow
  • Saria's Song: SariasSong
  • Epona's Song: EponasSong
  • Zelda's Lullaby: ZeldasLullaby
  • Sun's Song: SunsSong
  • Song of Time: SongOfTime
  • Song of Storms: SongOfStorms

High/mid-specificity groups:

  • WarpSong: includes all warp songs (PreludeOfLight, BoleroOfFire, MinuetOfForest, SerenadeOfWater, RequiemOfSpirit, NocturneOfShadow)
  • UtilitySong: includes all non-warp songs (SariasSong, EponasSong, ZeldasLullaby, SunsSong, SongOfTime, SongOfStorms)

Low-specificity groups:

  • SongFanfare: includes all ocarina songs (PreludeOfLight, BoleroOfFire, MinuetOfForest, SerenadeOfWater, RequiemOfSpirit, NocturneOfShadow, SariasSong, EponasSong, ZeldasLullaby, SunsSong, SongOfTime, SongOfStorms)

Fanfares

These are the individual groups that apply to a single fanfare each, and they all have Exact specificity:

  • Item Get: ItemGet
  • Heart Container Get: HeartContainerGet
  • Spirit Stone Get: SpiritStoneGet
  • Heart Piece Get: HeartPieceGet
  • Medallion Get: MedallionGet
  • Learn Song: LearnSong
  • Boss Defeated: BossDefeated
  • Epona Race Goal: EponaRaceGoal
  • Escape from Ranch: EscapeFromRanch
  • Treasure Chest: TreasureChest
  • Master Sword: MasterSword
  • Door of Time: DoorOfTime
  • Zelda Turns Around: ZeldaTurnsAround
  • Ganondorf Appears: GanondorfAppears
  • Game Over: GameOver

High/mid-specificity groups:

  • ItemFanfare: includes all collection-based fanfares (ItemGet, HeartContainerGet, SpiritStoneGet, HeartPieceGet, MedallionGet, LearnSong)
  • SuccessFanfare: includes BossDefeated, EponaRaceGoal, EscapeFromRanch
  • BigFanfare: includes TreasureChest, MasterSword, DoorOfTime
  • ZeldaTurnsAround
  • GanondorfAppears
  • GameOver

Low-specificity groups:

  • EventFanfare: includes all fanfares (ItemGet, HeartContainerGet, SpiritStoneGet, HeartPieceGet, MedallionGet, LearnSong, BossDefeated, EponaRaceGoal, EscapeFromRanch, TreasureChest, MasterSword, DoorOfTime, ZeldaTurnsAround, GanondorfAppears, GameOver)

Our goal is to eventually group every song in the Darunia's Joy repo into one or more of these named groups. Hopefully in the future, the randomizer can be improved with an "Location-Appropriate Songs" option, where songs can be automatically assigned from named groups even without a plandomizer file.

Randomizer music directory

Once you have these two files, put them both somewhere inside your randomizer's music directory. On Windows, that's usually something like C:\Users\(you)\AppData\Local\Programs\ootr-electron-gui\resources\app\python\data\Music, but your mileage may vary. Anywhere in this directory will work. A good tip is to create a separate Testing folder inside that directory, specifically for testing purposes.

Plandomizer/cosmetics files

Lastly, you need to make sure your song shows up in places where you can easily find and hear it. You can do this by supplying the randomizer with a cosmetics file. A music-specific cosmetics file is a .json file, and it will look something like this (the file says bgm, but fanfares also fall under this umbrella):

{
  ":version":         "6.0.0 Release",
    "bgm":              {
    "Fairy Fountain":       "Super Mario Galaxy - Beach Bowl Galaxy",
    "Kokiri Forest":        "Super Mario Galaxy - Beach Bowl Galaxy",
    "Item Get":             "Sonic the Hedgehog - Chaos Emerald"
  }
}

Keep the values on the left as they are, and change the values on the right to be the exact same as the song name from your .meta file. For testing music, we recommend replacing the "Fairy Fountain" and "Kokiri Forest" songs with your own custom songs. For testing fanfares, replacing the "Item Get" fanfare will let you try the song out easily in Mido's house.

You can grab a full BGM-specific cosmetics file here and edit it for your own convenience.

In order to make volume testing easier, it's good to create a randomizer seed that starts you in, or close to, Kokiri Forest. If you set the starting age to "Child" and turn off "Random Overworld Spawns", that will place you in Link's house as a child when you start a new file. (You could also download and use this plandomizer file for convenience, if you prefer.)

Tips and tricks

Size limit

You should avoid making your files too large, as larger files start introducing gradually more problems. As a general guideline, if your .seq file is less than 8KB, it shouldn't cause any more trouble than usual. Between 8KB and 12KB, you may see more issues (especially with fanfare shuffle turned on), and files above 12KB may cause even more issues. Songs larger than 20KB will simply not play at all.

Volume balancing

Make sure that your song is not horribly loud or horribly quiet. A good general guideline is that your song's volume should not overpower the waterfall in Kokiri Forest. Likewise, your song should not be drowned out by the waterfall either.

Instrument fade-out

As mentioned previously, some instruments will sustain themselves indefinitely for as long as the MIDI note is specified (strings, flute, clarinet, etc). You can use volume bend to make these instruments fade out.

Channel priority

If your song has a lot of tracks, the game might drop some of those tracks in order to play sound effects in areas with a lot of sound. If you want to make sure that the most important tracks aren't dropped (such as the lead melody, or the bass line), you can add channel priority information to your song. If you open up your song in SEQ64 V1 and go to each channel's first Chn event, you can add a Channel Priority command. Higher values indicate higher priority; the channel with the lowest priority value will get dropped first.

SEQ64 - Channel priority

{
":version": "6.0.0 Release",
"bgm": {
"Hyrule Field": "Hyrule Field",
"Dodongos Cavern": "Dodongos Cavern",
"Kakariko Adult": "Kakariko Adult",
"Battle": "Battle",
"Boss Battle": "Boss Battle",
"Inside Deku Tree": "Inside Deku Tree",
"Market": "Market",
"Title Theme": "Title Theme",
"House": "House",
"Jabu Jabu": "Jabu Jabu",
"Kakariko Child": "Kakariko Child",
"Fairy Fountain": "Fairy Fountain",
"Zelda Theme": "Zelda Theme",
"Fire Temple": "Fire Temple",
"Forest Temple": "Forest Temple",
"Castle Courtyard": "Castle Courtyard",
"Ganondorf Theme": "Ganondorf Theme",
"Lon Lon Ranch": "Lon Lon Ranch",
"Goron City": "Goron City",
"Miniboss Battle": "Miniboss Battle",
"Temple of Time": "Temple of Time",
"Kokiri Forest": "Kokiri Forest",
"Lost Woods": "Lost Woods",
"Spirit Temple": "Spirit Temple",
"Horse Race": "Horse Race",
"Ingo Theme": "Ingo Theme",
"Fairy Flying": "Fairy Flying",
"Deku Tree": "Deku Tree",
"Windmill Hut": "Windmill Hut",
"Shooting Gallery": "Shooting Gallery",
"Sheik Theme": "Sheik Theme",
"Zoras Domain": "Zoras Domain",
"Shop": "Shop",
"Chamber of the Sages": "Chamber of the Sages",
"Ice Cavern": "Ice Cavern",
"Kaepora Gaebora": "Kaepora Gaebora",
"Shadow Temple": "Shadow Temple",
"Water Temple": "Water Temple",
"Gerudo Valley": "Gerudo Valley",
"Potion Shop": "Potion Shop",
"Kotake and Koume": "Kotake and Koume",
"Castle Escape": "Castle Escape",
"Castle Underground": "Castle Underground",
"Ganondorf Battle": "Ganondorf Battle",
"Ganon Battle": "Ganon Battle",
"Fire Boss": "Fire Boss",
"Mini-game": "Mini-game"
}
}
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment