Difference between revisions of "Creating Interactive BMS Files"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Finished the documentation, for now at least.)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{todo|Add diagrams and example images.}}
+
This guide will function as a walkthrough for creating interactive music for Pikmin 2's main areas.<br>
  
So you want your pikmin 2 music to have the interactivity of normal pikmin 2 songs? Well, I can tell you how to do that. While Flaaffy made bms files dont have interactivity, enough hex editing can fix that. Note that this all only applies to the four overworld themes. Caves use a completely different system for interactive music that isn't yet understood. Also note that music made this way wont have the Louie swing variant, just the interactive event tracks(working, treasure, enemy near, combat, spiderwort) and the sunset version. (Keep in mind this tutorial assumes you have at least decent knowledge of Hex editing going in).
+
''Requirements:''
 +
* A DAW to create your own short MIDIs in, like FL Studio or Logic Pro. A DAW is also great for sketching out your song ideas/song's structure beforehand.
 +
* A MIDI to BMS converter, like [[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.
 +
* 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).
  
 +
Most of the editing will be done in hexadecimal. Creating [[Creating cave music|cave music]] is very similar.
  
 +
== Preparing and exporting MIDIs ==
 +
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.<br>
 +
If your song has 14 instruments, then you'll export 14 MIDIs. Make sure each track is the same length so that looping will work properly.<br><br>
  
== Getting started ==
+
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.<br>
First off, make your midi. It's good to know ahead of time what tracks will serve what purpose. Remember that the combined total of all tracks can't exceed 16. I usually have between 5 - 8 main tracks and 1-2 for each of the special mixes. also make sure you have AudioRes/Seqs/seq.arc extracted, with all the bms files ready to replace. n_tutorial.bms is the Valley of Repose theme, Forest.bms is the Awakening Wood theme, yakushima.bms is the Perplexing Pool theme, and last.bms is the Wistful Wild theme.
+
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.<br><br>
 +
Logic Pro can easily speed up MIDI regions with MIDI Transform. You want to use the "Double Speed" transformation twice on each entire track.
 +
<gallery mode="packed-hover" widths=400px heights=400px>
 +
File:InteractiveBMStutorial5.png|Shorten the length of the MIDI by 4x, but don't change your project's tempo.
 +
</gallery>
 +
(Note: While you *can* technically just multiply the BPM value by 4 in the BMS later on, Louie's variant is dependent on the BPM being something normal, so the swing will not be applied properly if you do that.)
  
Next, make the bms of your midi like you normally would with Flaaffy. The instruments and banks you choose with flaaffy don't matter. Make sure each track only loads an instrument and program once at the beginning of the track and never again. Get your bms and open it in HxD. Also open specifically the original last.bms in HxD. Regardless of what song your making, last.bms is the easiest to work with by far.
+
== Base BMS file ==
 +
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:
 +
<pre>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 0F05FE00 78FD0066 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 00058CC8 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</pre>
  
In last.bms, delete everytyhing after <code>0x04 90</code>, leaving just the header. Now, in your flaaffy bms do a search for the first instance of <code>a4 20</code> in the bms, and delete everything before that. It should be around 2 lines in. Now, cut and paste whats left of the flaaffy bms to the end of last.bms.
+
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:
  
 +
<gallery mode="packed-hover" widths=400px heights=400px>
 +
File:InteractiveBMStutorial1.png|You can use this image as a guide for the "mixer".
 +
</gallery>
  
== Staying Organized ==
+
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.<br>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.
You will surely want a text file with notes to keep yourself orgranized, because things can get messy coming up. Look at figure 1 to see how I format mine. From now on a track of the flaaffy bms will be reffered to as a "note set" and the actual tracks of the bms are just "tracks". You'll want to write down the offset of every instrument youre using, the offset of every note set, and what track uses what note set and instrument. Using this will make the "track setting" step far easier.
 
  
 +
== Importing sequences ==
 +
=== Converting ===
 +
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 "-loop" argument in the first command, so it knows to loop the sequence):
  
== Setting Loops ==
+
<pre>mareep.exe mareep -errand jolt -input exampletrack02.midi -output exampletrack02.txt -loop
 +
mareep.exe mareep -errand cotton -input exampletrack02.txt -output exampletrack02.bms</pre>
  
Now that you have the base of your interactive bms, its time to set the looping for every track. First, go to <code>0x04 90</code>. You should see <code>A4 20</code>. Remember the offset this <code>a4 20</code> is at. Now search for the next <code>a4 20</code> in the bms. Now you're at the start of the next note set. Before anything else, add padding 00s to move the a420 you just found to the start of a new line. It will simplify steps in the future. Look back a bit and you will see the last track's looping jump branch. In a standard flaaffy bms, it will be an offset to the start of the note set followed by a "E7". Replace this E7 with FF and change the offset right before it to the start of the previous <code>a4 20</code> plus 0x6. For example. If a track has a <code>a4 20</code> starting at <code>0x0d 90</code>, the loop offset at the end should look like this, <code>C8 00 00 0d 96</code>. Continue to do this for every note set, search for <code>a4 20</code>, move it to the start of next line, change the loop offset to point to the <code>a4 20</code> +6, change the E7 to FF. do this until you get to the final track. Make sure as you do this, take notes of the offset of every <code>a4 20</code>. The final line has to be 32 byte aligned, so add 00 padding if needed.
+
Flaaffy turns the MIDI into a text file before it is converted into a BMS. The text file is "cotton", flaaffy's assembly language. Viewing the cotton file can be useful for double checking there'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.  
  
== Setting Instruments ==
+
=== Copying and pasting ===
Go to the top part of your bms. Specifically, jump to offset <code>0x 03 2b</code>. You will see a C4, followed by 00 00 01 8E. This part shouldn't be touched, but the part after it is important. There should be a <code>A4 20 XX A4 21 XX</code>. The byte following a4 20 is the bank this instrument will use. The a4 21 is the program. Make sure you know what bank and programs can be used within the bms you are replacing. Also keep in mind these are hex values, so program 14 would be entered as <code>A4 21 0e</code>, not <code>A4 21 14</code>. Continue to look around for these a4 21s, and take notes on the program number and the offset to the <code>C4</code> in the <code>C4 00 00 01 8E</code> before it. The instrument offset at <code>0x 04 53</code> specifically is strange because it sets a program twice, only the second one matters though.
+
In your exported BMS, look for the instance of <code>A420</code> (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.<br>
  
== Setting Tracks ==
+
If you want to use bank 0, change it to <code>A42000</code>, if you want to use bank 4, change it to <code>A42004</code>, and so on.<br>
Now that you have the loops for all the note set set up, and all the instrument setting in place, its time to actually assign the note set offsets and instrument offsets for each track.
 
First, go to the header of the bms. Specifically, go to <code>0x1CB</code>. You should see a C4, followed by two <code>00</code>s and a value. This value is the instrument of the first track. This is where the notes youve been taking come in use. Change this value to the instrument you want track 1 to use. After this is a <code>C8</code>. After this is the note set offset. Change this to the offset of the note set you want, plus <code>0x9</code>. For example, if you want it to jump to note set 1, that will always be at 0x0490. Lets say we want it to use an instrument at <code>0x03 EA</code>. The Hex data will look like this: C4 00 00 04 99 C8 00 00 03 EA FF. That FF at the end signifies the end of this tracks data, afterwards is the next tracks data. Note that it alternates with the sunset versions of tracks, so it goes "track 1, track 1 sunset, track 2, track 2 sunset" and so on. For sunset versions of songs, I normally make tracks I want using bank 4 program 50, and tracks I don't want set to any instrument that isn't actually loaded with the wscene, so it's silent. The note set should usually be the same as the normal equivalent, unless you're really trying to be creative. Repeat this process, setting the instrument and note set for every music track in the bms.
 
  
== Final Touches ==
+
Copy <code>A420</code> and the entire remainder of the file, and paste everything into your Base BMS, anywhere at the bottom of it.
Once you have set the insrtument and note set for every track, you're nearly done! Next, we need to set the tempo of the bms. Go to 0xE9 in the bms, and you should see a <code>FD</code>. After it is a 2 byte value that is the tempo. It may take trial and error to get the proper value for this. Sometimes I need it as low as 100, other times as high as 400. Also, I've noticed that the game tends to crash if there isn't enough 00 padding at the end of the bms, so I recomend adding another line or two.
 
  
Once your tempo is set, We're done with the bms! But we aren't done yet. Go to <code>user/Wakai/trackMap_seq_W.txt</code>, and find your bms file's settings. Now you set how many tracks each variant gets! "basic" is the standard mix, "event" is the working mix, "otakara event" is the treasure mix, "kehai" is the enemy near mix, "battle" is the combat mix, and "ground" is the spiderworts. the "pikmin" stuff after this doesn't seem to do anything. Another thing worth mentioning is the global volume of the bms that is set in <code>user/totaka/bgmlist.txt</code>.
+
<gallery mode="packed-hover" widths=160px heights=160px>
 +
File:InteractiveBMStutorial2.png|This is what you should copy. If your track has a lot of notes in it, this can be much longer.
 +
</gallery>
 +
 
 +
<gallery mode="packed-hover" widths=220px heights=220px>
 +
File:InteractiveBMStutorial3.png|This is how you should paste in the sequences.
 +
</gallery>
 +
 
 +
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.
 +
 
 +
=== Looping ===
 +
Notice the <code>C80000XXXX</code> 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 "XXXX" 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 <code>C8000011D4</code> if the sequence starts at 0x11D4).
 +
 
 +
== Finishing touches ==
 +
=== Fill in the mixer ===
 +
After you have imported all the sequences, have made sure all the <code>A420</code>'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 "sequence location" will be the offset where each <code>A420</code> is.
 +
 
 +
(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.)
 +
 
 +
=== Null track ===
 +
If you don't want a track to play anything, have it go to the "null track" located at <code>0B04</code>. (If you look, it's just a single "FF", which is a sequence that ends immediately.) This is what each track is set to by default in the provided Base BMS.
 +
 
 +
=== Tempo ===
 +
You don'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: "<code>0066</code>" for 102 BPM).
 +
 
 +
=== Padding ===
 +
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.
 +
 
 +
=== trackMap ===
 +
Make sure the tracks in the Base BMS mixer go in order: Main -> Task -> Treasure -> Enemy near -> Battle -> Spiderwort. Same for the sunset version.<br>
 +
Open the sequence trackMap in <code>/user/Wakai/</code>, 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's mixer if your sunset version has less instruments.
 +
 
 +
== Troubleshooting ==
 +
=== Tracks not looping correctly ===
 +
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.)
 +
 
 +
=== Tracks not looping at all ===
 +
Double-check you added the -loop argument in flaaffy. Test with an un-interactive BMS file. Make sure there isn't any stray information somewhere in your MIDI.
 +
 
 +
=== Volume/panning/program settings not working ===
 +
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.
 +
 
 +
=== Track not playing at all===
 +
The most common cause of this is accidentally setting the wrong bank.
 +
 
 +
=== Missing/dropped notes ===
 +
This is an another issue with flaaffy. If a "Note On" also occurs at the same time a "Note Off" of the same pitch does, or multiple "Note On"s occur at the exact same millisecond, flaaffy's BMS won't render those notes. You might run into this often when instruments try to play chords.<br>
 +
 
 +
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.
 +
 
 +
<gallery mode="packed-hover" widths=400px heights=400px>
 +
File:InteractiveBMStutorial4.png|Make sure the notes in a chord don't occur at the same time.
 +
</gallery>
 +
 
 +
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.

Latest revision as of 17:53, 18 April 2024

This guide will function as a walkthrough for creating interactive music for Pikmin 2's main areas.

Requirements:

  • A DAW to create your own short MIDIs in, like FL Studio or Logic Pro. A DAW is also great for sketching out your song ideas/song's structure beforehand.
  • A MIDI to BMS converter, like flaaffy. You will be exporting each track of your MIDI separately as its own BMS file, and importing them one at a time.
  • 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).

Most of the editing will be done in hexadecimal. Creating cave music is very similar.

Preparing and exporting MIDIs[edit]

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.
If your song has 14 instruments, then you'll export 14 MIDIs. Make sure each track is the same length so that looping will work properly.

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

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

(Note: While you *can* technically just multiply the BPM value by 4 in the BMS later on, Louie's variant is dependent on the BPM being something normal, so the swing will not be applied properly if you do that.)

Base BMS file[edit]

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:

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 0F05FE00 78FD0066 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 00058CC8 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

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:

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

Importing sequences[edit]

Converting[edit]

Convert all your MIDIs into BMS files with flaaffy. You can use the following commands in the command line (make sure to include the "-loop" argument in the first command, so it knows to loop the sequence):

mareep.exe mareep -errand jolt -input exampletrack02.midi -output exampletrack02.txt -loop
mareep.exe mareep -errand cotton -input exampletrack02.txt -output exampletrack02.bms

Flaaffy turns the MIDI into a text file before it is converted into a BMS. The text file is "cotton", flaaffy's assembly language. Viewing the cotton file can be useful for double checking there'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.

Copying and pasting[edit]

In your exported BMS, look for the instance of A420 (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.

If you want to use bank 0, change it to A42000, if you want to use bank 4, change it to A42004, and so on.

Copy A420 and the entire remainder of the file, and paste everything into your Base BMS, anywhere at the bottom of it.

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.

Looping[edit]

Notice the C80000XXXX 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 "XXXX" 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 C8000011D4 if the sequence starts at 0x11D4).

Finishing touches[edit]

Fill in the mixer[edit]

After you have imported all the sequences, have made sure all the A420'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 "sequence location" will be the offset where each A420 is.

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

Null track[edit]

If you don't want a track to play anything, have it go to the "null track" located at 0B04. (If you look, it's just a single "FF", which is a sequence that ends immediately.) This is what each track is set to by default in the provided Base BMS.

Tempo[edit]

You don'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: "0066" for 102 BPM).

Padding[edit]

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.

trackMap[edit]

Make sure the tracks in the Base BMS mixer go in order: Main -> Task -> Treasure -> Enemy near -> Battle -> Spiderwort. Same for the sunset version.
Open the sequence trackMap in /user/Wakai/, find the song you are replacing (forest.bms, last.bms...), and 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's mixer if your sunset version has less instruments.

Troubleshooting[edit]

Tracks not looping correctly[edit]

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

Tracks not looping at all[edit]

Double-check you added the -loop argument in flaaffy. Test with an un-interactive BMS file. Make sure there isn't any stray information somewhere in your MIDI.

Volume/panning/program settings not working[edit]

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.

Track not playing at all[edit]

The most common cause of this is accidentally setting the wrong bank.

Missing/dropped notes[edit]

This is an another issue with flaaffy. If a "Note On" also occurs at the same time a "Note Off" of the same pitch does, or multiple "Note On"s occur at the exact same millisecond, flaaffy's BMS won't render those notes. You might run into this often when instruments try to play chords.

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.

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.