Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: G on 2007-03-27 06:29:06

Title: AKAO
Post by: G on 2007-03-27 06:29:06
some information related to Akao's music:

Of course all of you know, that there is AKAO in field files...
Also every file with extension *.SND on ffvii cd's is Akao's.
I examined 3 files on ff7cd's

Akao header:
Code: [Select]
|                   |   0x47  |         |   0x03  |                   |0x46|0x05| - ASERI2.SND
|       AKAO        |   0x3b  |         |   0x04  |     0x22181296    |0x45|0x55| -  OVER2.SND
|                   |   0x59  |         |   0x04  |                   |0x46|0x28| - SENSUI.SND
| 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 |
|                   |  seems  |         |         |                   |    |    |
|  magic string :)  |  frame  | frame   |  type?  |      *magic2*?    | ?? | ?? |
|                   |    id   | length  |         |                   |    |    |

after header there is <frame_length> bytes of music data.

All sound samples is in SOUND directory on cd's. For all 3 cd's contents all the same.
INSTR.ALL  - 92 main samples from game
INSTR2.ALL - 6 voice samples from One Winged Angel

INSTR*.ALL format is known to me (32-byte header with offset of first sample, maybe. after this there are 16-byte ADPCM encoded frames 22100Hz, mono, between sample frame groups there are 16 bytes of zero's (but there are exceptions))

EFFECT.ALL - for now totally unknown

INSTR*.DAT - some data for INSTR*.ALL (maybe there are relations between EFFECT.ALL and samples from INSTR*.ALL)
INSTR*.DAT contains <INSTR*.ALL sample count> 64-byte frames with some offsets for every sample and 60 bytes of other data, mostly 16-bit numbers.

I wrote utility to decode samples from INSTR*.ALL and now trying to understand AKAO's music format.

if someone know any info about ffvii sound related - post it here.
Title: Re: AKAO
Post by: halkun on 2007-03-27 09:57:19
The PC version used normal .wav (PCM) sound samples that were sequenced by number. Because the scripts were not changed between the PSX and the PC version, one of the AKAO opcode arguments could be a call to a particular sound effect.

I only have Psy-Q notes, and that format doesn't match anything I've got. What I have on the midi-like SEQ data and related audio is sketchy. Are you saying that the "midi" sequence data is actually in the Akao block?

Psy-Q had a bunch of converters that you used to make the data for the PSX. For example there was one that turned WAV files to VAG files. There was another that trasformed MIDI data into SEQ files. I'm guessing that the MIDI files in the PC version are the uncompiled SEQ files. Same goes for the audio samples (VAG) and soundfonts (VAB)

Here's what I have on how Psy-Q did sound.

You have a VAG file, which is a single ADPCM sample. It's format was like this

4 bytes - "VAGp"  (I don't know why the lowercase "p", but the other sound formats have those too.)
8 bytes - ????? (version?)
4 bytes - data size
4 bytes - frequency
12 bytes - ???? (scratchpad?)
16 bytes - Original file name.... sometimes
after this was the actual ADPCM sample

You could group a bunch of VAGs into a VAB file. This is kind of like a soundfont on a PC

4 bytes - "VABp" (again with the "p")
8 bytes - ???? (version I think, same as VAG)
4 bytes - VAB file number
4 bytes - wave size
2 bytes - ????
2 bytes - number of overall sound setting presets (?)(found later, I will call this "preset A")
2 bytes - number of individual sound setting presets (?)(also found later, I call this "preset B")
2 bytes - number of VAGs in the file
1 byte - volume
1 byte - balance
6 bytes - ??? (Sometimes had text)
(16*preset A) bytes - overall sound table
(32*preset B) bytes - individual sound table
512 bytes - VAG offsets
varies - VAG files all sequenced togeather.

Building on the soundfont, you had a Sequence file, which is like a midi...

4 bytes - "SEQp"
4 bytes - version(?) (shorter than above)
2 bytes - resolution
3 bytes - tempo
2 bytes - rhythm
varies- Actual sequence data.
3 bytes - footer

Then, you can take the SEQ files and put them togeather into one big file called a SEP

4 bytes - "SEPp"
2 bytes - version(?)
2 bytes - SEQ number
varied - (stripped SEQ, missing the first 8 bytes)
2 byes - next SEQ number
varied - (stripped SEQ, missing the first 8 bytes)
2 byes - next SEQ number
varied - (stripped SEQ, missing the first 8 bytes)
....and on.

That's what I have... (Watch, I probably helped on accident like I did with the movies ^_^)
Title: Re: AKAO
Post by: G on 2007-03-27 11:54:59
Are you saying that the "midi" sequence data is actually in the Akao block?
it's look like it is...
at least I didn't found another "sequence" files...
Title: Re: AKAO
Post by: Synergy Blades on 2007-03-27 12:26:52
As far as fields go (at least on PC), you can switch between background musics merely by changing the two-byte value after the string "AKAO". If you want to switch between musics played on a field, there must be an Akao block for each, and you can then choose between them with MUSIC (http://wiki.qhimm.com/FF7/Field/Script/Opcodes/F0_MUSIC) with the relevant zero-based index.
Title: Re: AKAO
Post by: korDen on 2007-04-16 19:24:27
Hi! I'm new to Gears, so don't hurt me much ^_^
I have those music files in midi (and you might as well). This could mean that there IS direct convertion to midi sequence available. But those midis sound abit different for original. This could be hardware issue as any midi sounds a little different on any other PC. And this could be just a fan-made convertion which is very close to reference. So
1) comparison of both source and midi files might give some information
2) are those midi files free? Maybe we could just use them and thats all? :)
Title: Re: AKAO
Post by: halkun on 2007-04-16 23:22:03
The midi files that were in the PC were actually earlier versions of the compiled music in the PSX version.

In a world of puppy dogs and rainbows, it would be nice to have the seq format understood.

For those in the know. The MIDI format is already in the WIKI.


That's the best I can do.