Pages: 1
Posted on 03-31-17, 01:56 pm (rev. 3 by  Ambiance 69 on 01-20-18, 06:39 pm)
Flurry


Karma: 585
Posts: 152/257
Since: 11-20-15
I've posted this already on DSHack.org, but why not post it here too?

Well, let's start.

What you're going to use:

MKDSCM 3 or EFE
Kiwi DS
HxD or any other Hex Editor
DS Sound Studio

Step 1: Load your ROM with MKDSCM or EFE, and extract your SDAT file.


Step 2: Extract your SDAT file to somewhere on your computer.


Step 3: Load your SDAT file with Kiwi DS and extract it. The extracted file should appear in the same directory as the SDAT file.


Step 4: Load your SBNK file in the hex editor:


Step 5: Edit the values accordingly to these:


INFO: Attack Rate ranges from 00 to 7F. The value 7F will make the instrument play instantly. The lower the value, the instrument will start quieter and then become the normal volume. Decay rate ranges from 00 to 7F. The value 7F will play the instrument continously with normal volume, and a lower value will make the instrument start playing normally then continue quieter. Sustain rate ranges from 00 to 7F. It's a lot similar to decay rate. Release rate ranges from 00 to 7F. The lower the value, the more the instrument will be echoed. The value 7F will have no echo. Pan ranges from 00 to 7F. Lower value plays the instrument on the left, 40 will play the instrument centered and 7F will make the instrument play on the right. After editing, you can preview how your custom instrument sounds like using DS Sound Studio.

Step 6: Load your SDAT file with DS Sound Studio:


Step 7: Right click on your SDAT file and replace it with the new one:


Step 8: Now save your SDAT file and use EFE to put your new SDAT file in your ROM:


NOTE: According to my tests, saving the ROM with MKDSCM causes a crash on games other than MKDS, but EFE works perfectly. So, use EFE for saving the ROM.

Hope this helps!

UPDATE - December 9, 2017

I've just found a way to add new instruments to SBNK. To do so, when you dumped the SBNK file with Kiwi DS and loaded the SBNK file with an hex editor, just follow this procedure:


This is for single SWAV files, For multiple SWAV files, you can replace the three bytes "01 XX XX" shown in the screenshot above, with "11 XX XX". And for adding the details, you can add it like that:

S1 S2 S3 S4 S5 S6 S7 S8 YY YY 01 02 03 04 05 06 07 08 09 10 XX XX

S1 to S8 are the SWAV IDs, you can use up to 8 SWAVs. YY YY is 01 00. 01 to 10 are the instrument info shown in the screenshot, and you can repeat them with a different info. XX's are always 00. For example:

40 7F 00 00 00 00 00 00 01 00 04 00 01 00 3C 7F 7F 7F 78 40 06 00 00 00 3C 7F 7F 7F 78 40 00 00

In the example above, 40 is the pitch where the SWAV changes. In pitches 0 to 40, the SWAV 04 from the SWAR 01 plays (italicized here). In the pitches above 40, the SWAV 06 from SWAR 00 plays (underlined here).

Here's a test video:

When looking at to MKDS Beta SSEQ files by converting them to MIDI first, I've found out that the N64 Moo Moo Farm music had an unused track. It's MIDI instrument was "Music Box", which is a synth bass used in the musics of Shroom Ridge, SEQ_CIRCUIT2, final Figure-8/Mario Circuit, etc. Likely a leftover from an earlier version of the music.

UPDATE - January 20, 2018

HOW TO ADD/REMOVE DRUMS TO THE DRUM KIT

The three bytes starting from 0x238 is usually the pointer that tells where the drum kit is. i.e. For SBNK 73, 0x238 to 0x23A (three bytes) is 10 50 02, which tells that the drum kit starts from 0x250. There the first two bytes is the region. It tells which key pitches will be used, any pitch outside these boundaries are slient. The rest are the drum instruments. You can get more info by dumping the SBNK file with Kiwi DS.

To add the missing drums, simply add the instruments (ex. 01 00 05 00 01 00 3C 7F 7F 7F 78 40, which makes 12 bytes), next to the last drum instrument before the next instrument pointer. After adding the new drums, change the second byte of the region (mentioned above) to a higher value, i.e. if it's "20 50", and you added two drums, change it to "20 52". Then, for the instrument pointers that are at the beginning of the file, since drums start from 0x250 (can be different for other SBNKs), anything after 0x250 also needs to be increased. For example, since we've added 2 instruments, one takes up 12 bytes, 12 is C in the hex, two instruments = 24 bytes, therefore being 18 in the hex, so if an instrument pointer is "11 12 05", it's going to be "11 2A 05". Apply the same to the filesize, too. Filesizes are two bytes in each: 0x8 and 0x14.

Removing is basically the same as adding, but in reverse.
Posted on 12-10-17, 06:57 pm
Flurry


Karma: 585
Posts: 196/257
Since: 11-20-15
First post updated: showing the steps to add new instruments to SBNK files.
Posted on 12-17-17, 11:54 pm (rev. 1 by  thegreenbomb on 12-17-17, 11:55 pm)
Paragoomba
Genuine

Karma: 66
Posts: 4/69
Since: 12-17-17
So, is this showing how to add NEW MIDI instruments the SBNK's?

oh.. nvm
_________________________
You might not find me here a lot. I'm either doing other stuff or working on the MvL Community Remix.

You can help out here: https://discord.gg/Mq2W94g

GFX Tile Splitter
Posted on 12-22-17, 07:07 am
Koopa


Karma: 157
Posts: 42/103
Since: 03-04-13
works in NSMB or only in Mario Kart DS? 😐
Posted on 12-22-17, 07:25 pm
Flurry


Karma: 585
Posts: 200/257
Since: 11-20-15
This works in pretty much any game.
Posted on 12-23-17, 02:09 am
Koopa


Karma: 157
Posts: 43/103
Since: 03-04-13
Thank you friend 😊
Posted on 01-08-18, 06:03 pm
KingYoshi rereg.

Karma: 45
Posts: 14/41
Since: 12-21-17
Posted by Ambiance 69
INFO: Attack Rate ranges from 00 to 7F. The value 7F will make the instrument play instantly. The lower the value, the instrument will start quieter and then become the normal volume. Decay rate ranges from 00 to 7F. The value 7F will play the instrument continously with normal volume, and a lower value will make the instrument start playing normally then continue quieter. Sustain rate ranges from 00 to 7F. It's a lot similar to decay rate. Release rate ranges from 00 to 7F. The lower the value, the more the instrument will be echoed. The value 7F will have no echo. Pan ranges from 00 to 7F. Lower value plays the instrument on the left, 40 will play the instrument centered and 7F will make the instrument play on the right. After editing, you can preview how your custom instrument sounds like using DS Sound Studio.


Example:



Posted on 01-08-18, 10:34 pm
Red Goomba


Karma: 173
Posts: 27/35
Since: 09-04-16



Nella carne io sono uno, ma nello spirito, che sono e per sempre saranno sette.

Pages: 1