Difference between revisions of "Creating cave music"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Edit 1)
Line 20: Line 20:
  
 
== Setting up your BMS file ==
 
== Setting up your BMS file ==
 +
Starting with a completely blank BMS file, begin by pasting the following:
 +
<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
 +
</source>
 +
Every cave music BMS begins with this same information.
 +
<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>
 +
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>
 +
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.
 +
<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>
 +
<code>C600 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA 00AAAA FFFFFF</code><br>
 +
<br>
 +
Our BMS should now currently look like this:<br>
 +
<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
 +
</source>
 +
<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>
 +
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>
 +
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.
 +
<br><br>
 +
Let's use <code>BBBB</code> as placeholders again, and create 16 of them. Insert this into your BMS:<br>
 +
<code>00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB 00BBBB FFFFFF</code><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>
 +
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>
 +
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.
 +
<br><br>
 +
You can paste the following placeholder information for now:
 +
<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.
 +
<br><br>
 +
== How is your BMS looking? ==
 +
If you have been copy-pasting everything correctly, your BMS will look like this:
 +
<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 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
 +
</source>
 +
== 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>
 +
Once you are ready, have them nicely organized and ready to be exported into individual MIDI files:
 +
<gallery mode="packed-hover" widths=400px heights=400px>
 +
File:Logic_Pro_gestures.png|A Logic Pro project with a bunch of short blocks of music. Each block will be a "gesture".
 +
</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>
 +
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>
 +
Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the "Double Speed" transformation twice on each block.
 +
<br>
 +
== Inserting gestures ==
 +
Gestures are basically formatted the same way as any normal musical information in a BMS file.
 +
A gesture begins with <code>C40000015D</code>, and then right after will be the hexadecimal value of the first note's pitch.
 +
[[Category:Pikmin 2]]

Revision as of 01:40, 10 October 2023

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 cover function as a walkthrough for creating your own randomly sequencing cave song. Most of the editing will be done in hexadecimal.

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 beforehand.
  • A MIDI to BMS converter, like flaaffy. You will be generating a lot of tiny BMS files, to turn them into "gestures".

Overview of file functions

Here are some infographics that you can reference at any time.

Setting up your BMS file

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

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

Every cave music BMS begins with this same information.

Gesture set locations

Right after EF342134 will be a list of every gesture set's location. This section begins with C600, followed by a sequence of offsets. Each entry in this sequence is separated by "00". FFFFFF indicates the end of this list.

Here is an example of how this sequence should be formatted:
C600 0001B0 0001BF 0001CE 0001D4 0001DA 0001E9 0001F8 0001FE 000204 00020A FFFFFF
Gesture set "0" will be at 0x1B0, gesture set "1" will be at 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 AAAA 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:
C600 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:

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


Timing ruleset locations

Right after FFFFFF 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. 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 use the timetable at 0x5AF, timing ruleset "2" will use the timetable at 0x5C1, and so on. There are a total of 10 timing rulesets listed in the above sequence.

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

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 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. 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.

You can paste the following placeholder information for now: 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC 00CCCC 00CCCC FFFFFF 00CCCC FFFFFF
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.

How is your BMS looking?

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

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

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.

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. If you import these gestures as it, they will play 4 times as slow.
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.
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

Gestures are basically formatted the same way as any normal musical information in a BMS file. A gesture begins with C40000015D, and then right after will be the hexadecimal value of the first note's pitch.