News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How can i change Dragon Warrior VII (PSX) music?  (Read 5214 times)

knighTeen87

  • Full Member
  • ***
  • Posts: 106
  • No More Room In Hell
    • View Profile
    • My personal site with Rom Hacks&Translations,Neo Geo Soundtracks,PSX Isos,CT 2007 Hack and more...t
How can i change Dragon Warrior VII (PSX) music?
« on: February 24, 2014, 06:57:48 am »
Inspired by the 3DS version, i have an idea. I would like to replace PSX version's original soundtrack with the symphonic suite, just like in the 3DS version. Is there an easy way to do it with proper (and beginner level) tools?  :)

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #1 on: February 24, 2014, 07:32:51 am »
If we're talking about streamed music, the answer is pretty much "no", but if your aim is to replace the instrument samples with symphonic ones, then it's doable yet certainly not an easy one.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

knighTeen87

  • Full Member
  • ***
  • Posts: 106
  • No More Room In Hell
    • View Profile
    • My personal site with Rom Hacks&Translations,Neo Geo Soundtracks,PSX Isos,CT 2007 Hack and more...t
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #2 on: February 24, 2014, 08:09:31 am »
Actually it was pretty easy for redbook audio games like Winning Eleven 2002, King of Fighters 96, etc. I just replaced old files with new ones but DW7 is not a redbook audio game. That's why i asked you. So i have to change midi samples then right?

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #3 on: February 24, 2014, 08:36:32 am »
Yes, that's what you need to do.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2626
    • View Profile
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #4 on: February 24, 2014, 09:28:42 am »
If there happens to have lots of free space on the disc (max. capacity is 650 MB) then yes it's easy to add streamed music.

However, the probability they released the game without already making a good usage of those 650MB is quite low. So unless you want to remove videos (which is usually what fills up most of the discs), you won't be able to insert streamed music.

Replace the samples and perhaps even the sequences should be doable once the sound engine is fully reverse-engineered, it would be a very similar hack than what I did to the Final Fantasy Advances. I'm pretty sure the PS1 also had some kind of common sound engine most game used, but that's about all I know about it.

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #5 on: February 24, 2014, 09:55:32 am »
You can't do streamed music because the game is more than likely to read other data from disk at runtime.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2626
    • View Profile
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #6 on: February 24, 2014, 10:00:34 am »
You could fix it to do it the Grandia way : Transfer a long time of sound data form disc to SPU mem, and then the disc is free for a dozen of seconds before another transfer should happen. Of course doing this in a hack is probably quite more difficult than doing it in your own program, I'd agree.

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #7 on: February 24, 2014, 10:07:40 am »
That would end up consuming over half the SPU ram, if not more, meaning there won't be much room left for other samples. Plus streaming to the SPU is quite the mess and requires a ton changes to the engine because of the way LIBSPU is programmed. It's just not worth the endless trouble.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2626
    • View Profile
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #8 on: February 25, 2014, 02:42:55 am »
Quote
That would end up consuming over half the SPU ram, if not more, meaning there won't be much room left for other samples.
You don't need other samples at the same time, save a few blips and beeps needed for sound effects that barely take 1% of the SPU memory.

Quote
Plus streaming to the SPU is quite the mess and requires a ton changes to the engine because of the way LIBSPU is programmed. It's just not worth the endless trouble.
I don't really know, but many games still managed to do it, without the interleaved CDROM access trick that Grandia uses. Think of Suikoden, etc... Then went streaming to SPU instead of XA for some reason. Pehaps that had better bitrate control, or better looping, or better quality ?

The only "ton of changes" I see is de-interleaving left and right channels to put them to separate SPU regions.
« Last Edit: February 25, 2014, 05:57:57 am by Bregalad »

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #9 on: February 25, 2014, 08:21:30 am »
You don't need other samples at the same time, save a few blips and beeps needed for sound effects that barely take 1% of the SPU memory.
You can probably check the SPU cache in order to find how much of SPU ram is used by the game, but usually most games fill it up entirely.

Quote
I don't really know, but many games still managed to do it, without the interleaved CDROM access trick that Grandia uses. Think of Suikoden, etc... Then went streaming to SPU instead of XA for some reason. Pehaps that had better bitrate control, or better looping, or better quality ?
I don't recall Grandia using streaming (it's been a while since I even tried playing it), but I'm pretty sure Suikoden uses nothing like SPU streaming or interleaving tricks. It's just plain CD-DA audio and XA in both Suikoden I and II.

Quote
The only "ton of changes" I see is de-interleaving left and right channels to put them to separate SPU regions.
You need at least 5 callbacks (3 for SPU streaming, 2 for the cd), plus two more for IRQ and SPU transfer. Adding these to a custom engine is complicated enough, imagine injecting it in something where you have no idea what most of the engine does and you'll see why it's "ton of changes" and a mess in general.
« Last Edit: February 25, 2014, 08:33:52 am by Gemini »
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2626
    • View Profile
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #10 on: February 25, 2014, 04:04:05 pm »
Quote
You can probably check the SPU cache in order to find how much of SPU ram is used by the game, but usually most games fill it up entirely.
It's filled with musical instrument used to play back sequenced music. You don't need those if you use stremed music instead.

Quote
I don't recall Grandia using streaming (it's been a while since I even tried playing it), but I'm pretty sure Suikoden uses nothing like SPU streaming or interleaving tricks. It's just plain CD-DA audio and XA in both Suikoden I and II.
Grandia use streming interleved with CD reads. Suikoen I use SPU streaming, and Suikoden II regular sequenced music. Both use XA only during war sequences, and none of them uses CD-DA at all. Please very what you're talking about before typing random things (no offense, but that seems to be what you're doing).

However I fully agree that adding additional callbacks and IRQs to an existing games sounds like a total nightmare. Still doable technically, but that's pointless if the CD is already full, and it very likely is in DW7's case.

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #11 on: February 25, 2014, 06:50:20 pm »
Suikoen I use SPU streaming, and Suikoden II regular sequenced music. Both use XA only during war sequences, and none of them uses CD-DA at all. Please very what you're talking about before typing random things (no offense, but that seems to be what you're doing).
War sections in II are actually simple CD-DA tracks. As for Suikoden I, it doesn't use SPU streaming at all, 100% sure of it. Suikoden was developed with ancient PSY-Q libraries that still didn't have any of the SpuStXXXX stuff added at all (they only came later as test code with PSY-Q 3.2, which should be dated somewhere around August 1995, and perfected much later in 1998). From what I could gather, Suikoden was compiled with libraries 3.0. AFAIK, only one Konami game did back in the day, but it was because of specific needs. The game is Castlevania Chronicles. Most games wouldn't use SPU streaming because it's more complicated than simply firing XA playback, which also doesn't require SPU ram or voice channels.
« Last Edit: February 26, 2014, 07:26:15 am by Gemini »
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2626
    • View Profile
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #12 on: February 26, 2014, 09:10:37 am »
Quote
As for Suikoden I, it doesn't use SPU streaming at all, 100% sure of it.
I'm 100% sure the earth is flat, too.

« Last Edit: February 26, 2014, 09:27:05 am by Bregalad »

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #13 on: February 26, 2014, 03:06:27 pm »
Funny, because there's no SpuSt functions in the code and that was the only way the PlayStation developers used to make VAG streaming. I guess Konami used a custom implementation?
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Bregalad

  • Hero Member
  • *****
  • Posts: 2626
    • View Profile
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #14 on: February 27, 2014, 10:55:43 am »
Well I'm not familiar with this, but I'd see 3 reasons they'd prefer this over XA :

1) Better bitrate control : It's possible to find any quality/bitrate tradeoff. With XA only 2 bitrates are possible.
2) Better music looping. It can loop perfectly with SPU streaming, I'm not sure about XA, but I'm afraid it's hard to make it loop without a gap at the loop point
3) You get data correction : The music will be more resistant to read errors, due for example to scratched/dirty discs.
4) (not relevant in Suikoden's case) you can do effects by slowing down or quickening up the music pitch/tempo

As for CD-DA it takes so much space that the only reason to ever use it is if you absolutely want the user to be able to hear the music without a PlayStation.

Gemini

  • Hero Member
  • *****
  • Posts: 2009
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: How can i change Dragon Warrior VII (PSX) music?
« Reply #15 on: February 28, 2014, 07:18:23 am »
XA doesn't support loops indeed, at least according to Sony's docs. The only way to implement it is to manually define a loop range and encode the stream so that it jumps exactly where it can resume streaming without the user noticing. The only real advantages of using XA are that it's really simple to use (set read mode and CD mix filter, kick the ready callback, and you're done), the code uses only a bunch of bytes, you don't need to use 2 SPU voices set on dual mono, there's no need for SPU ram to store the samples for playback, and there are no conflicts with other parts of the SDK switching callbacks a lot (VAB upload is especially picky here, and if you have threading code there are chances it will lock up during async transfers); but even with that all, there are some huge cons like the error correction completely lacking and the worse playback rate.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.