DKC1 Custom Music Possible?

Share and discuss all facets of DKC ROM hacking...

DKC1 Custom Music Possible?

Postby Markster » August 9th, 2011, 9:17 am

You remember what SMW could do, import custom music using instruments from SMW, well I found this really old japanese hack of DKC, it had custom music, its called SDK mex, I found it here : http://u12.getuploader.com/tyutyuten/do ... dk_mex.zip

Don't worry, it's a IPS...

Of course most of the music hacking stuff is not compatible with the (U) ROM files, so i'm not sure if you could do the same with the (U) ROM.
Expedition Leader
Bananas received 37
Posts: 1050
Joined: 2010

Re: DKC1 Custom Music Possible?

Postby KingBrett » October 9th, 2011, 2:08 am

It's probably possible, the japanese and english ROMs are pretty much the same. I'd like to put Krematoa Koncerto into my DKC hack for its Lost World located behind Kongo Jungle (The extra Donkey Kong head behind Kongo Jungle doesn't really lead there as there is no Lost World in the original game, only in my hack but it will take some time so Necky Nutmare will only be in Chimp Caverns like in the GBC port for its beta release) There are some differences between those ROMs but I'm sure it's possible for custom music to be in the (U) version as well. But then again, I'm new to hacking the DKC games so I'm just making a guess. :P
Tourist
Bananas received 1
Posts: 33
Joined: 2011

Re: DKC1 Custom Music Possible?

Postby Mattrizzle » October 9th, 2011, 3:20 pm

Anything the SNES can do is possible when you're hacking a ROM. The question that should be asked is, "How?"

Here are my notes on the music/sound format in the DKC trilogy:
Spoiler!
Code: Select all
Header of music data:
Bytes 0x00-0x01 Length of data, not including this or the next two bytes (DKC1)/SPC RAM Destination (DKC2 & 3; Always 1300)
Bytes 0x02-0x03 SPC RAM Destination (DKC1, always 12A0)/ Length of data divided by two (DKC2 & 3)
0x04-0x13   SPC RAM Pointers to each instrument track's data for (2 bytes per pointer, 8 tracks per song)(this for song 0x00 in a set in DKC2 & 3)
0x14      Music Tempo
0x15      Sound Effect Tempo (Always A0 in DKC1; FF in DKC2 & 3)

DKC2 & 3 only:
0x16-0x??   Pointers to each song's instrument track pointer table (2 bytes per song; length varies depending on how many songs are in the set)
0x??-0x??   SPC RAM Pointers to each instrument track's data for song 0x01, followed by music and sound effect tempo (if the song exists)
0x??-0x??   SPC RAM Pointers to each instrument track's data for song 0x02, followed by music and sound effect tempo (if the song exists)
...etc.

The actual instrument track data comes after this, and can include the following control codes:

Control Codes (documentation is still incomplete):
00               End of sound data
01 II               Set Instrument sample (Valid values: 00-45(DKC1)
02 LL RR            Volume Levels (separate values for left and right speakers)
03 yy XX            Play sound data at SPC RAM address XXyy
04 NN yy XX         Play sound data at SPC RAM address XXyy NN times, then return
05               ????? (sometimes used at the end of sound data instead of 00)
06 ??               Global note length (if not set, must specify a note length after each note value)
08 ?? ?? ?? ??           ????? (DKC1)
0B ??               ????? (DKC1)
10 ?? ??            Attack/Decay/Sustain/Release(ADSR) of current instrument?
11 LL RR            Master Level (LL = left, RR = right; valid range: #$00-#$7F)
12 ??               ?????
13 PP            Set Instrument Pitch (signed)
14 PP            Increase/Decrease Instrument Pitch (signed)
15 KK LL RR         Echo of entire song (KK = feedback, LL = left echo level, RR = right echo level)
16 ?? ??            ?????
17               ????? (DKC1)
18 ?? ?? ?? ?? ?? ?? ?? ??      Finite Impulse Response(FIR) Filter for whole song
21 yy XX            Play sound data at SPC RAM address XXyy, different from 03? (DKC2 & 3 only)
23 VV            Volume Levels (same value for both speakers, DKC2 & 3 only)
28 II LL RR         Set instrument and left/right levels (DKC1 only?)
2A ??               ????? (DKC1 only?, Usually #$64)
80               Rest
81-??               Music Note Scale


And here's a patch showing that it can be done:
dkc_goal_music_replacement.ips
(5.21 KiB) Downloaded 1200 times
Apply this to a Donkey Kong Country (U) (V1.0) ROM. The file name of the patch tells what it does.
Veteran Venturer
Bananas received 221
Posts: 545
Joined: 2008

Re: DKC1 Custom Music Possible?

Postby VideoViking » October 9th, 2011, 4:31 pm

One of the songs I've been interested to hear in the form of an SNES edition is this one:

http://www.youtube.com/watch?v=EqyyFV9XF2g

You're saying, you can recreate it for the SNES?
Treasure Hunter
Bananas received 41
Posts: 329
Joined: 2009

Re: DKC1 Custom Music Possible?

Postby Mattrizzle » October 11th, 2011, 12:58 am

Yes, it should be possible.

(After reading the sentence above, if anyone is thinking about asking me the question "Will you do it for me?" my answer is no. If I started taking requests, they would never cease and I would be buried in a pile of them.)
Veteran Venturer
Bananas received 221
Posts: 545
Joined: 2008

Re: DKC1 Custom Music Possible?

Postby TheUltimateKoopa » July 23rd, 2012, 6:27 am

VideoViking wrote:One of the songs I've been interested to hear in the form of an SNES edition is this one:

http://www.youtube.com/watch?v=EqyyFV9XF2g

You're saying, you can recreate it for the SNES?


Technically, the SNES equivalent is "Voices of the Temple", but if you mean in that actual style, then that'd be awesome.

I always thought of it as some kind of dance/rock tune.
Trainee Trekker
Bananas received 4
Posts: 95
Joined: 2008

Re: DKC1 Custom Music Possible?

Postby Markster » August 8th, 2012, 4:14 am

Update!
----------
I am researching with DKC1, 2, and 3 music editing, I'm trying to find out about how the instruments work, and I'm learning ASM on the side.
Expedition Leader
Bananas received 37
Posts: 1050
Joined: 2010

Re: DKC1 Custom Music Possible?

Postby KeysOfMyMind » February 24th, 2013, 4:51 am

Jesus christ and people call these games simple what the hell :p
Tourist
Bananas received 2
Posts: 23
Joined: 2013

Re: DKC1 Custom Music Possible?

Postby Axis » March 22nd, 2013, 7:47 am

KeysOfMyMind wrote:Jesus christ and people call these games simple what the hell :p
Previously "Kiddy"
Bananas received 3
Posts: 96
Joined: 2013

Re: DKC1 Custom Music Possible?

Postby Raccoon Sam » March 22nd, 2013, 9:09 pm

Music hacking can be easy, given the right set of tools, but what amazes me is how thorough Mattrizzles documentation is. Documenting music data has always (to me, at least) been very difficult.
I've dealt with Super Mario Land's music format in the past, and even though the Game Boy only has four channels, I never finished the documentation. Making notes (heh) is easy when comparing changes in the ROM after you've edited graphics/tilemaps/physmaps, because upon testing you can literally see the changes you did. When it comes to editing music, I find it extremely tedious to 'hear' the changes. What byte controls the note's length or octave is somewhat easy, but echo, right/left channel, pitch bend? Come on!
Maybe I just have a bad note ear :rant:
Trailblazer
Bananas received 35
Posts: 267
Joined: 2008

Re: DKC1 Custom Music Possible?

Postby Mattrizzle » March 23rd, 2013, 7:23 am

To be honest, some of the notes I have related to the music format were lifted from the Japanese documents that Markster linked to in the original post. I just ran them through Google's (sloppy) translator, and tried my best to figure out what the translation said.

The original link appears to be down now, but fortunately, I still have the documents and patches!
sdk_bgm.zip
(18.53 KiB) Downloaded 1165 times

In order to view these properly, you need a text editor that can render text using Shift-JIS encoding. Notepad++ can do this.

Also, this SNES SPC700 Player is invaluable when you're trying to see how the code being executed by the sound processor is represented in hexadecimal. It has seven different information displays, which can be accessed by double clicking on the main area of the window when an SPC file is playing. It has other useful features as well, such as the ability to adjust the tempo and pitch.
Veteran Venturer
Bananas received 221
Posts: 545
Joined: 2008


Re: DKC1 Custom Music Possible?

Postby Cyclone » June 20th, 2022, 5:10 pm

I am trying to change the music and sound around in the game. I translated this bit from the doc Mattrizzle posted.

In addition to this, the waveform set system is used.
This is the one that reads the specified waveform into ARAM.
There is one waveform set for each song.
The pointer to the waveform set starts at 0x0AB212. It is specified only in the lower 2 bytes.
The most significant byte is fixed at 0x0A.
For song number 00, it is "0xB286", in which case the waveform set starts at 0x0AB286.


I searched for the 86b2 pointer / address but it didn't find any. Any ideas?
Thanks.
Expedition Leader
Bananas received 559
Posts: 1211
Joined: 2008


Re: DKC1 Custom Music Possible?

Postby rainbowsprinklez » June 22nd, 2022, 10:47 pm

Loveemu did amazing work! I heavily used his documentation to create the music here!

Veteran Venturer
Bananas received 108
Posts: 568
Joined: 2016

Re: DKC1 Custom Music Possible?

Postby Cyclone » June 24th, 2022, 3:23 pm

How would I go about changing Crank's music with a different one?

and good work sprinklez

Mattrizzle would you be willing to help me out?
Expedition Leader
Bananas received 559
Posts: 1211
Joined: 2008

Re: DKC1 Custom Music Possible?

Postby rainbowsprinklez » June 27th, 2022, 12:49 am

That should be fairly easy: just swapping tracks. An array of songs to play by level code is here:
int MUSICTRACK = 0xb983b6;
Actually, for what you describe that might be harder. Changing LEVELS will work as I said. Kong family might be a bit different.
Veteran Venturer
Bananas received 108
Posts: 568
Joined: 2016

Re: DKC1 Custom Music Possible?

Postby Cyclone » June 27th, 2022, 10:08 am

Yes. I knew about that pointer table. It was missing some songs, like the kong family songs? There was no pointer in the table for Cranky's and the kongs songs.
But I figured it out. thanks to MAttrizzle again for the help!
Expedition Leader
Bananas received 559
Posts: 1211
Joined: 2008


Return to ROM Hacking

Who is online

Users browsing this forum: No registered users and 4 guests

cron