Final Fantasy Hacktics

Modding => Hacking/Patching Tools => Topic started by: Mental_Gear on July 15, 2009, 06:19:04 am

Title: Any way to put any music (from outside the game) in-game?
Post by: Mental_Gear on July 15, 2009, 06:19:04 am
http://www.youtube.com/watch?v=Z7mOCsh6R_E (http://www.youtube.com/watch?v=Z7mOCsh6R_E)

However...that use of Those Who Fight Further could just be down to editing really...
Title:
Post by: Kaijyuu on July 15, 2009, 06:56:47 am
Short answer: No.

Long answer: Maybe in a couple years when someone decodes how it all works.
Title:
Post by: Mental_Gear on July 15, 2009, 08:15:26 am
Ah, thanks for that. I can live with that.

However, is there any way to, say, use custom sound effects for ability animations though?
Title:
Post by: Vanya on July 15, 2009, 05:31:37 pm
That's sorta already been decoded. Look into the PSF music format.
http://www.neillcorlett.com/psf/
Your problem would be modifying 'outside' songs to work with FFT's samples & encoding.
Both FFT & FF7 have been made into PSF format so the data for how they work is already available.
It will require some extensive ASM knowledge.
Title:
Post by: Mental_Gear on July 15, 2009, 06:41:05 pm
Ah, okay, I'll look. Thing is I wanted to replace the harp sound effect with the FF Prelude arpeggios played on electric guitar XD
Title:
Post by: Mental_Gear on July 16, 2009, 06:00:57 am
Ah, I had a look and PSF lab seems intriguing. I'll download it and see what it's capable of. It seems as though a GUI equivalent of ASM (regarding BGM and SFX only, of course) could be on the horizon if the program is further developed.
Title:
Post by: Sephirot24 on September 02, 2009, 01:30:34 am
Quote from: "Vanya"That's sorta already been decoded. Look into the PSF music format.
http://www.neillcorlett.com/psf/
Your problem would be modifying 'outside' songs to work with FFT's samples & encoding.
Both FFT & FF7 have been made into PSF format so the data for how they work is already available.
It will require some extensive ASM knowledge.

Does this mean that:

a) There must be some way to convert some type of music format into PSF and use the PSF to insert it into FFT??

OR

b) There is a way to create music in PSF format and then insert it into FFT???

I'm interested in either of those. I want to import music into FFT. Converting some format and then inserting into FFT or having some program to make music directly in that format would both be great. Does anyone know if / how this works?
Title:
Post by: Kaijyuu on September 02, 2009, 03:01:34 am
My guess is that PSX games work similarly to SNES ones; you can't directly port any song from one game to another without heavy modifications to the music routines.

Even if you could take a song from one game and stick it in FFT, it wouldn't sound right because the instruments FFT uses are different from any other game. You'd get some glitchy tune that sounds vaguely like the original.


However, it's probably possible to re-write the song so it sounds similar in FFT. That would take a lot of effort, though. Plus if you wanted authenticity, you'd have to modify FFT's samples... and that means screwing with all the original songs/sound effects.
Title:
Post by: Sephirot24 on September 02, 2009, 07:04:33 pm
Yeah. I thought that the most probable one was making a song using FFTs instruments, or converting some sequenced format like MIDI.

I can make MIDIs. Or I'd probably be able to make the song directly in FFTs format if there was a program...
Too bad I know shit about programming, and the fact that it's in english (not my native language) makes it a little harder :(
Title:
Post by: Zozma on September 02, 2009, 07:18:53 pm
hah, id love to hear a version of Asellus' endboss music from saga frontier redone with the fft instruments and slowed to match a fft battle pace lol..
Title:
Post by: LastingDawn on September 02, 2009, 07:23:52 pm
Eh? You think such methods might actually work... well if FFVII and FFT uses the same sound programs there might be some notes scattered about...
Title:
Post by: Vanya on September 02, 2009, 09:04:17 pm
They don't as far as I know.
Title:
Post by: gomtuu on September 30, 2009, 09:25:52 am
Have you guys seen this?

http://pjbarnes.com/music_55.html (http://pjbarnes.com/music_55.html)

Looks like somebody figured out quite a bit about the music file (SMD) format.
Title:
Post by: Cheetah on September 30, 2009, 10:55:56 am
Wow gomtuu good find. If nothing else this tells us a lot about the potential structure of the files. Great to see you here again, it has been a really long time.
Title:
Post by: LastingDawn on September 30, 2009, 01:10:57 pm
Yes I've seen it... and from what I can tell a lot of that info. seems almost flat out wrong, at least the first parts, nothing in that first part controls "tempo" as he puts it, but in any case... welcome back Gomtuu! I haven't seen you around in Ages!
Title:
Post by: gomtuu on October 01, 2009, 10:11:15 pm
Glad to know you guys are still here too! Yeah, obviously I haven't been active here for several months. I did take another look at Ganesha a couple of weeks ago, though. I may work on it some more in the near future. I've just felt so busy for such a long time!

I saw your map mockup, Cheetah. Very cool! I'm sorry you can't (yet) make it a reality.

Quote from: "LastingDawn"from what I can tell a lot of that info. seems almost flat out wrong, at least the first parts
:( Too bad.
Title:
Post by: Cheetah on October 01, 2009, 10:29:35 pm
Thanks Gomtuu, I look forward to any progress. Obviously I have been patiently waiting for whatever you come up with haha.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: gomtuu on January 30, 2010, 11:37:40 pm
I took another look at the music files. As it turns out, P.J. Barnes (http://pjbarnes.com/music_55.html) was right about the file structure and a few of the commands. This week, I also figured out how notes work and decoded a lot of the instructions, like Set Instrument, Set Octave, Loop, etc. I'll add my findings to the wiki soon.

I've attached a PPF that changes "Character Making" (MUSIC_34.SMD) into "Happy Birthday". Just patch a fresh FFT ISO and start a new game to hear it. :)
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: jimmyjw88 on January 31, 2010, 12:33:35 am
Wow!! Really? So it works??? So does that means we can put songs that we desire into the game?
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: gomtuu on January 31, 2010, 12:54:17 am
Quote from: "jimmyjw88"So does that means we can put songs that we desire into the game?
Yes, although it will require hex editing until someone writes a tool to convert other music files (probably MIDI, or maybe ABC notation) to SMD automatically. Also, we're still stuck with the default set of instruments until we can decode WAVESET.WD.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Xifanie on January 31, 2010, 01:06:16 am
Are you sure this is for a FFT ISO and not a sound file? I tried patching my ISO and it gave me a "not the same size" warning, and after patching the ISO wouldn't run anymore.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: gomtuu on January 31, 2010, 01:54:46 am
Quote from: "Zodiac"Are you sure this is for a FFT ISO and not a sound file? I tried patching my ISO and it gave me a "not the same size" warning, and after patching the ISO wouldn't run anymore.
It is for the ISO. Mine is 541,315,152 bytes long (2352 bytes/sector). I just applied my patch and FFT1.3 to the same ISO and they both worked... Hmmm...

I don't know if this matters, but I made the PPF with "MakePPF 2.0 W32 Version Icarus/Paradox" and I applied it with PPF-o-Matic 3.0.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: jimmyjw88 on January 31, 2010, 02:15:02 am
So meaning we need that to work?
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: gomtuu on January 31, 2010, 09:26:59 am
Quote from: "jimmyjw88"So meaning we need that to work?
If you mean FFT 1.3, then no, you don't need that for it to work. I was just saying that my patch and 1.3 both worked on my ISO, which leads me to believe that my ISO isn't unusual.

If you mean PPF-o-Matic, then yes, it's possible that PPF-o-Matic would work and other patchers wouldn't for some reason. That's just a guess, though, and for all I know, Zodiac is also using PPF-o-Matic. Does anybody have any ideas?
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: jimmyjw88 on January 31, 2010, 11:21:52 am
Well, I tested on Original ISO and it worked. Now, I'll try 1.3

EDIT: Well, both 1.3 and original ISO worked. Yay ^^
Very very nice gomtuu. But need hex editing?
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Xifanie on January 31, 2010, 11:39:48 am
Don't mind my previous post; I just didn't try hard enough. I made it work. Now I want info to compose my own songs!!
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Vanya on January 31, 2010, 02:16:59 pm
Have you looked into the PSF ripping tools? Maybe they could give you some insight to the FFT music format.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: gomtuu on January 31, 2010, 04:30:04 pm
As promised, here's what I've been able to figure out about the SMD format so far:

http://www.ffhacktics.com/wiki/Music/SMD (http://www.ffhacktics.com/wiki/Music/SMD)
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Cheetah on January 31, 2010, 06:18:44 pm
Hot damn that is impressive! I don't even know what have of that stuff means.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Vanya on January 31, 2010, 07:15:34 pm
Very interesting. It isn't very dissimilar from the way most SNES or even NES sound formats are structured.
Thanks a lot for finding this info, Gomtuu. ^_^
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Sephirot24 on February 12, 2010, 01:12:38 pm
Woah! That's really really impressive Gomtuu!!

It'd be awesome if you (or anyone up to it) could make a video tutorial on it. At least the basics...
I'd love to compose for you guys, but I don't understand anything about hex :(
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: SilvasRuin on February 12, 2010, 01:50:51 pm
Now I can't help but want Battle on the Bridge or whatever the FFT song is called to be replaced by the classic Clash on the Big Bridge, Gilgamesh's recurring theme...
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Kokojo on May 11, 2011, 10:54:12 pm
I request that Gomtuu's posts shall become stickies.

THis is HOW TO EDIT MUSIC guys.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: GeneralStrife on May 11, 2011, 11:09:01 pm
we can edit da muzik?
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Kokojo on May 12, 2011, 05:45:03 pm
Read it, and yes.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: formerdeathcorps on June 18, 2011, 01:21:13 am
This thread:

1) Needs to be made a sticky.
2) http://ffhacktics.com/wiki/Music/SMD needs to be consolidated with http://ffhacktics.com/wiki/Music for easy searching.
3) There needs to be a program that converts MIDI files (or the .txt equivalent) into the format used by FFT for easy patching.  It would need to read a FFT song and tell you how many sectors it uses.  It would be very nice if such a program also had playback features so you could test your composition beforehand.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Dome on June 18, 2011, 04:40:58 am
The first post should be edited to include the "Tutorial"
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: formerdeathcorps on July 31, 2011, 10:29:27 pm
I think I found some more.

There's a section from 0x290d8 - 2a8d4 (length 0x1800) that's just pure nonsense in terms of opcodes, but seems to obey a mathematical law in terms of the pattern of number displayed.
If you put a read on this section, you end up finding that reads 2 bytes from the above "table" into r4, but never seems to use r4 at all (at least where I could trace).  r16 holds a value that constantly shifts between 4-6 sources.  The overall code is at 0x14D70 in RAM (or 0x5570 in SCUS).  More suspiciously, however, each complete cycle of r16 values produces one note of the song currently being played (recall...debug/breakpoint mode usually causes silence or a frozen note sound).  Thus, I suspect:

0x14D70 is part of the ASM code that reads music
0x290D8 is a table that functions as the custom sounds for FFT.
The fluctuating r16 values (RAM addresses) are those of the various musical channels, and each channel is 0x2C0 long.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: pokeytax on March 10, 2013, 11:39:09 pm
Bump!

I've been tinkering with this.  In fact, I have a working MIDI converter.  The output is recognizable, but awful, due to a combination of the percussion channel being read as pitched, my current inability to play notes that are longer than a couple measures, instruments being arbitrarily remapped because I don't know the instrument codes for FFT, and probably some other issues like dropped notes and bad header data being masked by the above.  They're also fairly large, which I can do a bit to remedy, but not too much.  I'll keep at it.

If anyone has any notes on the coding end of this beyond what's on the wiki, that would be music to my ears.  gomtuu's stuff (I think? anyone who pitched in has my thanks too) was instrumental in getting this thing humming along.
Title: Re: Any way to put any music (from outside the game) in-game?
Post by: Gokzarak on November 30, 2014, 08:36:44 pm
There is music repeated in different fights or events in the game, there will be a way for each map to choose the music and another is not repeated.