vitor251093 / KHMelonMix

Kingdom Hearts 358/2 Days - Melon Mix (DS Emulator)
GNU General Public License v3.0
230 stars 11 forks source link

Include Re:Mix OST Using RAM Values #223

Open R3DRAW opened 2 months ago

R3DRAW commented 2 months ago

Is your feature request related to a problem? Please describe. This is more of advice / request than a problem.

Describe the solution you'd like A while ago before kh2 was on PC officially and we could only play the Re:Mix versions on console. I created a application from another mod to replace the music. Basically i used the other mod's system that read RAM values from PCSX2 (ps2 emulator) to get the RAM value for when battle music / field music is playing in the game, then i used the RAM value for the world to determine what music needed to be played. Then i would use my application itself to play the music with Windows Media Player. I'm not sure if RAM can be read the same way on MelonDS so i thought id shoot this request.

Ex:

if ( MusicRAMString == BattleMusicValue && WorldRAMString == SpecificWorldValue){ //Play Media Player with fade transition }

Amazing work on the project, and thanks for all the work you have done.

vitor251093 commented 2 months ago

Hello!

RAM detection can be done; that's we are doing the cutscene replacement.

We currently already have an open issue for that though (#204). Using the RAM isn't mentioned on the description there, but that's what I plan to use :)

It shouldn't be hard to figure out the music address. The complex part right now is figuring out how to mute the DS OST, without making the game mute as a whole, so we can replace only the soundtrack.

R3DRAW commented 2 months ago

I'm not how sure you are against shipping roms with the project, but if that's something you are willing to do, I can do a test with modifying the rom to replace the midis with blank sounds. I've done a successful music swap with the rom before. Two examples in those links

https://x.com/r3draw_studios/status/1791628895445295522?s=46&t=KfHaWEb23nbK9EsAIu4hDA

https://x.com/r3draw_studios/status/1791524912986759365?s=46&t=KfHaWEb23nbK9EsAIu4hDA

vitor251093 commented 2 months ago

Currently, in order to avoid problems with Square, we are not shipping ROMs, and instead, we recommend people dump their own NDS cartridges.

However, the amount of control we have is quite big, since we are modifying melonDS. We can, for example, update the RAM on execution time in order to replace the loaded track, or even replaced the music ID with something else, stopping the music from being loaded at all, but still figuring out which music was going to start playing. Those are all hypothesis though, based on what we did with the cutscenes.

sandwichwater commented 2 months ago

i have a music code ive been using from years ago thatll solve that issue , it should work as it just changes the instrument volumes to zero , meaning the tracks will still be detectable . this should allow us to , in theory , play music with the same timing as the original , fading in and out correctly , and avoid any potential issues as its all simply just a cheat code