Skip to content

Contributing

Colin E edited this page Apr 24, 2024 · 5 revisions

Tools needed

Citric Composer: Can be used to view and edit the sound archive.
caesar: Extracts and converts all instrument banks in the sound archive to soundfont files.
seq64: If porting from 64, converts from their sequence format to midi.
MidiEditor: An accurate midi editor.
VirtualMIDISynth: Allows MidiEditor to use the soundfonts to play the sequences.
LMMS: Optional lossy midi editor, but can still be used to more easily preview sequences.
Nitro Studio 2: The midi2sseq executable converts midi to DS sequence, that can later be remade to 3DS sequence.
SequenceConvert: Converts sequences between binary and text format.

First time setup

To be written?

How to create a 3DS sequence

Preparing the midi for 3DS conversion

If this is a song that needs looping points, one easy solution is to add notes on each track that represent the loop jump points. For example, set C8 on all tracks as the Loop Start, and C0 as the Loop End.

Also if the sequence is ported from 64, instruments and drum notes may need to be fixed.
See here what the index for each instrument in the 64 version is!
As can be seen on the website, there are several empty slots. On the 3DS version, the instrument indexes in the banks have been squashed. That means that for, for example, the Hyrule Field bank, the Harp (instrument 14), is at index 13 on 3DS. In the Ganondorf Battle bank, the Piano (instrument 13), is at index 9. Additionally, if the bank has drums, it seems to always be on the last index, like program 15 for the Hyrule Field bank, instead of program 127.

Drums are also different. Not only are they placed different in the instrument, but they also seem to be in the reverse order of pitch. To know where to move it, at the moment the best is to use LMMS and select all notes on the key, and move and test until it sound best.
After you know where to move it, go back to MidiEditor. There doesn't seem to be an option to select all notes of a key here, so you have to use the selection tool and mark all notes instead.
Important! If you're using the vertical move tool, know that it does move all notes back one tick each time. This may affect the output result and make these notes play too early. To counter, use the horizontal tool a tiny bit to the right. When it's past where it should be, use the vertical tool again enough times to place the notes back where they should be. Another solution is to set the new note of the selection instead, in the bottom right.

You can use the drum conversion helper tool on this repo to help determine which drum note on 64 is the same on 3DS! If it's invalid there is no exact equivalent, and you'll have to use another pitch that sound good instead.

Midi to cseq conversion

Use midi2sseq on the midi. This will create a binary DS sequence. Next, use SequenceConvert on it to convert it to text. Rename the file extension from bsseq to cseq.

Editing the cseq

Open the cseq in a text editor. Now, add all of the necessary labels. See the original or previous sequences for how that looks. Replace the Loop Start marker notes with labels, and the Loop End note markers with a jump to the Loop Start label. Make sure that these new labels and jump commands are after any other commands than wait, since they were originally interpreted as notes. When done, use SequenceConvert again to convert to bcseq.

Creating a cmeta file

The cmeta file is a text file with various keys and values. Look at this one to see how it can be written.

  • banks takes up to four numbers that indicate which banks that should be used.
    Can be written as decimal, hexadecimal with 0x prefix, or binary with 0b prefix.
  • chFlags takes a two byte bit mask that sets which channel flags get enabled. The first bit enabled the first channel, the second bit the second channel, and so on.
    Can be written as decimal, hexadecimal with 0x prefix, or binary with 0b prefix.
  • volume takes a single unsigned byte value that sets the volume from 0% to 200%. That is, it goes from 0 to 255, where 127 is 100%.
    Can be written as decimal, hexadecimal with 0x prefix, binary with 0b prefix, or in percentage from 0% to 200%.
  • category takes the name of a music category node that the sequence will be placed within if the categorization is set to be done automatically.
    The name can include the exclamation mark, but doesn't have to.