<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pikmintkb.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Asheevee</id>
	<title>Pikmin Technical Knowledge Base - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://pikmintkb.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Asheevee"/>
	<link rel="alternate" type="text/html" href="https://pikmintkb.com/wiki/Special:Contributions/Asheevee"/>
	<updated>2026-06-03T19:52:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://pikmintkb.com/w/index.php?title=Creating_cave_music&amp;diff=5201</id>
		<title>Creating cave music</title>
		<link rel="alternate" type="text/html" href="https://pikmintkb.com/w/index.php?title=Creating_cave_music&amp;diff=5201"/>
		<updated>2026-02-06T04:40:14Z</updated>

		<summary type="html">&lt;p&gt;Asheevee: Undo revision 5194 by Asheevee (talk) -- this breaks everything involving timetables, easier to just speed up the midis beforehand&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Randomly generating cave music in Pikmin 2 needs to have two files: a .bms (sequence) file, and a .cnd (conductor) file.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The CND files are the actual &amp;quot;songs&amp;quot;; they take specific groups of snippets from a BMS file, and endlessly puzzle-piece them together to form a coherent piece of music. &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&lt;br /&gt;
* 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&#039;s structure beforehand.&lt;br /&gt;
* 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 &amp;quot;gestures&amp;quot;.&lt;br /&gt;
* 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).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Overview of file functions ==&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=250px heights=250px&amp;gt;&lt;br /&gt;
File:CND_functions.png|Conductor file functions.&lt;br /&gt;
File:BMS_functions.png|How information is stored in a BMS file.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up your BMS file ==&lt;br /&gt;
Before you begin, set your byte grouping to &amp;quot;3&amp;quot;, so every 3 bytes is visually separated by a space. This will make it easier to see stuff.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Starting with a completely blank BMS file, begin by pasting the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
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&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Every cave music BMS begins with this same information, and will go mostly untouched.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gesture set list ==&lt;br /&gt;
Exactly right after &amp;lt;code&amp;gt;34C600&amp;lt;/code&amp;gt; will be a list of every gesture set&#039;s location in the BMS. Each entry is the gesture set&#039;s hexadecimal location (offset), and each entry in the sequence begins with &amp;quot;&amp;lt;code&amp;gt;00&amp;lt;/code&amp;gt;&amp;quot;. &amp;lt;code&amp;gt;FFFFFF&amp;lt;/code&amp;gt; indicates the end of this list.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of how this sequence should be formatted:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;0001B0 0001BF 0001CE 0001D4 0001DA 0001E9 0001F8 0001FE 000204 00020A FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Gesture set &amp;quot;0&amp;quot; will be at offset &amp;lt;code&amp;gt;0x1B0&amp;lt;/code&amp;gt;, gesture set &amp;quot;1&amp;quot; will be at offset &amp;lt;code&amp;gt;0x1BF&amp;lt;/code&amp;gt;, gesture set &amp;quot;2&amp;quot; will be at &amp;lt;code&amp;gt;0x1CE&amp;lt;/code&amp;gt;, and so on. There are a total of 10 gesture sets listed in the above sequence.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Until we create our gesture sets, let&#039;s use &amp;lt;code&amp;gt;00AAAA&amp;lt;/code&amp;gt; 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&#039;ll create 16 entries for this tutorial. You may insert this into your BMS:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Our BMS should now currently look like this:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
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&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can also add an entire row of padding/zeros after this. You can do this for each section, to better visually separate them.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Timing ruleset list ==&lt;br /&gt;
This is another sequence of offsets. These just point to the location of a &amp;quot;[[#Inserting_timetables|timetable]]&amp;quot;, which will be located at the end of our BMS file. &amp;lt;code&amp;gt;FFFFFF&amp;lt;/code&amp;gt; indicates the end of this list.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of how this sequence should be formatted:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;0005AB 0005AB 0005AF 0005C1 0005AB 0005AB 0005C1 0005C1 0005C1 0005C1 FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Timing ruleset &amp;quot;0&amp;quot; will use the timetable at &amp;lt;code&amp;gt;0x5AB&amp;lt;/code&amp;gt;, timing ruleset &amp;quot;1&amp;quot; will also use the timetable at &amp;lt;code&amp;gt;0x5AB&amp;lt;/code&amp;gt;, timing ruleset &amp;quot;2&amp;quot; will use the timetable at &amp;lt;code&amp;gt;0x5AF&amp;lt;/code&amp;gt;, and so on. There are a total of 10 timing rulesets listed in the above sequence.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Let&#039;s use &amp;lt;code&amp;gt;00BBBB&amp;lt;/code&amp;gt; as placeholders again, and create 16 of them. Insert this anywhere into your BMS:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gesture set contents ==&lt;br /&gt;
A &#039;&#039;gesture set&#039;&#039; is a group of many gestures.&amp;lt;br&amp;gt;&lt;br /&gt;
Here, we list each gesture set&#039;s contents (which will be... the locations of the gestures!). Each gesture set begins before with &amp;lt;code&amp;gt;00&amp;lt;/code&amp;gt; and ends with &amp;lt;code&amp;gt;FFFFFF&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of how the gesture set list should be formatted:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;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&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
There are 10 gesture sets listed above. The first gesture set has 4 gestures, located at &amp;lt;code&amp;gt;0x210&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;0x22A&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;0x258&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;0x281&amp;lt;/code&amp;gt;. You can have any amount of gestures in a gesture set; even 1 is fine.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
You can paste the following placeholder information for now:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How is your BMS looking? ==&lt;br /&gt;
If you have been copy-pasting everything correctly, your BMS will look something like this:&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_1.png|Orange is &amp;quot;gesture set list&amp;quot;, yellow is &amp;quot;timing ruleset list&amp;quot;, and blue is &amp;quot;gesture set contents&amp;quot;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Once again, you can add as much padding between each section as you want, it will work fine.&lt;br /&gt;
&lt;br /&gt;
== Creating gestures ==&lt;br /&gt;
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&#039;s individual gestures. You should also consider dragging these blocks around in various arrangements to make sure they sound good in any order.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you are ready, have them nicely organized and ready to be exported into individual MIDI files:&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:Logic_Pro_gestures.png|A Logic Pro project with a bunch of short blocks of music. Each block will be a &amp;quot;gesture&amp;quot;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
Before you export your gestures, you need to modify your gestures to run &#039;&#039;4 times as fast&#039;&#039;. How you will go about this will depend on your DAW; some will allow you to stretch entire regions of notes easily.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the &amp;quot;Double Speed&amp;quot; transformation twice on each block.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:Logic_pro_double_speed.gif|Shorten the length of the MIDI by 4x, but don&#039;t change your project&#039;s tempo.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inserting gestures ==&lt;br /&gt;
Gestures use same the note/music information as standard BMS songs.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;0x1B&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;0x1C&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;0x1D&amp;lt;/code&amp;gt;. The note&#039;s pitch value will often be followed by a &amp;lt;code&amp;gt;01&amp;lt;/code&amp;gt;, then the velocity value. Copy this note, all the way to the end of the sequence, which should be &amp;lt;code&amp;gt;FF&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=600px&amp;gt;&lt;br /&gt;
File:Copy_pasting_BMS_info.png|The value &amp;quot;2D&amp;quot; here is the hex value of a certain pitch, and the very first note of the sequence. Copy this, all the way to &amp;quot;FF&amp;quot;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To add your gesture, start it with &amp;lt;code&amp;gt;C40000015D&amp;lt;/code&amp;gt;, then paste in what you copied. Each gesture should end with that &amp;lt;code&amp;gt;FF&amp;lt;/code&amp;gt;. Add as many gestures as you please!&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_2.png|The purple lines indicate where a gesture starts.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inserting timetables ==&lt;br /&gt;
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!&lt;br /&gt;
A timetable is a sequence that dictates when gestures should play. A timetable ends with &amp;lt;code&amp;gt;FFFF&amp;lt;/code&amp;gt;. You can make a timetable as complex as you like.&amp;lt;br&amp;gt; Some examples of timetables you can use are:&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;0780 FFFF&amp;lt;/code&amp;gt; Play a gesture every 16 beats.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;03C0 FFFF&amp;lt;/code&amp;gt; Play a gesture every 8 beats.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;01E0 FFFF&amp;lt;/code&amp;gt; Play a gesture every 4 beats.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;03C0 03C0 03C0 01E0 01E0 01E0 01E0 03C0 FFFF&amp;lt;/code&amp;gt; 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.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;00F0 FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/2 note (every 2 beats).&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;0078 FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/4 note (every beat).&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;003C FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/8th note.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;001E FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/16th note.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;003C 0078 001E FFFF&amp;lt;/code&amp;gt; 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.&amp;lt;br&amp;gt;&lt;br /&gt;
Considering that &amp;lt;code&amp;gt;001E&amp;lt;/code&amp;gt; (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.&amp;lt;br&amp;gt;&lt;br /&gt;
For example, Soil 1&#039;s enemy mix piano plays a gesture every three sixteenth notes. That would be 90 in decimal, and its timetable would look like &amp;lt;code&amp;gt;005A FFFF&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
You can insert your timetables anywhere at the end of your BMS.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=250px heights=250px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_3.png|Each timetable has a pink box around it.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Filling in info ==&lt;br /&gt;
Once you have your gestures and timetables inserted, go back and fill in those &amp;lt;code&amp;gt;00AAAA&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;00BBBB&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;00CCCC&amp;lt;/code&amp;gt; placeholders with the locations of your gesture sets, timetables, and gestures you want to use. Remember that gesture sets begin with the &amp;lt;code&amp;gt;00&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Also in the very beginning of your BMS, make sure the value at &amp;lt;code&amp;gt;0x6&amp;lt;/code&amp;gt; has the location of where your gesture set list begins (this one will probably be fine), and the value at &amp;lt;code&amp;gt;0x14&amp;lt;/code&amp;gt; has the location of where your timing ruleset list begins.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=250px heights=250px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_4.png|Put the location of where the &amp;quot;timing ruleset list&amp;quot; begins here.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Filling in the conductor file ==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CND_functions.png|Conductor file functions.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In your song&#039;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.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Each line represents one track. You give each track a instrument (program), and what gesture set and timing ruleset to use.&amp;lt;br&amp;gt;&lt;br /&gt;
The CND infographic above does a good job explaining all the functions, but they&#039;ll be explained again down here.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the top left corner are three important values:&lt;br /&gt;
* The first value is the swing time. &amp;lt;code&amp;gt;1E&amp;lt;/code&amp;gt; is 1/16th swing, while &amp;lt;code&amp;gt;3C&amp;lt;/code&amp;gt; is 1/8th swing. If your song is below 100bpm, you might want to use &amp;lt;code&amp;gt;1E&amp;lt;/code&amp;gt;. If its faster, try &amp;lt;code&amp;gt;3C&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
* The second value is the tempo, in hex.&lt;br /&gt;
* The third value is how many tracks there will be, in hex.&lt;br /&gt;
&lt;br /&gt;
Each column explained:&lt;br /&gt;
* A: Initial delay. How many beats until this track starts running. In the vanilla game, you can notice how some song&#039;s melodies do not immediately begin playing upon the start of the level. This is useful for that; ease the listener into the music.&lt;br /&gt;
* B/Q: If set to 1, all gestures will be delayed by an 1/8th note.&lt;br /&gt;
* C: Text string. You can make this say whatever you like. Useful for keeping track of what you want each track to be, like &amp;quot;Lead&amp;quot;, &amp;quot;Trumpet&amp;quot;, &amp;quot;MelodyA&amp;quot;/&amp;quot;MelodyB&amp;quot;, &amp;quot;Bass&amp;quot;, or &amp;quot;Drums&amp;quot;&lt;br /&gt;
* D: Track copy. Select a previous track # to copy the gestures from. If the track its copying plays &amp;quot;gesture 3&amp;quot; from its gesture set, this track will also play its &amp;quot;gesture 3&amp;quot;. Often used for treasure mix instruments. You can have them use different gesture sets if you like.&lt;br /&gt;
* E: Echo strength.&lt;br /&gt;
* F: If set to 1, the values in this track&#039;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.&lt;br /&gt;
* G: Bank number.&lt;br /&gt;
* 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]].&lt;br /&gt;
* I: Gesture set, select the set # you want to use from the BMS. &lt;br /&gt;
* J: Timing ruleset, select the set # you want to use from the BMS.&lt;br /&gt;
* K: How many gestures this track will play, before playing &amp;quot;silent gestures&amp;quot;. Linked to below. These function as a sort of on/off cycle.&lt;br /&gt;
* L: How many &amp;quot;silent gestures&amp;quot; this track will play, before playing normal gestures. Linked to above. These function as a sort of on/off cycle.&lt;br /&gt;
* M: If notes are being transposed down (see below), this is set to FF. But this column doesn&#039;t actually do anything, so you don&#039;t need to edit this.&lt;br /&gt;
* 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).&lt;br /&gt;
* O: Volume.&lt;br /&gt;
* P: Stereo panning.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Some ideas/considerations:&lt;br /&gt;
* You can use the on/off cycle feature (column K and L) to make your melodic instrument &amp;quot;take a break&amp;quot; every once in a while. You can have it play 4 gestures, but then be silent for 2.&lt;br /&gt;
* 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.&lt;br /&gt;
* If you are using the &amp;quot;track copy&amp;quot; feature (column D), you can have the primary instrument play a melody, and have this instrument always play chords that perfectly match that melody.&lt;br /&gt;
&lt;br /&gt;
== Mapping the tracks ==&lt;br /&gt;
With all that done, don&#039;t forget to edit the song&#039;s [[Trackmap parameters|trackMap]]! Edit your song in the trackMap files in either &amp;lt;code&amp;gt;/user/Totaka&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/user/Wakai&amp;lt;/code&amp;gt;, 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.&lt;br /&gt;
&lt;br /&gt;
== Bonus: Filenames for brand new CND files ==&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to load the correct BMS file, the CND must start with the name of the BMS file.&lt;br /&gt;
* &amp;quot;caveconc.cnd&amp;quot;, &amp;quot;caveconc_458435.cnd&amp;quot;, &amp;quot;caveconc_Waffles.cnd&amp;quot;, and &amp;quot;caveconc_Waffles_Song_2.cnd&amp;quot; will all load caveconc.bms.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;quot;caverelax.cnd&amp;quot;, &amp;quot;caverelax_Gmajor.cnd&amp;quot;, and &amp;quot;caverelax_mamuta_dinner.cnd&amp;quot; will all load caverelax.bms.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;quot;new_09_4.cnd&amp;quot;, &amp;quot;new_09_4000.cnd&amp;quot;, and &amp;quot;new_09_portal_PotaTOS.cnd&amp;quot; will load new_09.bms.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For cavesoil, caveconc, and cavemetal only, the game also checks for an additional &amp;quot;_00&amp;quot;, &amp;quot;_05&amp;quot;, and &amp;quot;_10&amp;quot; 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 &amp;quot;caveconc_05_WAFFLES.cnd&amp;quot;, &amp;quot;caveconc_05_52_46356.cnd&amp;quot;, or &amp;quot;caveconc_05_super_boss.cnd&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After adding your new CND file, be sure to add it to its respective trackMap file.&lt;br /&gt;
&lt;br /&gt;
== Bonus: Adding new content to a vanilla BMS file ==&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to add new content in addition to what&#039;s already in the BMS:&lt;br /&gt;
* 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)&lt;br /&gt;
* Change &amp;lt;code&amp;gt;0x6&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;0x14&amp;lt;/code&amp;gt; to point to your new gesture set list and timing ruleset list. These two values tell the game where the lists are.&lt;br /&gt;
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&#039;t be affected and will continue to function, but now you can expand upon these lists with brand new entries now that you&#039;ve made the space for them. All new gestures, gesture sets and timetables can be added further down the file.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:Editing_vanilla_BMS_file.png|The new gesture set list and timing ruleset list we want to use will be at the bottom.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bonus: Adding gesture cutoffs in timetables ==&lt;br /&gt;
An intentional compositional choice in some songs is to cutoff gestures while they&#039;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&#039;s also possible to add &amp;quot;empty&amp;quot; gestures to gesture sets (like &amp;lt;code&amp;gt;C40000015DFF&amp;lt;/code&amp;gt;, 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.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
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:&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;0078 8168 81E0 00F0 80F0 81E0 0780 FFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The trumpet will:&lt;br /&gt;
* &amp;lt;code&amp;gt;0078&amp;lt;/code&amp;gt; play a gesture for 1 beat&lt;br /&gt;
* &amp;lt;code&amp;gt;8168&amp;lt;/code&amp;gt; cutoff after this 1 beat&lt;br /&gt;
* &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; extend the silence for another 4 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;00F0&amp;lt;/code&amp;gt; play a gesture for 2 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;80F0&amp;lt;/code&amp;gt; cutoff after these 2 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; extend the silence for another 4 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;0780&amp;lt;/code&amp;gt; play a gesture for 16 beats.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to put a &amp;quot;cutoff&amp;quot; in your timetable:&lt;br /&gt;
* Start with how long you want your &amp;quot;playing&amp;quot; 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&#039;ll put &amp;lt;code&amp;gt;0078&amp;lt;/code&amp;gt;. Remember that every &amp;quot;30&amp;quot; in decimal is equivalent to a sixteenth note.&lt;br /&gt;
* Immediately next in the sequence will be a value that indicates when the cutoff begins. Calculate the difference between &amp;quot;81E0&amp;quot; and the previous value you had just inserted. 81E0 - 0078 = 8168 (in decimal, 33248 - 120 = 33128). I will put &amp;lt;code&amp;gt;8168&amp;lt;/code&amp;gt; next in my sequence.&lt;br /&gt;
My sequence is now &amp;lt;code&amp;gt;0078 8168 FFFF&amp;lt;/code&amp;gt;; this will play a gesture normally for 1 beat, but then immediately cut it off after that 1 beat.&amp;lt;br&amp;gt;&lt;br /&gt;
Putting an additional &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; in the sequence right after will extend the silence for another 4 beats if you so desire. You can keep putting &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; right after several times in a row if you want silence to last extra long until the next gesture plays.&lt;br /&gt;
&lt;br /&gt;
[[Category:Pikmin 2]]&lt;/div&gt;</summary>
		<author><name>Asheevee</name></author>
	</entry>
	<entry>
		<id>https://pikmintkb.com/w/index.php?title=Creating_cave_music&amp;diff=5194</id>
		<title>Creating cave music</title>
		<link rel="alternate" type="text/html" href="https://pikmintkb.com/w/index.php?title=Creating_cave_music&amp;diff=5194"/>
		<updated>2025-12-10T21:22:47Z</updated>

		<summary type="html">&lt;p&gt;Asheevee: Change timebase (ticks per quarter note, at 0x3C in the bms) in template to match flaaffy&amp;#039;s exports and fix the default 4x slower playback.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Randomly generating cave music in Pikmin 2 needs to have two files: a .bms (sequence) file, and a .cnd (conductor) file.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The CND files are the actual &amp;quot;songs&amp;quot;; they take specific groups of snippets from a BMS file, and endlessly puzzle-piece them together to form a coherent piece of music. &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&lt;br /&gt;
* 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&#039;s structure beforehand.&lt;br /&gt;
* 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 &amp;quot;gestures&amp;quot;.&lt;br /&gt;
* 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).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Overview of file functions ==&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=250px heights=250px&amp;gt;&lt;br /&gt;
File:CND_functions.png|Conductor file functions.&lt;br /&gt;
File:BMS_functions.png|How information is stored in a BMS file.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up your BMS file ==&lt;br /&gt;
Before you begin, set your byte grouping to &amp;quot;3&amp;quot;, so every 3 bytes is visually separated by a space. This will make it easier to see stuff.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Starting with a completely blank BMS file, begin by pasting the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
AC1000 00AC11 016ECC 0210CC 0311AC 100000 AC1101 8FCC04 10CC05 11E703 00A000 03A401 00A300 01C801 00003C B1C180 010000 7FA501 01C800 000025 FE01E0 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&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Every cave music BMS begins with this same information, and will go mostly untouched.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gesture set list ==&lt;br /&gt;
Exactly right after &amp;lt;code&amp;gt;34C600&amp;lt;/code&amp;gt; will be a list of every gesture set&#039;s location in the BMS. Each entry is the gesture set&#039;s hexadecimal location (offset), and each entry in the sequence begins with &amp;quot;&amp;lt;code&amp;gt;00&amp;lt;/code&amp;gt;&amp;quot;. &amp;lt;code&amp;gt;FFFFFF&amp;lt;/code&amp;gt; indicates the end of this list.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of how this sequence should be formatted:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;0001B0 0001BF 0001CE 0001D4 0001DA 0001E9 0001F8 0001FE 000204 00020A FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Gesture set &amp;quot;0&amp;quot; will be at offset &amp;lt;code&amp;gt;0x1B0&amp;lt;/code&amp;gt;, gesture set &amp;quot;1&amp;quot; will be at offset &amp;lt;code&amp;gt;0x1BF&amp;lt;/code&amp;gt;, gesture set &amp;quot;2&amp;quot; will be at &amp;lt;code&amp;gt;0x1CE&amp;lt;/code&amp;gt;, and so on. There are a total of 10 gesture sets listed in the above sequence.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Until we create our gesture sets, let&#039;s use &amp;lt;code&amp;gt;00AAAA&amp;lt;/code&amp;gt; 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&#039;ll create 16 entries for this tutorial. You may insert this into your BMS:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Our BMS should now currently look like this:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
AC1000 00AC11 016ECC 0210CC 0311AC 100000 AC1101 8FCC04 10CC05 11E703 00A000 03A401 00A300 01C801 00003C B1C180 010000 7FA501 01C800 000025 FE01E0 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&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can also add an entire row of padding/zeros after this. You can do this for each section, to better visually separate them.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Timing ruleset list ==&lt;br /&gt;
This is another sequence of offsets. These just point to the location of a &amp;quot;[[#Inserting_timetables|timetable]]&amp;quot;, which will be located at the end of our BMS file. &amp;lt;code&amp;gt;FFFFFF&amp;lt;/code&amp;gt; indicates the end of this list.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of how this sequence should be formatted:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;0005AB 0005AB 0005AF 0005C1 0005AB 0005AB 0005C1 0005C1 0005C1 0005C1 FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Timing ruleset &amp;quot;0&amp;quot; will use the timetable at &amp;lt;code&amp;gt;0x5AB&amp;lt;/code&amp;gt;, timing ruleset &amp;quot;1&amp;quot; will also use the timetable at &amp;lt;code&amp;gt;0x5AB&amp;lt;/code&amp;gt;, timing ruleset &amp;quot;2&amp;quot; will use the timetable at &amp;lt;code&amp;gt;0x5AF&amp;lt;/code&amp;gt;, and so on. There are a total of 10 timing rulesets listed in the above sequence.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Let&#039;s use &amp;lt;code&amp;gt;00BBBB&amp;lt;/code&amp;gt; as placeholders again, and create 16 of them. Insert this anywhere into your BMS:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gesture set contents ==&lt;br /&gt;
A &#039;&#039;gesture set&#039;&#039; is a group of many gestures.&amp;lt;br&amp;gt;&lt;br /&gt;
Here, we list each gesture set&#039;s contents (which will be... the locations of the gestures!). Each gesture set begins before with &amp;lt;code&amp;gt;00&amp;lt;/code&amp;gt; and ends with &amp;lt;code&amp;gt;FFFFFF&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Here is an example of how the gesture set list should be formatted:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;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&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
There are 10 gesture sets listed above. The first gesture set has 4 gestures, located at &amp;lt;code&amp;gt;0x210&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;0x22A&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;0x258&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;0x281&amp;lt;/code&amp;gt;. You can have any amount of gestures in a gesture set; even 1 is fine.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
You can paste the following placeholder information for now:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC FFFFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How is your BMS looking? ==&lt;br /&gt;
If you have been copy-pasting everything correctly, your BMS will look something like this:&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_1.png|Orange is &amp;quot;gesture set list&amp;quot;, yellow is &amp;quot;timing ruleset list&amp;quot;, and blue is &amp;quot;gesture set contents&amp;quot;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Once again, you can add as much padding between each section as you want, it will work fine.&lt;br /&gt;
&lt;br /&gt;
== Creating gestures ==&lt;br /&gt;
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&#039;s individual gestures. You should also consider dragging these blocks around in various arrangements to make sure they sound good in any order.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Once you are ready, have them nicely organized and ready to be exported into individual MIDI files:&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:Logic_Pro_gestures.png|A Logic Pro project with a bunch of short blocks of music. Each block will be a &amp;quot;gesture&amp;quot;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;!--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.&amp;lt;br&amp;gt;&lt;br /&gt;
Before you export your gestures, you need to modify your gestures to run &#039;&#039;4 times as fast&#039;&#039;. How you will go about this will depend on your DAW; some will allow you to stretch entire regions of notes easily.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the &amp;quot;Double Speed&amp;quot; transformation twice on each block.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:Logic_pro_double_speed.gif|Shorten the length of the MIDI by 4x, but don&#039;t change your project&#039;s tempo.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inserting gestures ==&lt;br /&gt;
Gestures use same the note/music information as standard BMS songs.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;0x1B&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;0x1C&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;0x1D&amp;lt;/code&amp;gt;. The note&#039;s pitch value will often be followed by a &amp;lt;code&amp;gt;01&amp;lt;/code&amp;gt;, then the velocity value. Copy this note, all the way to the end of the sequence, which should be &amp;lt;code&amp;gt;FF&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=600px&amp;gt;&lt;br /&gt;
File:Copy_pasting_BMS_info.png|The value &amp;quot;2D&amp;quot; here is the hex value of a certain pitch, and the very first note of the sequence. Copy this, all the way to &amp;quot;FF&amp;quot;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
To add your gesture, start it with &amp;lt;code&amp;gt;C40000015D&amp;lt;/code&amp;gt;, then paste in what you copied. Each gesture should end with that &amp;lt;code&amp;gt;FF&amp;lt;/code&amp;gt;. Add as many gestures as you please!&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_2.png|The purple lines indicate where a gesture starts.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inserting timetables ==&lt;br /&gt;
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!&lt;br /&gt;
A timetable is a sequence that dictates when gestures should play. A timetable ends with &amp;lt;code&amp;gt;FFFF&amp;lt;/code&amp;gt;. You can make a timetable as complex as you like.&amp;lt;br&amp;gt; Some examples of timetables you can use are:&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;0780 FFFF&amp;lt;/code&amp;gt; Play a gesture every 16 beats.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;03C0 FFFF&amp;lt;/code&amp;gt; Play a gesture every 8 beats.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;01E0 FFFF&amp;lt;/code&amp;gt; Play a gesture every 4 beats.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;03C0 03C0 03C0 01E0 01E0 01E0 01E0 03C0 FFFF&amp;lt;/code&amp;gt; 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.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;00F0 FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/2 note (every 2 beats).&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;0078 FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/4 note (every beat).&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;003C FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/8th note.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;001E FFFF&amp;lt;/code&amp;gt; Play a gesture every 1/16th note.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;003C 0078 001E FFFF&amp;lt;/code&amp;gt; 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.&amp;lt;br&amp;gt;&lt;br /&gt;
Considering that &amp;lt;code&amp;gt;001E&amp;lt;/code&amp;gt; (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.&amp;lt;br&amp;gt;&lt;br /&gt;
For example, Soil 1&#039;s enemy mix piano plays a gesture every three sixteenth notes. That would be 90 in decimal, and its timetable would look like &amp;lt;code&amp;gt;005A FFFF&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
You can insert your timetables anywhere at the end of your BMS.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=250px heights=250px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_3.png|Each timetable has a pink box around it.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Filling in info ==&lt;br /&gt;
Once you have your gestures and timetables inserted, go back and fill in those &amp;lt;code&amp;gt;00AAAA&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;00BBBB&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;00CCCC&amp;lt;/code&amp;gt; placeholders with the locations of your gesture sets, timetables, and gestures you want to use. Remember that gesture sets begin with the &amp;lt;code&amp;gt;00&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Also in the very beginning of your BMS, make sure the value at &amp;lt;code&amp;gt;0x6&amp;lt;/code&amp;gt; has the location of where your gesture set list begins (this one will probably be fine), and the value at &amp;lt;code&amp;gt;0x14&amp;lt;/code&amp;gt; has the location of where your timing ruleset list begins.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=250px heights=250px&amp;gt;&lt;br /&gt;
File:BMS_file_progress_4.png|Put the location of where the &amp;quot;timing ruleset list&amp;quot; begins here.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Filling in the conductor file ==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CND_functions.png|Conductor file functions.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
In your song&#039;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.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Each line represents one track. You give each track a instrument (program), and what gesture set and timing ruleset to use.&amp;lt;br&amp;gt;&lt;br /&gt;
The CND infographic above does a good job explaining all the functions, but they&#039;ll be explained again down here.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the top left corner are three important values:&lt;br /&gt;
* The first value is the swing time. &amp;lt;code&amp;gt;1E&amp;lt;/code&amp;gt; is 1/16th swing, while &amp;lt;code&amp;gt;3C&amp;lt;/code&amp;gt; is 1/8th swing. If your song is below 100bpm, you might want to use &amp;lt;code&amp;gt;1E&amp;lt;/code&amp;gt;. If its faster, try &amp;lt;code&amp;gt;3C&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
* The second value is the tempo, in hex.&lt;br /&gt;
* The third value is how many tracks there will be, in hex.&lt;br /&gt;
&lt;br /&gt;
Each column explained:&lt;br /&gt;
* A: Initial delay. How many beats until this track starts running. In the vanilla game, you can notice how some song&#039;s melodies do not immediately begin playing upon the start of the level. This is useful for that; ease the listener into the music.&lt;br /&gt;
* B/Q: If set to 1, all gestures will be delayed by an 1/8th note.&lt;br /&gt;
* C: Text string. You can make this say whatever you like. Useful for keeping track of what you want each track to be, like &amp;quot;Lead&amp;quot;, &amp;quot;Trumpet&amp;quot;, &amp;quot;MelodyA&amp;quot;/&amp;quot;MelodyB&amp;quot;, &amp;quot;Bass&amp;quot;, or &amp;quot;Drums&amp;quot;&lt;br /&gt;
* D: Track copy. Select a previous track # to copy the gestures from. If the track its copying plays &amp;quot;gesture 3&amp;quot; from its gesture set, this track will also play its &amp;quot;gesture 3&amp;quot;. Often used for treasure mix instruments. You can have them use different gesture sets if you like.&lt;br /&gt;
* E: Echo strength.&lt;br /&gt;
* F: If set to 1, the values in this track&#039;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.&lt;br /&gt;
* G: Bank number.&lt;br /&gt;
* 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]].&lt;br /&gt;
* I: Gesture set, select the set # you want to use from the BMS. &lt;br /&gt;
* J: Timing ruleset, select the set # you want to use from the BMS.&lt;br /&gt;
* K: How many gestures this track will play, before playing &amp;quot;silent gestures&amp;quot;. Linked to below. These function as a sort of on/off cycle.&lt;br /&gt;
* L: How many &amp;quot;silent gestures&amp;quot; this track will play, before playing normal gestures. Linked to above. These function as a sort of on/off cycle.&lt;br /&gt;
* M: If notes are being transposed down (see below), this is set to FF. But this column doesn&#039;t actually do anything, so you don&#039;t need to edit this.&lt;br /&gt;
* 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).&lt;br /&gt;
* O: Volume.&lt;br /&gt;
* P: Stereo panning.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Some ideas/considerations:&lt;br /&gt;
* You can use the on/off cycle feature (column K and L) to make your melodic instrument &amp;quot;take a break&amp;quot; every once in a while. You can have it play 4 gestures, but then be silent for 2.&lt;br /&gt;
* 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.&lt;br /&gt;
* If you are using the &amp;quot;track copy&amp;quot; feature (column D), you can have the primary instrument play a melody, and have this instrument always play chords that perfectly match that melody.&lt;br /&gt;
&lt;br /&gt;
== Mapping the tracks ==&lt;br /&gt;
With all that done, don&#039;t forget to edit the song&#039;s [[Trackmap parameters|trackMap]]! Edit your song in the trackMap files in either &amp;lt;code&amp;gt;/user/Totaka&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/user/Wakai&amp;lt;/code&amp;gt;, 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.&lt;br /&gt;
&lt;br /&gt;
== Bonus: Filenames for brand new CND files ==&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to load the correct BMS file, the CND must start with the name of the BMS file.&lt;br /&gt;
* &amp;quot;caveconc.cnd&amp;quot;, &amp;quot;caveconc_458435.cnd&amp;quot;, &amp;quot;caveconc_Waffles.cnd&amp;quot;, and &amp;quot;caveconc_Waffles_Song_2.cnd&amp;quot; will all load caveconc.bms.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;quot;caverelax.cnd&amp;quot;, &amp;quot;caverelax_Gmajor.cnd&amp;quot;, and &amp;quot;caverelax_mamuta_dinner.cnd&amp;quot; will all load caverelax.bms.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;quot;new_09_4.cnd&amp;quot;, &amp;quot;new_09_4000.cnd&amp;quot;, and &amp;quot;new_09_portal_PotaTOS.cnd&amp;quot; will load new_09.bms.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For cavesoil, caveconc, and cavemetal only, the game also checks for an additional &amp;quot;_00&amp;quot;, &amp;quot;_05&amp;quot;, and &amp;quot;_10&amp;quot; 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 &amp;quot;caveconc_05_WAFFLES.cnd&amp;quot;, &amp;quot;caveconc_05_52_46356.cnd&amp;quot;, or &amp;quot;caveconc_05_super_boss.cnd&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After adding your new CND file, be sure to add it to its respective trackMap file.&lt;br /&gt;
&lt;br /&gt;
== Bonus: Adding new content to a vanilla BMS file ==&lt;br /&gt;
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.&amp;lt;br&amp;gt;&lt;br /&gt;
In order to add new content in addition to what&#039;s already in the BMS:&lt;br /&gt;
* 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)&lt;br /&gt;
* Change &amp;lt;code&amp;gt;0x6&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;0x14&amp;lt;/code&amp;gt; to point to your new gesture set list and timing ruleset list. These two values tell the game where the lists are.&lt;br /&gt;
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&#039;t be affected and will continue to function, but now you can expand upon these lists with brand new entries now that you&#039;ve made the space for them. All new gestures, gesture sets and timetables can be added further down the file.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:Editing_vanilla_BMS_file.png|The new gesture set list and timing ruleset list we want to use will be at the bottom.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bonus: Adding gesture cutoffs in timetables ==&lt;br /&gt;
An intentional compositional choice in some songs is to cutoff gestures while they&#039;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&#039;s also possible to add &amp;quot;empty&amp;quot; gestures to gesture sets (like &amp;lt;code&amp;gt;C40000015DFF&amp;lt;/code&amp;gt;, 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.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
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:&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;0078 8168 81E0 00F0 80F0 81E0 0780 FFFF&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The trumpet will:&lt;br /&gt;
* &amp;lt;code&amp;gt;0078&amp;lt;/code&amp;gt; play a gesture for 1 beat&lt;br /&gt;
* &amp;lt;code&amp;gt;8168&amp;lt;/code&amp;gt; cutoff after this 1 beat&lt;br /&gt;
* &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; extend the silence for another 4 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;00F0&amp;lt;/code&amp;gt; play a gesture for 2 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;80F0&amp;lt;/code&amp;gt; cutoff after these 2 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; extend the silence for another 4 beats&lt;br /&gt;
* &amp;lt;code&amp;gt;0780&amp;lt;/code&amp;gt; play a gesture for 16 beats.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In order to put a &amp;quot;cutoff&amp;quot; in your timetable:&lt;br /&gt;
* Start with how long you want your &amp;quot;playing&amp;quot; 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&#039;ll put &amp;lt;code&amp;gt;0078&amp;lt;/code&amp;gt;. Remember that every &amp;quot;30&amp;quot; in decimal is equivalent to a sixteenth note.&lt;br /&gt;
* Immediately next in the sequence will be a value that indicates when the cutoff begins. Calculate the difference between &amp;quot;81E0&amp;quot; and the previous value you had just inserted. 81E0 - 0078 = 8168 (in decimal, 33248 - 120 = 33128). I will put &amp;lt;code&amp;gt;8168&amp;lt;/code&amp;gt; next in my sequence.&lt;br /&gt;
My sequence is now &amp;lt;code&amp;gt;0078 8168 FFFF&amp;lt;/code&amp;gt;; this will play a gesture normally for 1 beat, but then immediately cut it off after that 1 beat.&amp;lt;br&amp;gt;&lt;br /&gt;
Putting an additional &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; in the sequence right after will extend the silence for another 4 beats if you so desire. You can keep putting &amp;lt;code&amp;gt;81E0&amp;lt;/code&amp;gt; right after several times in a row if you want silence to last extra long until the next gesture plays.&lt;br /&gt;
&lt;br /&gt;
[[Category:Pikmin 2]]&lt;/div&gt;</summary>
		<author><name>Asheevee</name></author>
	</entry>
	<entry>
		<id>https://pikmintkb.com/w/index.php?title=Creating_Interactive_BMS_Files&amp;diff=5193</id>
		<title>Creating Interactive BMS Files</title>
		<link rel="alternate" type="text/html" href="https://pikmintkb.com/w/index.php?title=Creating_Interactive_BMS_Files&amp;diff=5193"/>
		<updated>2025-12-10T21:14:39Z</updated>

		<summary type="html">&lt;p&gt;Asheevee: Fix typo in template that prevents Sunset Track 16 from working; Change timebase (ticks per quarter note, at 0xE7) in template to match flaaffy&amp;#039;s exports and fix the default 4x slower playback.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will function as a walkthrough for creating interactive music for Pikmin 2&#039;s main areas.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Requirements:&#039;&#039;&lt;br /&gt;
* 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&#039;s structure beforehand.&lt;br /&gt;
* A MIDI to BMS converter, like [[Pikmin 2 custom music|flaaffy]]. You will be exporting each track of your MIDI separately as its own BMS file, and importing them one at a time.&lt;br /&gt;
* 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).&lt;br /&gt;
&lt;br /&gt;
Most of the editing will be done in hexadecimal. Creating [[Creating cave music|cave music]] is very similar.&lt;br /&gt;
&lt;br /&gt;
== Preparing and exporting MIDIs ==&lt;br /&gt;
You will be exporting each track of your song as its own separate MIDI file, and then convert each MIDI into a mini BMS file of its own.&amp;lt;br&amp;gt;&lt;br /&gt;
If your song has 14 instruments, then you&#039;ll export 14 MIDIs. Make sure each track is the same length so that looping will work properly.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For some reason, imported BMS files play exactly 4 times as slow in interactive music. So if you import the tracks as is, they will play 4 times as slow.&amp;lt;br&amp;gt;&lt;br /&gt;
Before you export them, you need to modify them to run 4 times as fast. Do not address this by changing the BPM in your DAW, you need to shorten the actual regions instead. How you will go about this will depend on your DAW; some will allow you to stretch entire regions of notes easily.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the &amp;quot;Double Speed&amp;quot; transformation twice on each entire track.&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:InteractiveBMStutorial5.png|Shorten the length of the MIDI by 4x, but don&#039;t change your project&#039;s tempo.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
(Note: While you *can* technically just multiply the BPM value by 4 in the BMS later on, Louie&#039;s variant is dependent on the BPM being something normal, so the swing will not be applied properly if you do that.)&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Base BMS file ==&lt;br /&gt;
Starting from scratch, here is a base for you to work off of. In a hex editor, copy and paste this into a completely new, blank BMS file:&lt;br /&gt;
&amp;lt;pre&amp;gt;E74000A0 0003AC04 0104AA20 050400B1 C1400005 AC04010A AA200504 00B1C140 0105AC04 0110AA20 050400B1 C1400205 AC040116 AA200504 00B1C140 0305AC04 011CAA20 050400B1 C1400405 AC040122 AA200504 00B1C140 0505AC04 0128AA20 050400B1 C1400605 AC04012E AA200504 00B1C140 0705AC04 0134AA20 050400B1 C1400805 AC04013A AA200504 00B1C140 0905AC04 0140AA20 050400B1 C1400A05 AC040146 AA200504 00B1C140 0B05AC04 014CAA20 050400B1 C1400C05 AC040152 AA200504 00B1C140 0D05AC04 0158AA20 050400B1 C1400E05 AC04015E AA200504 00B1C140 0F05FE01 E0FD0066 C8000001 9F884B00 C8000000 E9884B00 C8000000 F98001FF 0002AA00 071E0002 E600075A 00032200 07960003 5E0007D2 00039A00 080E0003 D600084A 00041200 08860004 4E0008C2 00048A00 08FE0004 C600093A 00050200 09760005 3E0009B2 00057A00 09EE0005 B6000A2A 0005F200 0A660006 2E000AA2 C600E70E 00DF0700 018AE72E 00CF03C8 0000016E E70E00DF 0700018A E72E00CF 03C80000 0180E71E 00E3E700 00E70F00 DF070001 9BC600E7 1F00E3E7 0E00DF07 0001B9E7 4001C805 000000E7 2E00CF03 C8000001 A7E71E00 E74001C8 050001C5 E3E1C800 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 44617920 76657273 696F6E3A 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000042 00004900 00560000 50000000 00000000 00000000 5365713A 00000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000294C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0002D0C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 00030CC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000348C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000384C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0003C0C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0003FCC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000438C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000474C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0004B0C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0004ECC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000528C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000564C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0005A0C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0005DCC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000618C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 53756E73 65742076 65722E3A 00000020 20202000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000042 00004900 00560000 50000000 00000000 00000000 5365713A 00000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000708C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000744C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000780C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0007BCC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0007F8C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000834C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000870C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0008ACC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0008E8C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000924C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000960C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 00099CC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 0009D8C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000A14C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000A50C8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 C4000001 8EA42004 A4212C98 007F9A03 400AC600 0000C400 000A8CC8 00000B04 FF000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 FF000000 3C2D2028 4E756C6C 20747261 636B2061 74203078 30623034 2C20666F 7220616E 7920656D 70747920 74726163 6B732900 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 76767620 50617374 6520796F 75722073 65717565 6E636573 20686572 65212076 76760000 00000000 00000000 00000000 00000000 00000000 00000000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file is setup with all the important information already filled out for you. You should resize the window so that you can see all 16 Day tracks and all 16 Sunset tracks evenly spaced on each line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:InteractiveBMStutorial1.png|You can use this image as a guide for the &amp;quot;mixer&amp;quot;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section is sort of like a mixer; you can set the volume and stereo panning of each track. More importantly, you also choose the bank and program here.&amp;lt;br&amp;gt;Most importantly, at the end of each track, you select what sequence the track uses. You just type in the offset of the sequence there.&lt;br /&gt;
&lt;br /&gt;
== Importing sequences ==&lt;br /&gt;
=== Converting ===&lt;br /&gt;
Convert all your MIDIs into BMS files with [[Pikmin 2 custom music|flaaffy]]. You can use the following commands in the command line (make sure to include the &amp;quot;-loop&amp;quot; argument in the first command, so it knows to loop the sequence):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mareep.exe mareep -errand jolt -input exampletrack02.midi -output exampletrack02.txt -loop&lt;br /&gt;
mareep.exe mareep -errand cotton -input exampletrack02.txt -output exampletrack02.bms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flaaffy turns the MIDI into a text file before it is converted into a BMS. The text file is &amp;quot;cotton&amp;quot;, flaaffy&#039;s assembly language. Viewing the cotton file can be useful for double checking there&#039;s in fact only one track in each of your MIDIs. You will open each BMS file you make with flaaffy, and copy paste the hex data of each into the bottom of the Base BMS. &lt;br /&gt;
&lt;br /&gt;
=== Copying and pasting ===&lt;br /&gt;
In your exported BMS, look for the instance of &amp;lt;code&amp;gt;A420&amp;lt;/code&amp;gt; (if there are multiple, use the last occurrence of it). This A420 is what sets the bank of the sequence, and it will be followed by either a 00, 01, 02, 03, 04, or 05 after it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use bank 0, change it to &amp;lt;code&amp;gt;A42000&amp;lt;/code&amp;gt;, if you want to use bank 4, change it to &amp;lt;code&amp;gt;A42004&amp;lt;/code&amp;gt;, and so on.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy &amp;lt;code&amp;gt;A420&amp;lt;/code&amp;gt; and the entire remainder of the file, and paste everything into your Base BMS, anywhere at the bottom of it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=160px heights=160px&amp;gt;&lt;br /&gt;
File:InteractiveBMStutorial2.png|This is what you should copy. If your track has a lot of notes in it, this can be much longer.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=220px heights=220px&amp;gt;&lt;br /&gt;
File:InteractiveBMStutorial3.png|This is how you should paste in the sequences.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should paste each converted BMS on a new line, separated by an empty line of zeros so its easy to tell where each sequence begins.&lt;br /&gt;
&lt;br /&gt;
=== Looping ===&lt;br /&gt;
Notice the &amp;lt;code&amp;gt;C80000XXXX&amp;lt;/code&amp;gt; at the very end of the sequence you pasted in (the C80000 will be the same, but the numbers at the end will be different). The &amp;quot;XXXX&amp;quot; tells the sequence where the song loops and should restart at. Change XXXX to be where the sequence starts in the base BMS file. (Ex: do &amp;lt;code&amp;gt;C8000011D4&amp;lt;/code&amp;gt; if the sequence starts at 0x11D4).&lt;br /&gt;
&lt;br /&gt;
== Finishing touches ==&lt;br /&gt;
=== Fill in the mixer ===&lt;br /&gt;
After you have imported all the sequences, have made sure all the &amp;lt;code&amp;gt;A420&amp;lt;/code&amp;gt;&#039;s have the right bank, and looped them, go back to the Base BMS mixer and fill in the appropriate information. (Bank, program, volume, panning, sequence location.) The &amp;quot;sequence location&amp;quot; will be the offset where each &amp;lt;code&amp;gt;A420&amp;lt;/code&amp;gt; is.&lt;br /&gt;
&lt;br /&gt;
(Note: You do not have to import the same sequence over and over again if there are any identical sequences; you are free to reference the same one sequence and just give them different instruments. This is useful for sunset versions or treasure mix instruments.)&lt;br /&gt;
&lt;br /&gt;
=== Null track ===&lt;br /&gt;
If you don&#039;t want a track to play anything, have it go to the &amp;quot;null track&amp;quot; located at &amp;lt;code&amp;gt;0B04&amp;lt;/code&amp;gt;. (If you look, it&#039;s just a single &amp;quot;FF&amp;quot;, which is a sequence that ends immediately.) This is what each track is set to by default in the provided Base BMS.&lt;br /&gt;
&lt;br /&gt;
=== Tempo ===&lt;br /&gt;
You don&#039;t have to touch anything in the header at the top of the Base BMS, except for changing the BPM. The BPM for your song is located at 0xEA and takes up two bytes. (Ex: &amp;quot;&amp;lt;code&amp;gt;0066&amp;lt;/code&amp;gt;&amp;quot; for 102 BPM).&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Add in an extra line of zeros or two at the end of your finished Base BMS, because it sometimes crashes if extra padding is not there.&lt;br /&gt;
&lt;br /&gt;
=== trackMap ===&lt;br /&gt;
Make sure the tracks in the Base BMS mixer go in order: Main -&amp;gt; Task -&amp;gt; Treasure -&amp;gt; Enemy near -&amp;gt; Battle -&amp;gt; Spiderwort. Same for the sunset version.&amp;lt;br&amp;gt;&lt;br /&gt;
Open the sequence trackMap in &amp;lt;code&amp;gt;/user/Wakai/&amp;lt;/code&amp;gt;, find the song you are replacing (forest.bms, last.bms...), and [[Trackmap parameters|edit the values in the trackMap]] to reflect how many instruments will be in each mix. The main and sunset version will use the same mapping. You can make unnecessary tracks silent in the Base BMS&#039;s mixer if your sunset version has less instruments.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Tracks not looping correctly ===&lt;br /&gt;
Make sure each track is exactly the same length. You can export your entire song as one MIDI, convert it to BMS, and import it into the game as an un-interactive BMS file just to check. Flaaffy is finicky with looping occasionally; you may need to add a note at the end or start of a track so flaaffy knows thats the definitive start/end point of that track. (Make the note very quiet, low-pitch, and or short so its practically inaudible.)&lt;br /&gt;
&lt;br /&gt;
=== Tracks not looping at all ===&lt;br /&gt;
Double-check you added the -loop argument in flaaffy. Test with an un-interactive BMS file. Make sure there isn&#039;t any stray information somewhere in your MIDI.&lt;br /&gt;
&lt;br /&gt;
=== Volume/panning/program settings not working ===&lt;br /&gt;
It is possible there is volume automation, panning automation, or program changes somewhere in your MIDI/BMS you have imported. This is something you can add intentionally if you really want to (like changing the program for a track in the middle of the song), but it will override the values you put in the Base BMS mixer.&lt;br /&gt;
&lt;br /&gt;
=== Track not playing at all===&lt;br /&gt;
The most common cause of this is accidentally setting the wrong bank.&lt;br /&gt;
&lt;br /&gt;
=== Missing/dropped notes ===&lt;br /&gt;
This is an another issue with flaaffy. If a &amp;quot;Note On&amp;quot; also occurs at the same time a &amp;quot;Note Off&amp;quot; of the same pitch does, or multiple &amp;quot;Note On&amp;quot;s occur at the exact same millisecond, flaaffy&#039;s BMS won&#039;t render those notes. You might run into this often when instruments try to play chords.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simple fix for flaaffy is to make sure notes of the same pitch do not touch each other (put a tiny bit of empty space between them), and to slightly skew/slant each note in chords.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-hover&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:InteractiveBMStutorial4.png|Make sure the notes in a chord don&#039;t occur at the same time.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, JAIMaker does not run into this issue for its BMS conversions. If you decide to use it instead, you will need to be more precise about importing the data from the BMS files into the Base BMS.&lt;/div&gt;</summary>
		<author><name>Asheevee</name></author>
	</entry>
</feed>