Difference between revisions of "Creating cave music"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
m
 
(50 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
The BMS file type is a sequenced music format used in many games. For the cave music in Pikmin 2 however, it is specially-formatted. It mainly contains many short snippets of musical information to be randomized.
 
The BMS file type is a sequenced music format used in many games. For the cave music in Pikmin 2 however, it is specially-formatted. It mainly contains many short snippets of musical information to be randomized.
  
The CND files are the actual "songs"; they take specific groups of snippets from a BMS file, and endlessly puzzle-piece them together to form a coherent piece of music.
+
The CND files are the actual "songs"; they take specific groups of snippets from a BMS file, and endlessly puzzle-piece them together to form a coherent piece of music.  
  
This guide will cover function as a walkthrough for creating your own randomly sequencing cave song. Most of the editing will be done in hexadecimal.
+
This guide will function as a walkthrough for creating your own randomly sequencing cave song. Basic understanding of how [https://youtube.com/watch?v=QPFWzSlg-78 cave music works] and [[Creating Interactive BMS Files|standard interactive music]] is recommended before starting. Most of the editing will be done in hexadecimal.
  
 
''Requirements:''
 
''Requirements:''
* A basic understanding of hexadecimal, and a hex editor. An editor that can dynamically resize the window is ideal. (Hex Fiend on Mac OS is a fantastic example).
+
* A DAW to create your own short MIDIs in, like FL Studio or Logic Pro. A DAW is also great for sketching out your song ideas/song's structure beforehand.
* A DAW to create your own short MIDIs in, like FL Studio or Logic Pro. A DAW is also great for sketching out your song ideas beforehand.
+
* A MIDI to BMS converter, like [[Pikmin 2 custom music|flaaffy]]. You will be generating a lot of tiny BMS files, to turn them into "gestures".
* A MIDI to BMS converter, like flaaffy. You will be generating a lot of tiny BMS files, to turn them into "gestures".
+
* A basic understanding of hexadecimal, and a hex editor. An editor that can dynamically resize the window is ideal (HxD on Windows, or Hex Fiend on MacOS are fantastic examples).
 +
 
 +
Additionally, studying the existing cave songs on your own and how those exploit the conductor system in interesting ways will help you come up with ideas for your own custom cave music.
  
 
== Overview of file functions ==
 
== Overview of file functions ==
Here are some infographics that you can reference at any time.
+
Here are some infographics that you can reference at any time. These show all the functions of a CND file, and all the contents of a BMS file.
 
<gallery mode="packed-hover" widths=250px heights=250px>
 
<gallery mode="packed-hover" widths=250px heights=250px>
 
File:CND_functions.png|Conductor file functions.
 
File:CND_functions.png|Conductor file functions.
Line 20: Line 22:
  
 
== Setting up your BMS file ==
 
== Setting up your BMS file ==
 +
Before you begin, set your byte grouping to "3", so every 3 bytes is visually separated by a space. This will make it easier to see stuff.<br><br>
 
Starting with a completely blank BMS file, begin by pasting the following:
 
Starting with a completely blank BMS file, begin by pasting the following:
 
<source lang="powershell">
 
<source lang="powershell">
AC100000 AC11016E CC0210CC 0311AC10 0000AC11 01A1CC04 10CC0511 E70300A0 0003A401 00A30001 C8010000 3CB1C180 0100007F A50101C8 00000025 FE0078C4 00000058 C600E70E 00DF0700 006AE72E 00CF03C8 0000004E E70E00DF 0700006A E72E00CF 03C80000 0060E71E 00E3E700 00E70F00 DF070000 7BC600E7 1F00E3C4 0000006E C4000001 55E70600 CF03E708 00CF03CB 0306E709 00A00003 A70002C8 01000096 A70001C8 0100008E A70003C4 010000BE C4000000 C2C80000 0096DA00 C600E70A 00E70C00 A00003A7 0000C801 0000F0A7 0001C801 000104A7 0002C801 0000FAA7 0003C801 00010EC8 00000109 C4000001 18C80000 0109C400 000118C8 000000C5 C4000001 42E70B00 C600C400 000142C8 000000C5 CB0610CB 0711CB08 04A00504 A93C0580 00A70500 C4010001 4EA93C04 7FFFCF04 E70D00C4 010000BE C600CB08 04A93C04 7FFFCF04 C600B1C1 400028C6 00DB04EF 616161C6 00DB00A4 0801A409 00A40A01 EF342134
+
AC1000 00AC11 016ECC 0210CC 0311AC 100000 AC1101 8FCC04 10CC05 11E703 00A000 03A401 00A300 01C801 00003C B1C180 010000 7FA501 01C800 000025 FE0078 C40000 0058C6 00E70E 00DF07 00006A E72E00 CF03C8 000000 4EE70E 00DF07 00006A E72E00 CF03C8 000000 60E71E 00E3E7 0000E7 0F00DF 070000 7BC600 E71F00 E3C400 00006E C40000 0155E7 0600CF 03E708 00CF03 CB0306 E70900 A00003 A70002 C80100 0096A7 0001C8 010000 8EA700 03C401 0000BE C40000 00C2C8 000000 96DA00 C600E7 0A00E7 0C00A0 0003A7 0000C8 010000 F0A700 01C801 000104 A70002 C80100 00FAA7 0003C8 010001 0EC800 000109 C40000 0118C8 000001 09C400 000118 C80000 00C5C4 000001 42E70B 00C600 C40000 0142C8 000000 C5CB06 10CB07 11CB08 04A005 04A93C 058000 A70500 C40100 014EA9 3C047F FFCF04 E70D00 C40100 00BEC6 00CB08 04A93C 047FFF CF04C6 00B1C1 400028 C600DB 04EF61 6161C6 00DB00 A40801 A40900 A40A01 EF3421 34C600
 
</source>
 
</source>
Every cave music BMS begins with this same information.
+
Every cave music BMS begins with this same information, and will go mostly untouched.
 
<br>
 
<br>
 
<br>
 
<br>
== Gesture set locations ==
+
 
Right after <code>EF342134</code> will be a list of every gesture set's location. This section begins with <code>C600</code>, followed by a sequence of offsets. Each entry in this sequence is separated by "<code>00</code>". <code>FFFFFF</code> indicates the end of this list.<br><br>
+
== Gesture set list ==
 +
Exactly right after <code>34C600</code> will be a list of every gesture set's location in the BMS. Each entry is the gesture set's hexadecimal location (offset), and each entry in the sequence begins with "<code>00</code>". <code>FFFFFF</code> indicates the end of this list.<br><br>
 
Here is an example of how this sequence should be formatted:<br>
 
Here is an example of how this sequence should be formatted:<br>
<code>C600 0001B0 0001BF 0001CE 0001D4 0001DA 0001E9 0001F8 0001FE 000204 00020A FFFFFF</code><br>
+
<code>0001B0 0001BF 0001CE 0001D4 0001DA 0001E9 0001F8 0001FE 000204 00020A FFFFFF</code><br>
Gesture set "0" will be at <code>0x1B0</code>, gesture set "1" will be at <code>0x1BF</code>, gesture set "2" will be at <code>0x1CE</code>, and so on. There are a total of 10 gesture sets listed in the above sequence.
+
Gesture set "0" will be at offset <code>0x1B0</code>, gesture set "1" will be at offset <code>0x1BF</code>, gesture set "2" will be at <code>0x1CE</code>, and so on. There are a total of 10 gesture sets listed in the above sequence.
 
<br><br>
 
<br><br>
Until we create our gesture sets, let's use <code>AAAA</code> as placeholders for each so we can find this section easily later on. You can have as many gesture sets as you like, but for this tutorial, we will create 16 of them. You may insert this into your BMS:<br>
+
Until we create our gesture sets, let's use <code>00AAAA</code> as placeholders so we can easily find and get back to this section later on. You can have as many gesture sets as you like; we'll create 16 entries for this tutorial. You may insert this into your BMS:<br>
<code>C600 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF</code><br>
+
<code>00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF</code><br>
 
<br>
 
<br>
 
Our BMS should now currently look like this:<br>
 
Our BMS should now currently look like this:<br>
 
<source lang="powershell">
 
<source lang="powershell">
AC100000 AC11016E CC0210CC 0311AC10 0000AC11 01A1CC04 10CC0511 E70300A0 0003A401 00A30001 C8010000 3CB1C180 0100007F A50101C8 00000025 FE0078C4 00000058 C600E70E 00DF0700 006AE72E 00CF03C8 0000004E E70E00DF 0700006A E72E00CF 03C80000 0060E71E 00E3E700 00E70F00 DF070000 7BC600E7 1F00E3C4 0000006E C4000001 55E70600 CF03E708 00CF03CB 0306E709 00A00003 A70002C8 01000096 A70001C8 0100008E A70003C4 010000BE C4000000 C2C80000 0096DA00 C600E70A 00E70C00 A00003A7 0000C801 0000F0A7 0001C801 000104A7 0002C801 0000FAA7 0003C801 00010EC8 00000109 C4000001 18C80000 0109C400 000118C8 000000C5 C4000001 42E70B00 C600C400 000142C8 000000C5 CB0610CB 0711CB08 04A00504 A93C0580 00A70500 C4010001 4EA93C04 7FFFCF04 E70D00C4 010000BE C600CB08 04A93C04 7FFFCF04 C600B1C1 400028C6 00DB04EF 616161C6 00DB00A4 0801A409 00A40A01 EF342134 C60000AA AA00AAAA 00AAAA00 AAAA00AA AA00AAAA 00AAAA00 AAAA00AA AA00AAAA 00AAAA00 AAAA00AA AA00AAAA 00AAAA00 AAAAFFFF FF
+
AC1000 00AC11 016ECC 0210CC 0311AC 100000 AC1101 8FCC04 10CC05 11E703 00A000 03A401 00A300 01C801 00003C B1C180 010000 7FA501 01C800 000025 FE0078 C40000 0058C6 00E70E 00DF07 00006A E72E00 CF03C8 000000 4EE70E 00DF07 00006A E72E00 CF03C8 000000 60E71E 00E3E7 0000E7 0F00DF 070000 7BC600 E71F00 E3C400 00006E C40000 0155E7 0600CF 03E708 00CF03 CB0306 E70900 A00003 A70002 C80100 0096A7 0001C8 010000 8EA700 03C401 0000BE C40000 00C2C8 000000 96DA00 C600E7 0A00E7 0C00A0 0003A7 0000C8 010000 F0A700 01C801 000104 A70002 C80100 00FAA7 0003C8 010001 0EC800 000109 C40000 0118C8 000001 09C400 000118 C80000 00C5C4 000001 42E70B 00C600 C40000 0142C8 000000 C5CB06 10CB07 11CB08 04A005 04A93C 058000 A70500 C40100 014EA9 3C047F FFCF04 E70D00 C40100 00BEC6 00CB08 04A93C 047FFF CF04C6 00B1C1 400028 C600DB 04EF61 6161C6 00DB00 A40801 A40900 A40A01 EF3421 34C600 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
 
</source>
 
</source>
 +
You can also add an entire row of padding/zeros after this. You can do this for each section, to better visually separate them.
 
<br>
 
<br>
== Timing ruleset locations ==
+
 
Right after <code>FFFFFF</code> will be a list of every timing ruleset; this is another sequence of offsets. These reference "timetables", which will be located at the end of our BMS file. <code>FFFFFF</code> indicates the end of this list.<br><br>
+
== Timing ruleset list ==
 +
This is another sequence of offsets. These just point to the location of a "[[#Inserting_timetables|timetable]]", which will be located at the end of our BMS file. <code>FFFFFF</code> indicates the end of this list.<br><br>
 
Here is an example of how this sequence should be formatted:<br>
 
Here is an example of how this sequence should be formatted:<br>
 
<code>0005AB 0005AB 0005AF 0005C1 0005AB 0005AB 0005C1 0005C1 0005C1 0005C1 FFFFFF</code><br>
 
<code>0005AB 0005AB 0005AF 0005C1 0005AB 0005AB 0005C1 0005C1 0005C1 0005C1 FFFFFF</code><br>
Timing ruleset "0" will use the timetable at <code>0x5AB</code>, timing ruleset "1" will use the timetable at <code>0x5AF</code>, timing ruleset "2" will use the timetable at <code>0x5C1</code>, and so on. There are a total of 10 timing rulesets listed in the above sequence.
+
Timing ruleset "0" will use the timetable at <code>0x5AB</code>, timing ruleset "1" will also use the timetable at <code>0x5AB</code>, timing ruleset "2" will use the timetable at <code>0x5AF</code>, and so on. There are a total of 10 timing rulesets listed in the above sequence.
 
<br><br>
 
<br><br>
Let's use <code>BBBB</code> as placeholders again, and create 16 of them. Insert this into your BMS:<br>
+
Let's use <code>00BBBB</code> as placeholders again, and create 16 of them. Insert this anywhere into your BMS:<br>
 
<code>00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB FFFFFF</code><br>
 
<code>00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB FFFFFF</code><br>
 
<br>
 
<br>
== Gesture sets ==
+
 
A gesture set is a sequence containing the location of every gesture it will use. Once again, these locations are the offsets of each gesture. You can have as many gestures as you want in a gesture set, and as many gesture sets as you want. Each gesture set ends with <code>FFFFFF</code>.<br><br>
+
== Gesture set contents ==
 +
A ''gesture set'' is a group of many gestures.<br>
 +
Here, we list each gesture set's contents (which will be... the locations of the gestures!). Each gesture set begins before with <code>00</code> and ends with <code>FFFFFF</code>.<br><br>
 
Here is an example of how the gesture set list should be formatted:<br>
 
Here is an example of how the gesture set list should be formatted:<br>
 
<code>000210 00022A 000258 000281 FFFFFF 0002B4 0002D9 000303 000331 FFFFFF 000355 FFFFFF 000361 FFFFFF 0003A8 0003C2 0003F0 000419 FFFFFF 00044C 000471 00049B 0004C9 FFFFFF 0004ED FFFFFF 000543 FFFFFF 000580 FFFFFF 00059E FFFFFF</code><br>
 
<code>000210 00022A 000258 000281 FFFFFF 0002B4 0002D9 000303 000331 FFFFFF 000355 FFFFFF 000361 FFFFFF 0003A8 0003C2 0003F0 000419 FFFFFF 00044C 000471 00049B 0004C9 FFFFFF 0004ED FFFFFF 000543 FFFFFF 000580 FFFFFF 00059E FFFFFF</code><br>
There are 10 gesture sets listed above. Some of them have 4 gestures within them, while others only have 1 gesture. You can have any amount of gestures in a gesture set.
+
There are 10 gesture sets listed above. The first gesture set has 4 gestures, located at <code>0x210</code>, <code>0x22A</code>, <code>0x258</code>, and <code>0x281</code>. You can have any amount of gestures in a gesture set; even 1 is fine.
 
<br><br>
 
<br><br>
You can paste the following placeholder information for now:
+
You can paste the following placeholder information for now:<br>
 
<code>00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC FFFFFF</code><br>
 
<code>00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC FFFFFF</code><br>
This list has 4 gesture sets, containing 3 gestures each, except the last one, which only has 1. You can expand this list at any time to add more gesture sets, so it might be a good idea to leave a lot of padding/zeros after this.
+
It might be a good idea to leave a decent amount of zeros after this list; this one will expand a lot as gestures and gesture sets are added to it.
 
<br><br>
 
<br><br>
 +
 
== How is your BMS looking? ==
 
== How is your BMS looking? ==
If you have been copy-pasting everything correctly, your BMS will look like this:
+
If you have been copy-pasting everything correctly, your BMS will look something like this:
<source lang="powershell">
+
<gallery mode="packed-hover" widths=300px heights=300px>
AC100000 AC11016E CC0210CC 0311AC10 0000AC11 01A1CC04 10CC0511 E70300A0 0003A401 00A30001 C8010000 3CB1C180 0100007F A50101C8 00000025 FE0078C4 00000058 C600E70E 00DF0700 006AE72E 00CF03C8 0000004E E70E00DF 0700006A E72E00CF 03C80000 0060E71E 00E3E700 00E70F00 DF070000 7BC600E7 1F00E3C4 0000006E C4000001 55E70600 CF03E708 00CF03CB 0306E709 00A00003 A70002C8 01000096 A70001C8 0100008E A70003C4 010000BE C4000000 C2C80000 0096DA00 C600E70A 00E70C00 A00003A7 0000C801 0000F0A7 0001C801 000104A7 0002C801 0000FAA7 0003C801 00010EC8 00000109 C4000001 18C80000 0109C400 000118C8 000000C5 C4000001 42E70B00 C600C400 000142C8 000000C5 CB0610CB 0711CB08 04A00504 A93C0580 00A70500 C4010001 4EA93C04 7FFFCF04 E70D00C4 010000BE C600CB08 04A93C04 7FFFCF04 C600B1C1 400028C6 00DB04EF 616161C6 00DB00A4 0801A409 00A40A01 EF342134 C60000AA AA00AAAA 00AAAA00 AAAA00AA AA00AAAA 00AAAA00 AAAA00AA AA00AAAA 00AAAA00 AAAA00AA AA00AAAA 00AAAA00 AAAAFFFF FF00BBBB 00BBBB00 BBBB00BB BB00BBBB 00BBBB00 BBBB00BB BB00BBBB 00BBBB00 BBBB00BB BB00BBBB 00BBBB00 BBBB00BB BBFFFFFF 00CCCC00 CCCC00CC CCFFFFFF 00CCCC00 CCCC00CC CCFFFFFF 00CCCC00 CCCC00CC CCFFFFFF 00CCCCFF FFFF0000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
+
File:BMS_file_progress_1.png|Orange is "gesture set list", yellow is "timing ruleset list", and blue is "gesture set contents"
</source>
+
</gallery>
 +
Once again, you can add as much padding between each section as you want, it will work fine.
 +
 
 
== Creating gestures ==
 
== Creating gestures ==
 
First, you should sketch out your song idea in your DAW, and then cut your song into tiny blocks. These blocks will be your song's individual gestures. You should also consider dragging these blocks around in various arrangements to make sure they sound good in any order.<br><br>
 
First, you should sketch out your song idea in your DAW, and then cut your song into tiny blocks. These blocks will be your song's individual gestures. You should also consider dragging these blocks around in various arrangements to make sure they sound good in any order.<br><br>
Line 71: Line 82:
 
File:Logic_Pro_gestures.png|A Logic Pro project with a bunch of short blocks of music. Each block will be a "gesture".
 
File:Logic_Pro_gestures.png|A Logic Pro project with a bunch of short blocks of music. Each block will be a "gesture".
 
</gallery>
 
</gallery>
For some reason, imported BMS files play 4 times as slow in cave songs. If you import these gestures as it, they will play 4 times as slow.<br>
+
For some reason, imported BMS files play 4 times as slow in cave songs. So if you import these gestures as is, they will play 4 times as slow.<br>
So before you export your gestures, you need to modify your gestures to run ''4 times as fast''. How you will go about this will depend on your DAW; some will allow you to stretch entire regions of notes easily.<br>
+
Before you export your gestures, you need to modify your gestures to run ''4 times as fast''. How you will go about this will depend on your DAW; some will allow you to stretch entire regions of notes easily.<br><br>
 
Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the "Double Speed" transformation twice on each block.
 
Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the "Double Speed" transformation twice on each block.
 +
<gallery mode="packed-hover" widths=400px heights=400px>
 +
File:Logic_pro_double_speed.gif|Shorten the length of the MIDI by 4x, but don't change your project's tempo.
 +
</gallery>
 +
 +
== Inserting gestures ==
 +
Gestures use same the note/music information as standard BMS songs.<br>
 +
 +
You should have converted all your MIDIs into BMS files. Open up one of your converted BMS files, and look for the first note/pitch value. If you used [[Pikmin 2 custom music|flaaffy]], this will most likely be somewhere after <code>0x1B</code>, <code>0x1C</code>, or <code>0x1D</code>. The note's pitch value will often be followed by a <code>01</code>, then the velocity value. Copy this note, all the way to the end of the sequence, which should be <code>FF</code>.
 +
<gallery mode="packed-hover" widths=600px>
 +
File:Copy_pasting_BMS_info.png|The value "2D" here is the hex value of a certain pitch, and the very first note of the sequence. Copy this, all the way to "FF".
 +
</gallery>
 +
To add your gesture, start it with <code>C40000015D</code>, then paste in what you copied. Each gesture should end with that <code>FF</code>. Add as many gestures as you please!
 +
<gallery mode="packed-hover" widths=400px heights=400px>
 +
File:BMS_file_progress_2.png|The purple lines indicate where a gesture starts.
 +
</gallery>
 +
 +
== Inserting timetables ==
 +
So, how do we choose how often gestures will play? Will a gesture play every beat? Every 1/2 a beat? You will need to add a timetable for that!
 +
A timetable is a sequence that dictates when gestures should play. A timetable ends with <code>FFFF</code>. You can make a timetable as complex as you like.<br> Some examples of timetables you can use are:<br>
 +
* <code>0780 FFFF</code> Play a gesture every 16 beats.<br>
 +
* <code>03C0 FFFF</code> Play a gesture every 8 beats.<br>
 +
* <code>01E0 FFFF</code> Play a gesture every 4 beats.<br>
 +
* <code>03C0 03C0 03C0 01E0 01E0 01E0 01E0 03C0 FFFF</code> This sequence will play a gesture every 8 beats (3x), play a gesture every 4 beats (4x), then play a gesture for 8 beats (1x), in that order.<br>
 +
* <code>00F0 FFFF</code> Play a gesture every 1/2 note (every 2 beats).<br>
 +
* <code>0078 FFFF</code> Play a gesture every 1/4 note (every beat).<br>
 +
* <code>003C FFFF</code> Play a gesture every 1/8th note.<br>
 +
* <code>001E FFFF</code> Play a gesture every 1/16th note.<br>
 +
* <code>003C 0078 001E FFFF</code> This sequence will play a gesture for an 1/8th note, play a gesture for a 1/4 note, then play a gesture for a 1/16th note, in that order.<br>
 +
Considering that <code>001E</code> (30 in decimal) is a 1/16th note, you can create any specific timing you want. Just add another 30 to the value for each additional sixteenth note in length.<br>
 +
For example, Soil 1's enemy mix piano plays a gesture every three sixteenth notes. That would be 90 in decimal, and its timetable would look like <code>005A FFFF</code>.<br>
 +
You can insert your timetables anywhere at the end of your BMS.
 +
<gallery mode="packed-hover" widths=250px heights=250px>
 +
File:BMS_file_progress_3.png|Each timetable has a pink box around it.
 +
</gallery>
 +
 +
== Filling in info ==
 +
Once you have your gestures and timetables inserted, go back and fill in those <code>00AAAA</code>, <code>00BBBB</code>, <code>00CCCC</code> placeholders with the locations of your gesture sets, timetables, and gestures you want to use. Remember that gesture sets begin with the <code>00</code>.
 +
 +
Also in the very beginning of your BMS, make sure the value at <code>0x6</code> has the location of where your gesture set list begins (this one will probably be fine), and the value at <code>0x14</code> has the location of where your timing ruleset list begins.
 +
<gallery mode="packed-hover" widths=250px heights=250px>
 +
File:BMS_file_progress_4.png|Put the location of where the "timing ruleset list" begins here.
 +
</gallery>
 +
 +
== Filling in the conductor file ==
 +
<gallery mode="packed-hover" widths=500px heights=500px>
 +
File:CND_functions.png|Conductor file functions.
 +
</gallery>
 +
In your song's associated conductor file, try to stretch out the window so that the instrument names are all in the same column if you can, like in the image above.<br><br>
 +
Each line represents one track. You give each track a instrument (program), and what gesture set and timing ruleset to use.<br>
 +
The CND infographic above does a good job explaining all the functions, but they'll be explained again down here.<br><br>
 +
 +
In the top left corner are three important values:
 +
* The first value is the swing time. <code>1E</code> is 1/16th swing, while <code>3C</code> is 1/8th swing. If your song is below 100bpm, you might want to use <code>1E</code>. If its faster, try <code>3C</code> instead.
 +
* The second value is the tempo, in hex.
 +
* The third value is how many tracks there will be, in hex.
 +
 +
Each column explained:
 +
* A: Initial delay. How many beats until this track starts running. In the vanilla game, you can notice how some song's melodies do not immediately begin playing upon the start of the level. This is useful for that; ease the listener into the music.
 +
* B/Q: If set to 1, all gestures will be delayed by an 1/8th note.
 +
* C: Text string. You can make this say whatever you like. Useful for keeping track of what you want each track to be, like "Lead", "Trumpet", "MelodyA"/"MelodyB", "Bass", or "Drums"
 +
* D: Track copy. Select a previous track # to copy the gestures from. If the track its copying plays "gesture 3" from its gesture set, this track will also play its "gesture 3". Often used for treasure mix instruments. You can have them use different gesture sets if you like.
 +
* E: Echo strength.
 +
* F: If set to 1, the values in this track's timetable will always be played in order, in a loop. If set to 0, it will randomly select values from its timetable, thus, allowing you to randomize when gestures play.
 +
* G: Bank number.
 +
* H: Program number. For a list of all programs in the default game and the wScenes that support them, view [[Pikmin 2 custom_music/available instruments|this page]].
 +
* I: Gesture set, select the set # you want to use from the BMS.
 +
* J: Timing ruleset, select the set # you want to use from the BMS.
 +
* K: How many gestures this track will play, before playing "silent gestures". Linked to below. These function as a sort of on/off cycle.
 +
* L: How many "silent gestures" this track will play, before playing normal gestures. Linked to above. These function as a sort of on/off cycle.
 +
* M: If notes are being transposed down (see below), this is set to FF. But this column doesn't actually do anything, so you don't need to edit this.
 +
* N: Transpose all notes played by this track. To transpose up, use values 1-127. To transpose down, use the sign 2 compliment (values 128-255).
 +
* O: Volume.
 +
* P: Stereo panning.
 
<br>
 
<br>
== Inserting gestures ==
+
Some ideas/considerations:
Gestures are basically formatted the same way as any normal musical information in a BMS file.
+
* You can use the on/off cycle feature (column K and L) to make your melodic instrument "take a break" every once in a while. You can have it play 4 gestures, but then be silent for 2.
A gesture begins with <code>C40000015D</code>, and then right after will be the hexadecimal value of the first note's pitch.
+
* If your timing ruleset is strict (as in, the timings for when gestures occur is always consistent), something fun to try is to have the melody be a back-and-forth between two different instruments. Set the initial delay for the second instrument to be longer than the first one, and then cleverly use the on/off cycle to have the instruments take turns sounding a gesture. This is done for the melody in the Bulblax Kingdom and Frontier Cavern for example.
 +
* If you are using the "track copy" feature (column D), you can have the primary instrument play a melody, and have this instrument always play chords that perfectly match that melody.
 +
 
 +
== Mapping the tracks ==
 +
With all that done, don't forget to edit the song's [[Trackmap parameters|trackMap]]! Edit your song in the trackMap files in either <code>/user/Totaka</code> or <code>/user/Wakai</code>, and set how many instruments will be in each mix. It goes in order from: Main Mix, Task (event), Treasure (otakara), Enemy near (kehai), Combat mix, and Spiderwort mix (ground). Although you cannot find Spiderworts underground, you will have to sacrifice at least one track for that mix. You cannot set any of the mixes to have 0 tracks in them.
 +
 
 +
== Bonus: Filenames for brand new CND files ==
 +
If you are adding a brand new CND file instead of replacing an existing one, the prefix will determine which BMS is loaded, and which wScene. Try not to add special characters to filenames, aside from underscores.<br>
 +
 
 +
In order to load the correct BMS file, the CND must start with the name of the BMS file.
 +
* "caveconc.cnd", "caveconc_458435.cnd", "caveconc_Waffles.cnd", and "caveconc_Waffles_Song_2.cnd" will all load caveconc.bms.<br>
 +
* "caverelax.cnd", "caverelax_Gmajor.cnd", and "caverelax_mamuta_dinner.cnd" will all load caverelax.bms.<br>
 +
* "new_09_4.cnd", "new_09_4000.cnd", and "new_09_portal_PotaTOS.cnd" will load new_09.bms.<br>
 +
 
 +
For cavesoil, caveconc, and cavemetal only, the game also checks for an additional "_00", "_05", and "_10" right after the prefix, for the purpose of loading one of three different wScenes. You must include it if you want the correct wScene to load. For example, caveconc_05 loads wScene 31, so if you want your custom song to also load wScene 31, acceptable names include "caveconc_05_WAFFLES.cnd", "caveconc_05_52_46356.cnd", or "caveconc_05_super_boss.cnd".<br>
 +
 
 +
After adding your new CND file, be sure to add it to its respective trackMap file.
 +
 
 +
== Bonus: Adding new content to a vanilla BMS file ==
 +
Adding new hex data in the middle of a file will shift all the offsets that come after it, causing your BMS to jump to the wrong locations, and likely cause a crash if vanilla songs are loaded.<br>
 +
In order to add new content in addition to what's already in the BMS:
 +
* Find and copy the gesture set list and the timing ruleset list, and paste them at the end of the file. (Separate them with lots of zeros so you have lots more space to add content to these lists)
 +
* Change <code>0x6</code> and <code>0x14</code> to point to your new gesture set list and timing ruleset list. These two values tell the game where the lists are.
 +
The game should now use these brand new lists, instead of the original instances that occur earlier in the file. Since they still contain all the locations of the vanilla gesture sets/timetables from above in the same order, the existing CND songs won't be affected and will continue to function, but now you can expand upon these lists with brand new entries now that you've made the space for them. All new gestures, gesture sets and timetables can be added further down the file.
 +
<gallery mode="packed-hover" widths=400px heights=400px>
 +
File:Editing_vanilla_BMS_file.png|The new gesture set list and timing ruleset list we want to use will be at the bottom.
 +
</gallery>
 +
 
 +
== Bonus: Adding gesture cutoffs in timetables ==
 +
An intentional compositional choice in some songs is to cutoff gestures while they're in the middle of playing. The most common way this is done is to quickly trigger another gesture; if the last gesture has not finished playing, it will stop playing that gesture and begin playing the new one. It's also possible to add "empty" gestures to gesture sets (like <code>C40000015DFF</code>, a gesture which ends immediately and plays nothing), so you can randomly interrupt gestures in your song with silence, or have there be a chance to play nothing.<br><br>
 +
However, if you wish to interrupt gestures in your song at specified times without the randomness, there is a special function in timetables for doing this. In the vanilla game, this is used for the trumpet in [https://www.youtube.com/watch?v=qOhmS1YLpF8 Fire]. The trumpet plays two interrupted gestures, then plays a third gesture in full. Below is the timetable for this trumpet:<br>
 +
<code>0078 8168 81E0 00F0 80F0 81E0 0780 FFFF</code><br>
 +
The trumpet will:
 +
* <code>0078</code> play a gesture for 1 beat
 +
* <code>8168</code> cutoff after this 1 beat
 +
* <code>81E0</code> extend the silence for another 4 beats
 +
* <code>00F0</code> play a gesture for 2 beats
 +
* <code>80F0</code> cutoff after these 2 beats
 +
* <code>81E0</code> extend the silence for another 4 beats
 +
* <code>0780</code> play a gesture for 16 beats.<br><br>
 +
In order to put a "cutoff" in your timetable:
 +
* Start with how long you want your "playing" gesture to play for, before it gets cutoff. I want the the first gesture to last for one beat (four 1/16th notes), so I'll put <code>0078</code>. Remember that every "30" in decimal is equivalent to a sixteenth note.
 +
* Immediately next in the sequence will be a value that indicates when the cutoff begins. Calculate the difference between "81E0" and the previous value you had just inserted. 81E0 - 0078 = 8168 (in decimal, 33248 - 120 = 33128). I will put <code>8168</code> next in my sequence.
 +
My sequence is now <code>0078 8168 FFFF</code>; this will play a gesture normally for 1 beat, but then immediately cut it off after that 1 beat.<br>
 +
Putting an additional <code>81E0</code> in the sequence right after will extend the silence for another 4 beats if you so desire. You can keep putting <code>81E0</code> right after several times in a row if you want silence to last extra long until the next gesture plays.
 +
 
 
[[Category:Pikmin 2]]
 
[[Category:Pikmin 2]]

Latest revision as of 15:12, 2 October 2024

Randomly generating cave music in Pikmin 2 needs to have two files: a .bms (sequence) file, and a .cnd (conductor) file.

The BMS file type is a sequenced music format used in many games. For the cave music in Pikmin 2 however, it is specially-formatted. It mainly contains many short snippets of musical information to be randomized.

The CND files are the actual "songs"; they take specific groups of snippets from a BMS file, and endlessly puzzle-piece them together to form a coherent piece of music.

This guide will function as a walkthrough for creating your own randomly sequencing cave song. Basic understanding of how cave music works and standard interactive music is recommended before starting. Most of the editing will be done in hexadecimal.

Requirements:

  • A DAW to create your own short MIDIs in, like FL Studio or Logic Pro. A DAW is also great for sketching out your song ideas/song's structure beforehand.
  • A MIDI to BMS converter, like flaaffy. You will be generating a lot of tiny BMS files, to turn them into "gestures".
  • A basic understanding of hexadecimal, and a hex editor. An editor that can dynamically resize the window is ideal (HxD on Windows, or Hex Fiend on MacOS are fantastic examples).

Additionally, studying the existing cave songs on your own and how those exploit the conductor system in interesting ways will help you come up with ideas for your own custom cave music.

Overview of file functions[edit]

Here are some infographics that you can reference at any time. These show all the functions of a CND file, and all the contents of a BMS file.

Setting up your BMS file[edit]

Before you begin, set your byte grouping to "3", so every 3 bytes is visually separated by a space. This will make it easier to see stuff.

Starting with a completely blank BMS file, begin by pasting the following:

AC1000 00AC11 016ECC 0210CC 0311AC 100000 AC1101 8FCC04 10CC05 11E703 00A000 03A401 00A300 01C801 00003C B1C180 010000 7FA501 01C800 000025 FE0078 C40000 0058C6 00E70E 00DF07 00006A E72E00 CF03C8 000000 4EE70E 00DF07 00006A E72E00 CF03C8 000000 60E71E 00E3E7 0000E7 0F00DF 070000 7BC600 E71F00 E3C400 00006E C40000 0155E7 0600CF 03E708 00CF03 CB0306 E70900 A00003 A70002 C80100 0096A7 0001C8 010000 8EA700 03C401 0000BE C40000 00C2C8 000000 96DA00 C600E7 0A00E7 0C00A0 0003A7 0000C8 010000 F0A700 01C801 000104 A70002 C80100 00FAA7 0003C8 010001 0EC800 000109 C40000 0118C8 000001 09C400 000118 C80000 00C5C4 000001 42E70B 00C600 C40000 0142C8 000000 C5CB06 10CB07 11CB08 04A005 04A93C 058000 A70500 C40100 014EA9 3C047F FFCF04 E70D00 C40100 00BEC6 00CB08 04A93C 047FFF CF04C6 00B1C1 400028 C600DB 04EF61 6161C6 00DB00 A40801 A40900 A40A01 EF3421 34C600

Every cave music BMS begins with this same information, and will go mostly untouched.

Gesture set list[edit]

Exactly right after 34C600 will be a list of every gesture set's location in the BMS. Each entry is the gesture set's hexadecimal location (offset), and each entry in the sequence begins with "00". FFFFFF indicates the end of this list.

Here is an example of how this sequence should be formatted:
0001B0 0001BF 0001CE 0001D4 0001DA 0001E9 0001F8 0001FE 000204 00020A FFFFFF
Gesture set "0" will be at offset 0x1B0, gesture set "1" will be at offset 0x1BF, gesture set "2" will be at 0x1CE, and so on. There are a total of 10 gesture sets listed in the above sequence.

Until we create our gesture sets, let's use 00AAAA as placeholders so we can easily find and get back to this section later on. You can have as many gesture sets as you like; we'll create 16 entries for this tutorial. You may insert this into your BMS:
00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF

Our BMS should now currently look like this:

AC1000 00AC11 016ECC 0210CC 0311AC 100000 AC1101 8FCC04 10CC05 11E703 00A000 03A401 00A300 01C801 00003C B1C180 010000 7FA501 01C800 000025 FE0078 C40000 0058C6 00E70E 00DF07 00006A E72E00 CF03C8 000000 4EE70E 00DF07 00006A E72E00 CF03C8 000000 60E71E 00E3E7 0000E7 0F00DF 070000 7BC600 E71F00 E3C400 00006E C40000 0155E7 0600CF 03E708 00CF03 CB0306 E70900 A00003 A70002 C80100 0096A7 0001C8 010000 8EA700 03C401 0000BE C40000 00C2C8 000000 96DA00 C600E7 0A00E7 0C00A0 0003A7 0000C8 010000 F0A700 01C801 000104 A70002 C80100 00FAA7 0003C8 010001 0EC800 000109 C40000 0118C8 000001 09C400 000118 C80000 00C5C4 000001 42E70B 00C600 C40000 0142C8 000000 C5CB06 10CB07 11CB08 04A005 04A93C 058000 A70500 C40100 014EA9 3C047F FFCF04 E70D00 C40100 00BEC6 00CB08 04A93C 047FFF CF04C6 00B1C1 400028 C600DB 04EF61 6161C6 00DB00 A40801 A40900 A40A01 EF3421 34C600 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000 000000

You can also add an entire row of padding/zeros after this. You can do this for each section, to better visually separate them.

Timing ruleset list[edit]

This is another sequence of offsets. These just point to the location of a "timetable", which will be located at the end of our BMS file. FFFFFF indicates the end of this list.

Here is an example of how this sequence should be formatted:
0005AB 0005AB 0005AF 0005C1 0005AB 0005AB 0005C1 0005C1 0005C1 0005C1 FFFFFF
Timing ruleset "0" will use the timetable at 0x5AB, timing ruleset "1" will also use the timetable at 0x5AB, timing ruleset "2" will use the timetable at 0x5AF, and so on. There are a total of 10 timing rulesets listed in the above sequence.

Let's use 00BBBB as placeholders again, and create 16 of them. Insert this anywhere into your BMS:
00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB FFFFFF

Gesture set contents[edit]

A gesture set is a group of many gestures.
Here, we list each gesture set's contents (which will be... the locations of the gestures!). Each gesture set begins before with 00 and ends with FFFFFF.

Here is an example of how the gesture set list should be formatted:
000210 00022A 000258 000281 FFFFFF 0002B4 0002D9 000303 000331 FFFFFF 000355 FFFFFF 000361 FFFFFF 0003A8 0003C2 0003F0 000419 FFFFFF 00044C 000471 00049B 0004C9 FFFFFF 0004ED FFFFFF 000543 FFFFFF 000580 FFFFFF 00059E FFFFFF
There are 10 gesture sets listed above. The first gesture set has 4 gestures, located at 0x210, 0x22A, 0x258, and 0x281. You can have any amount of gestures in a gesture set; even 1 is fine.

You can paste the following placeholder information for now:
00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC FFFFFF
It might be a good idea to leave a decent amount of zeros after this list; this one will expand a lot as gestures and gesture sets are added to it.

How is your BMS looking?[edit]

If you have been copy-pasting everything correctly, your BMS will look something like this:

Once again, you can add as much padding between each section as you want, it will work fine.

Creating gestures[edit]

First, you should sketch out your song idea in your DAW, and then cut your song into tiny blocks. These blocks will be your song's individual gestures. You should also consider dragging these blocks around in various arrangements to make sure they sound good in any order.

Once you are ready, have them nicely organized and ready to be exported into individual MIDI files:

For some reason, imported BMS files play 4 times as slow in cave songs. So if you import these gestures as is, they will play 4 times as slow.
Before you export your gestures, you need to modify your gestures to run 4 times as fast. How you will go about this will depend on your DAW; some will allow you to stretch entire regions of notes easily.

Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the "Double Speed" transformation twice on each block.

Inserting gestures[edit]

Gestures use same the note/music information as standard BMS songs.

You should have converted all your MIDIs into BMS files. Open up one of your converted BMS files, and look for the first note/pitch value. If you used flaaffy, this will most likely be somewhere after 0x1B, 0x1C, or 0x1D. The note's pitch value will often be followed by a 01, then the velocity value. Copy this note, all the way to the end of the sequence, which should be FF.

To add your gesture, start it with C40000015D, then paste in what you copied. Each gesture should end with that FF. Add as many gestures as you please!

Inserting timetables[edit]

So, how do we choose how often gestures will play? Will a gesture play every beat? Every 1/2 a beat? You will need to add a timetable for that! A timetable is a sequence that dictates when gestures should play. A timetable ends with FFFF. You can make a timetable as complex as you like.
Some examples of timetables you can use are:

  • 0780 FFFF Play a gesture every 16 beats.
  • 03C0 FFFF Play a gesture every 8 beats.
  • 01E0 FFFF Play a gesture every 4 beats.
  • 03C0 03C0 03C0 01E0 01E0 01E0 01E0 03C0 FFFF This sequence will play a gesture every 8 beats (3x), play a gesture every 4 beats (4x), then play a gesture for 8 beats (1x), in that order.
  • 00F0 FFFF Play a gesture every 1/2 note (every 2 beats).
  • 0078 FFFF Play a gesture every 1/4 note (every beat).
  • 003C FFFF Play a gesture every 1/8th note.
  • 001E FFFF Play a gesture every 1/16th note.
  • 003C 0078 001E FFFF This sequence will play a gesture for an 1/8th note, play a gesture for a 1/4 note, then play a gesture for a 1/16th note, in that order.

Considering that 001E (30 in decimal) is a 1/16th note, you can create any specific timing you want. Just add another 30 to the value for each additional sixteenth note in length.
For example, Soil 1's enemy mix piano plays a gesture every three sixteenth notes. That would be 90 in decimal, and its timetable would look like 005A FFFF.
You can insert your timetables anywhere at the end of your BMS.

Filling in info[edit]

Once you have your gestures and timetables inserted, go back and fill in those 00AAAA, 00BBBB, 00CCCC placeholders with the locations of your gesture sets, timetables, and gestures you want to use. Remember that gesture sets begin with the 00.

Also in the very beginning of your BMS, make sure the value at 0x6 has the location of where your gesture set list begins (this one will probably be fine), and the value at 0x14 has the location of where your timing ruleset list begins.

Filling in the conductor file[edit]

In your song's associated conductor file, try to stretch out the window so that the instrument names are all in the same column if you can, like in the image above.

Each line represents one track. You give each track a instrument (program), and what gesture set and timing ruleset to use.
The CND infographic above does a good job explaining all the functions, but they'll be explained again down here.

In the top left corner are three important values:

  • The first value is the swing time. 1E is 1/16th swing, while 3C is 1/8th swing. If your song is below 100bpm, you might want to use 1E. If its faster, try 3C instead.
  • The second value is the tempo, in hex.
  • The third value is how many tracks there will be, in hex.

Each column explained:

  • A: Initial delay. How many beats until this track starts running. In the vanilla game, you can notice how some song's melodies do not immediately begin playing upon the start of the level. This is useful for that; ease the listener into the music.
  • B/Q: If set to 1, all gestures will be delayed by an 1/8th note.
  • C: Text string. You can make this say whatever you like. Useful for keeping track of what you want each track to be, like "Lead", "Trumpet", "MelodyA"/"MelodyB", "Bass", or "Drums"
  • D: Track copy. Select a previous track # to copy the gestures from. If the track its copying plays "gesture 3" from its gesture set, this track will also play its "gesture 3". Often used for treasure mix instruments. You can have them use different gesture sets if you like.
  • E: Echo strength.
  • F: If set to 1, the values in this track's timetable will always be played in order, in a loop. If set to 0, it will randomly select values from its timetable, thus, allowing you to randomize when gestures play.
  • G: Bank number.
  • H: Program number. For a list of all programs in the default game and the wScenes that support them, view this page.
  • I: Gesture set, select the set # you want to use from the BMS.
  • J: Timing ruleset, select the set # you want to use from the BMS.
  • K: How many gestures this track will play, before playing "silent gestures". Linked to below. These function as a sort of on/off cycle.
  • L: How many "silent gestures" this track will play, before playing normal gestures. Linked to above. These function as a sort of on/off cycle.
  • M: If notes are being transposed down (see below), this is set to FF. But this column doesn't actually do anything, so you don't need to edit this.
  • N: Transpose all notes played by this track. To transpose up, use values 1-127. To transpose down, use the sign 2 compliment (values 128-255).
  • O: Volume.
  • P: Stereo panning.


Some ideas/considerations:

  • You can use the on/off cycle feature (column K and L) to make your melodic instrument "take a break" every once in a while. You can have it play 4 gestures, but then be silent for 2.
  • If your timing ruleset is strict (as in, the timings for when gestures occur is always consistent), something fun to try is to have the melody be a back-and-forth between two different instruments. Set the initial delay for the second instrument to be longer than the first one, and then cleverly use the on/off cycle to have the instruments take turns sounding a gesture. This is done for the melody in the Bulblax Kingdom and Frontier Cavern for example.
  • If you are using the "track copy" feature (column D), you can have the primary instrument play a melody, and have this instrument always play chords that perfectly match that melody.

Mapping the tracks[edit]

With all that done, don't forget to edit the song's trackMap! Edit your song in the trackMap files in either /user/Totaka or /user/Wakai, and set how many instruments will be in each mix. It goes in order from: Main Mix, Task (event), Treasure (otakara), Enemy near (kehai), Combat mix, and Spiderwort mix (ground). Although you cannot find Spiderworts underground, you will have to sacrifice at least one track for that mix. You cannot set any of the mixes to have 0 tracks in them.

Bonus: Filenames for brand new CND files[edit]

If you are adding a brand new CND file instead of replacing an existing one, the prefix will determine which BMS is loaded, and which wScene. Try not to add special characters to filenames, aside from underscores.

In order to load the correct BMS file, the CND must start with the name of the BMS file.

  • "caveconc.cnd", "caveconc_458435.cnd", "caveconc_Waffles.cnd", and "caveconc_Waffles_Song_2.cnd" will all load caveconc.bms.
  • "caverelax.cnd", "caverelax_Gmajor.cnd", and "caverelax_mamuta_dinner.cnd" will all load caverelax.bms.
  • "new_09_4.cnd", "new_09_4000.cnd", and "new_09_portal_PotaTOS.cnd" will load new_09.bms.

For cavesoil, caveconc, and cavemetal only, the game also checks for an additional "_00", "_05", and "_10" right after the prefix, for the purpose of loading one of three different wScenes. You must include it if you want the correct wScene to load. For example, caveconc_05 loads wScene 31, so if you want your custom song to also load wScene 31, acceptable names include "caveconc_05_WAFFLES.cnd", "caveconc_05_52_46356.cnd", or "caveconc_05_super_boss.cnd".

After adding your new CND file, be sure to add it to its respective trackMap file.

Bonus: Adding new content to a vanilla BMS file[edit]

Adding new hex data in the middle of a file will shift all the offsets that come after it, causing your BMS to jump to the wrong locations, and likely cause a crash if vanilla songs are loaded.
In order to add new content in addition to what's already in the BMS:

  • Find and copy the gesture set list and the timing ruleset list, and paste them at the end of the file. (Separate them with lots of zeros so you have lots more space to add content to these lists)
  • Change 0x6 and 0x14 to point to your new gesture set list and timing ruleset list. These two values tell the game where the lists are.

The game should now use these brand new lists, instead of the original instances that occur earlier in the file. Since they still contain all the locations of the vanilla gesture sets/timetables from above in the same order, the existing CND songs won't be affected and will continue to function, but now you can expand upon these lists with brand new entries now that you've made the space for them. All new gestures, gesture sets and timetables can be added further down the file.

Bonus: Adding gesture cutoffs in timetables[edit]

An intentional compositional choice in some songs is to cutoff gestures while they're in the middle of playing. The most common way this is done is to quickly trigger another gesture; if the last gesture has not finished playing, it will stop playing that gesture and begin playing the new one. It's also possible to add "empty" gestures to gesture sets (like C40000015DFF, a gesture which ends immediately and plays nothing), so you can randomly interrupt gestures in your song with silence, or have there be a chance to play nothing.

However, if you wish to interrupt gestures in your song at specified times without the randomness, there is a special function in timetables for doing this. In the vanilla game, this is used for the trumpet in Fire. The trumpet plays two interrupted gestures, then plays a third gesture in full. Below is the timetable for this trumpet:
0078 8168 81E0 00F0 80F0 81E0 0780 FFFF
The trumpet will:

  • 0078 play a gesture for 1 beat
  • 8168 cutoff after this 1 beat
  • 81E0 extend the silence for another 4 beats
  • 00F0 play a gesture for 2 beats
  • 80F0 cutoff after these 2 beats
  • 81E0 extend the silence for another 4 beats
  • 0780 play a gesture for 16 beats.

In order to put a "cutoff" in your timetable:

  • Start with how long you want your "playing" gesture to play for, before it gets cutoff. I want the the first gesture to last for one beat (four 1/16th notes), so I'll put 0078. Remember that every "30" in decimal is equivalent to a sixteenth note.
  • Immediately next in the sequence will be a value that indicates when the cutoff begins. Calculate the difference between "81E0" and the previous value you had just inserted. 81E0 - 0078 = 8168 (in decimal, 33248 - 120 = 33128). I will put 8168 next in my sequence.

My sequence is now 0078 8168 FFFF; this will play a gesture normally for 1 beat, but then immediately cut it off after that 1 beat.
Putting an additional 81E0 in the sequence right after will extend the silence for another 4 beats if you so desire. You can keep putting 81E0 right after several times in a row if you want silence to last extra long until the next gesture plays.