• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
June 16, 2021, 03:06:21 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Sound effects inside of Spells Effects and Event Sound Effects

Started by CONMAN, February 12, 2021, 03:44:14 pm

CONMAN

This might be already be completely known by a few on this site already (looking at choto and xif) but I recently solved a problem that I was having trouble finding the answer to.

I hadn't been happy with many of the waveform/instruments used by the game and it seemed to limit my ability to convert music from other games.  A few sounds that I wanted to add included a guitar sound and a deep chorus sound (the instruments list certain sounds as voices but to my ear they are a lot closer to organ notes.)  I really struggled trying to convert other sounds into proper waveforms to replace the current game options.  I figured I could eventually find some in game sound effects and make the changes that I wanted.  I kept hoping I would follow some sort of pointer in the effect file images that would lead me to a cluster of sounds effects elsewhere in game.

What I had found is that ff7 has a lot of similarities with the design of fft for obvious reasons and I spent a fair amount of time looking into their music/sound effects set up.  The file structure for ff7 sound effects are simply just special changes in the use of notes from their waveform/instrument file. 

Sure enough, rather than ever finding pointers to hidden sound effect files I simply found the exact same music format inside of each spell effect file.  This feels obvious now, but I literally thought that the effect file pointers would simply lead to another pointer where those elusive sound effect files were hiding. :roll: 

I'm sure this is why the various event sound effects were never easy to find. They are likely in the exact same "song" format.

I feel dumb now :shock:
  • Modding version: PSX

Elric

I did not know this! Great info CONMAN, thank you!
  • Modding version: PSX
<@Angel> Teach a man to fish and he'll open up a fishery to compete against yours.


Journey of the Five Youtube ChannelThe Lion War Current Status
  
Jot5 Leader :: Eventer :: OtherTLW Leader :: Eventer :: Other

nitwit

For future reference, are you referring to AKAO sequences?


The last link is especially interesting because it has filenames and addresses of routines used in FF7 to process sounds, as well as a basic interface of what those routines do were they C/C++ code. One could post those routines from FF7 here and see if that information can be used to locate the same routines in FFT, thereby gaining information about sound processing FFT with the minimum of effort.
  • Modding version: PSX

CONMAN

February 13, 2021, 11:50:24 am #3 Last Edit: February 13, 2021, 01:57:32 pm by CONMAN Reason: further research
Those are some interesting links Nitwit and honestly above my head.  The AKAO sequences seem to have some similarity with the .smd sequencing in that they are both similar to midi formatting (from what I've read at least.)  A peek at our wiki and the music/instrument shows some similar thinking in their design.

Two things popped out at me looking at these instrument players. One was locking back at this link. https://web.archive.org/web/20190320140257/http://sdamo.io/ff7/index.php.  While I haven't used that program to pull out effects from the ff7 effect.all the notes say that it pulls waveforms from the ff7 instr.all.  (Instr.all is already well mapped and much easier to pull waveforms from rather than the fft waveset.wd)  Makes me want to take a closer look at 2 files in the  fft sound folder: ENV.SED and SYSTEM.SED.

The other thing that popped out at me poking around with a hex editor was that the spell effect files point to an address that starts with:66 65 64 73, the text-string on the right reads "feds." Whatever the fuck that means, but both the ENV.SED SYSTEM.SED start with 66 65 64 73 (feds) in their headers.  Initially I thought that the sound effect data in the spell effects were too short and there must be a pointer somewhere else.  On closer inspection of the hex I realized that it seemed to follow the same structure as fft song files.  Starting with variable BA (start of channel) I copy/wrote over the channel start of an instrument test song and plugged it in. I tried it out in the music test and played the cure sound for me.  Just longer (on repeat.)

Anyway, that's why I'm guessing that song/.smd chunks for all the other sound effects are formatted the same somewhere.



-update edit.
Started poking around the system.sed.  I start adjusting the viewable number of bytes per row and took it down to 2 revealing a pattern!
(sorry I forgot how to hide stuff in a spoiler box)
66 65 
64 73  -(feds)
2A 21
00 00
A8 00
00 00
B4 02
00 00
00 00
00 00
00 00
00 00
5C 03  -start of sound effects?
60 03  -actual start with AC (play note):AC 43 94 04 B0 60 24 60 4A 60 A9 D9 03 17 02 C4 2E 60 C6 90
74 03    -AC 00 94 05 C4 23 60 CA 90
7D 03    -AC 04 94 06 98 04 60 83 99 90 E0 00
87 03    -AC 81 94 06 B0 D4 1E B9 60 0F 60 4B 90 B2
96 03    -AC 17 94 07 D4 08 FD C4 28 60 21 90 91
A3 03    -AC 00 94 06 C4 26 60 35 90 91 B2
A3 03    -etc.

these quick little pointers displayed similar chunks like song data and again testing with music box got several sounds.  Unfortunately didn't line up with the event sound id list. The first (starting with ac) is actually the confirm/cancel sound and the 5/6 or so is the #5 invalid sound.  Pretty interesting.

edit2- I take that back they do actually line up pretty good.  Some of these sounds inly play once but the events sounds play multiple times like the rolling numbers/gil sound.

  • Modding version: PSX

nitwit

That wayback machine link referencing sdamo.io is from St├ęphane Damo. Didn't sdamo do something with FF7 or FF8 a few years ago? Something like a sound or music editor?

https://github.com/stephanedamo

It's very familiar, I know I've seen that handle somewhere.

edit

There we go!

http://forums.qhimm.com/index.php?topic=18201.0

There's an email in there (stephane.damo@gmail.com) at which you can contact sdamo/Phanoo to get any information that isn't covered by wayback machine.
  • Modding version: PSX

CONMAN

I might try to send an email over at some point.  We have a lot of missing/unknown commands that I see pop up quite a bit in the music/effect files.

I'd like to correct in my previous comment that "AC" isn't "play note" it's select "instrument."  The system.sed file has a table for ~300 sounds and when I tried to jump up and test file 66 (hex) the sound I heard was clearly one of the "sparkle" sounds (32-37.) (Yes, I converted to decimal and counted down... roughly correctly.)  There is more going on there or rather it's not as simple as I would like.

Just for the heck of it, today I checked env.sed and easily found another offset table linked to some sound chunks.  My gut feeling listening to the first 4 sounds is that this file contains sounds for the weather/background sound effects.  The first 3 might be water/rain/river- a little rough on the ears. But the fourth sound seems like it's the thunderstorm background sound. Give it a listen.

  • Modding version: PSX

nitwit

Quote from: CONMAN on February 15, 2021, 08:03:57 pmI might try to send an email over at some point.  We have a lot of missing/unknown commands that I see pop up quite a bit in the music/effect files.

I'd like to correct in my previous comment that "AC" isn't "play note" it's select "instrument."  The system.sed file has a table for ~300 sounds and when I tried to jump up and test file 66 (hex) the sound I heard was clearly one of the "sparkle" sounds (32-37.) (Yes, I converted to decimal and counted down... roughly correctly.)  There is more going on there or rather it's not as simple as I would like.

Just for the heck of it, today I checked env.sed and easily found another offset table linked to some sound chunks.  My gut feeling listening to the first 4 sounds is that this file contains sounds for the weather/background sound effects.  The first 3 might be water/rain/river- a little rough on the ears. But the fourth sound seems like it's the thunderstorm background sound. Give it a listen.

Sounds distorted somehow, but it does resemble the rain and thunderstorm sound effects. Reminds me of an antique rototiller I saw at a tractor show.

Are there parameters you can play with? What is your workflow for testing this - savestates? Memory viewer? The more easily you can fiddle with things, the faster it will go.
  • Modding version: PSX

CONMAN

At the moment I've just been paste/writing behind the header of a single short song and making duplicates for each entry.  I keep a copy of tactics with the music test patch applied so that I can screw it up all I want.  I jam it up with cd-mage.  It would probably help out if I ran a memory viewer at the same time.  I haven't been testing out different parameters but using short sound effects might be a lot easier to help decipher than the full on songs. Actually, as I type this, it occurs to me that I might be skewing some of the sounds that I have been listening to because some would appear to require multiple "channels" to sound correct.  I had been using the head from the "instrument test and I'm pretty sure it is set to play just one channel at a time.
  • Modding version: PSX

nitwit

I got logged out while editing the post above, but I copied it before I attempted to post. Here's what I was going to add.

I did a search for "akao romhacking" and hit the jackpot. Only issue is it seems to be music, not sound effects. Finding out what "smds/dwds" means may help.
https://github.com/vgmtrans/vgmtrans
QuoteSquaresoft's PS1 format used in certain PS1 games like Final Fantasy Tactics (smds/dwds)

These also seem relevant, but may be dated.
https://github.com/loveemu/seq2mid

This thread has some info, and Bregalad of RHDN is another person you could bounce ideas off of as you work on this.
https://www.romhacking.net/forum/index.php?topic=23229.0

Quote from: CONMAN on February 15, 2021, 10:03:56 pmAt the moment I've just been paste/writing behind the header of a single short song and making duplicates for each entry.  I keep a copy of tactics with the music test patch applied so that I can screw it up all I want.  I jam it up with cd-mage.  It would probably help out if I ran a memory viewer at the same time.  I haven't been testing out different parameters but using short sound effects might be a lot easier to help decipher than the full on songs. Actually, as I type this, it occurs to me that I might be skewing some of the sounds that I have been listening to because some would appear to require multiple "channels" to sound correct.  I had been using the head from the "instrument test and I'm pretty sure it is set to play just one channel at a time.
Do you know what files you need to edit, where they loaded into RAM, and if they are loaded whole or in part? I don't, but if I know what you're missing then I know what to start looking for.

Editing with the pSXfin (or duckstation) ram viewer would be a lot faster, and allow you your work to progress with fewer steps and more time spent hacking.
  • Modding version: PSX

CONMAN

I can't say that I have done too much more research into this subject.  The sound effects seem to largely follow the same rules as the music files.  I don't seem to ever see the variable that signal looping (for obvious reasons- this is a one shot), but I regularly see one variable that is not listed in the music/smd wiki page.  That would be: B2.  I regularly see this right between 90 and BA.  These are end channel and begin channel.  Sort of assume it's a signal to change channels.

After the "feds" header and the file size indication there is a number of pointer that either indicate the start of a channel or instrument selection.  Each of these indicators seem to have a timing function linked to the actual spell effect and simply changing these sound effect chunks of data out won't seem to work well unless the number of pointers line up (along with sounds that actually match what's happening.)  A while back I fused a holy and dark holy spell effects together. I used holy as the base, recolored it to red and purple and swapped the dark holy sound effect into the file.  The holy spell actually runs longer and this caused the sound effect get a nice stretched out and deeper sound.

Anyway, as proof of concept, here is a video where I replace the initial horse sounds from the Odin effect with the laugh portion of dark whisper.  Stupid horse sound pops back up at the end of the spell, but i'm satisfied in saying that the sounds aren't super hard to change.

  • Modding version: PSX