Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: halkun on 2005-03-12 21:24:43

Title: SEQ and VAG files
Post by: halkun on 2005-03-12 21:24:43
Has anyone played with these files? a Seq is a PSX sequence file, like a midi, but optimized for the SPU. It also contains VAG data (Raw SPU digital data) for the intrumints. Enyone ever take a look at these formats?

I'm not going to be tearing into VAGs or SEQ files right now. If someone wants to rip apart one of Pete's open source PSXEmu SPU plugins, I'm sure what the SPU is expects as a sound sample format and what a VAG file is composed of should fit togeather like a puzzle.

Much like TIM files are just raw images of the PSX VRAM....

=== EDIT ===

I found the source code to a VAG packer. They are modified AIFF mono wave files. (The spu does envoloping/ASDR/channel selection, so it being mono makes sense.) Now for giggles it would be nice to know what makes up a SEQ file. I wonder if it's code, like the SNES's SPU. It might be, as one is just a big brother of the other.
Title: SEQ and VAG files
Post by: snailrush on 2005-03-13 02:19:08
SEQ files are only made of MIDI commands. Basically, a SEQ file is a slightly edited Standard MIDI File (header is different).
Title: SEQ and VAG files
Post by: halkun on 2005-03-13 02:33:17
Hmm, turns out SEQ files use VAB files as the samples, not VAG. I'm guessing it's still the same thing with a different header. (VAB=mutiple samples, VAG = 1 sample?)

One day I'll have to take a peek at an seq file. I know my way around MIDI events, and I'll be able to reconize any if I see them. I'm guessing the VAG is appended or prepended to the file.

Then again, another thing I could do is a memory dump of a PSX, find the seq loaded into memory, and mess with the data directly.
Title: SEQ and VAG files
Post by: DragonZap on 2005-03-13 04:20:50
Do you want to try my disk editing emulator plug-in? It sits between a PSX emulator and a another CD plug-in and lets you edit the files on disk before they're loaded into memory. That way you won't have to search for them.
Title: SEQ and VAG files
Post by: halkun on 2005-03-13 07:35:37
Thanks for the offer, but I run linux and I don't think it will work. (as linux PSX emulators don't have CD-ROM plugins)

I can always make a raw image of a cd-rom, (by copying from /dev/cdrom to a file),  mount it on a loop back device, and edit the disk like it was a 640 meg hard drive. Then all I have to do is unmount the disk and either a) point the emulator to my file as opposed to /dev/cdrom or b) burn it to a disk.

Linux treats everything as a file, including devices. I can actually copy an audio file to /dev/dsp and it will play out my speaker.

I can list /dev/sequencer and "record" midi event data to a file. Then all I have to do is put a header on it and I have a "ripped" midi file.

I can copy video from a webcam to my framebuffer and get a picture on my screen. All with the same file command I would use to list a text file.
Title: SEQ and VAG files
Post by: DragonZap on 2005-03-13 08:13:07
Yeah, I know how Linux works; I run it myself on one of my other machines. Though I don't think the iso9660 filesystem can be mounted as writable, can it? I thought the only way to create one was mkisofs or some similar program (you can mount it rw, but it still won't let you write anything). And many Playstation games use data from outside the ISO9660 filesystem anyway.

But you're right; this plug-in is Windows-only for the time being.
Title: SEQ and VAG files
Post by: Cyberman on 2005-03-21 01:24:44
Which reminds me, I forgot where this plugin was offered LOL!
I could use it now because I'm digging in FF9 for some data. (laugh).
Is it possible post a link for it or is 'wide' distribution a problem?

Cyb
Title: SEQ and VAG files
Post by: DragonZap on 2005-03-21 02:11:08
It's not finished, but it's usable. FF9 might be more difficult to work with since it uses one big image file, so you'll have to use raw CD sectors to mess with the data. (I wrote it with plug-in support in mind for games that don't use the ISO filesystem, but that's part of what doesn't work yet)

Anyway, it's not too hard to use -- pick a destination on the CD to replace, pick a source file on your HD to be the replacement, and go. It's probably best if you extract a copy of the data you want to modify beforehand.

At this point I'm looking for feedback on it. I've put it here (http://www.dim-bulb.net/~dragonzap/cdrDataHack.zip) for now.
Title: SEQ and VAG files
Post by: sfx1999 on 2005-03-21 14:27:29
Hey Halkun, did you try looking at the PSF ripping documentation?

http://www.zophar.net/tech/files/psfrip.txt
Title: SEQ and VAG files
Post by: halkun on 2005-03-21 17:41:01
actually, I found a guy who wrote seq2mid and I'm using his data. It should be pretty easy to pick apart. Also, vabs can have up to 128 sounds, (General midi base), and there is a such thing as mutiple seq files too.
Title: SEQ and VAG files
Post by: Skillster/RedSarg99 on 2005-04-19 13:47:43
Hi,
If I remember VAG are like you said converted AIFF files, used for sound effects on earlier PSX games
I managed to get out battle cries and special fx from streetfighter EX, which has VAGs lying around