Generic PSF Utility by MarkGrass at 3:48 PM EDT on July 3, 2013
[img]http://i.imgur.com/wT6FlbH.png[/img]
This is a utility I developed for use with my built-in 'generic psf driver', allowing one to easily create psf music data.
I know snakemeat's utility supports my driver, but this utility allows on to adjust the specific playback params before the PSF is created allowing one to completely bypass use of 'PSF-o-Cycle'.
Please view the 'readme' for additional information.
Can it use the original psf driver when creating new psf files?
As of now i have to: [quote]First play your source minipsf song in winamp. Then double click the scrolling text. Click the raw button. Then copy all text to a txt file. Rename the minipsf song to qweasdzxc.psf Drag it to psf2exe, edit the exe file in hex workshop. Search for pqes, select the string and replace it with a new SEP file, converted by SEQ2SEP. Then save the exe file and use exe2psf, then play the new psf file in winamp. Now copy/paste the raw text tags and click OK then Update. Now rename the psf file to your target name with minipsf file extension.
Workaround: Never add or remove space before or after the pqes chunk. You can never replace the pqes song with a seq file. You must convert the seq file to sep. (videogame name) driver can only play sep files. Mostly in minipsf songs.
You can't currently use it with other/custom drivers, but I will change that. It's a simple task, really.
The 'SEQ2SEP' commandline app is no longer necessary; this application supports 'sep2seq' extraction, either by GUI or simply 'drag-and-dropping' the SEP file(s) onto the app while its running.
In addition, the driver that is built into this app supports SEP playback with absolutely no need for 'conversion' to SEQ. Just simply adjust the parameters.
Also, the commandline apps 'psf2exe' and 'exe2psf' will be obsolete, as I have plans to add support for that. Again, another simple task.
It seems that you're making things difficult for yourself, when there's absolutely no need for all that. This app/driver supports everything you mentioned... but I'll add custom driver support.
Realistically, I want this tool to be used, so I'll gladly add anything I can.
I added support for using custom drivers. Please note that the application assumes that the 'd_addr' variable (Starting address of initialized data section) is 0x80010000. You must set the Seq_addr, Vh_addr and Vb_addr yourself.
I've only tested custom driver support with a few sets, so please report any bugs.
Additionally, I fixed a small bug where 'Drag-And-Drop' functionality only recognized files with upper-case extensions; it will now accept files with either lower or upper-case extensions.
Also, I added 'Drag-And-Drop' for EXE and PSF files; EXEs get converted to PSF, and PSF to EXE. This functionality is located in the GUI menu, as well.
And last, but not least, I cleaned-up the GUI menu.
I had a strange issue when making several psfs consecutively... a file that was supposed to be around 60kbs ballooned to 150 or something around there. Anyone else have this problem?
If the user specifies that the track will not loop, a special function is activated which determines when the track has completed and proceeds to auto-stop playback; the function's activation requires more CPU power, thus causing the seek ability to be bugged/slow.
There are several ways to fix this old issue... I'll get around to it.
I found a simple solution to fix the problem of sample extraction from VAB.
Instead of using waveform output (*.wav), I am now using proprietary Sony output (*.vag). Each sample from a VAB archive file can now be output to VAG with proper frequency settings.
The VAG streams work very well with vgmstream, and can be used to produce proper waveform audio.
I am still using a reverse-engineered function from the SDK for this process - SsPitchFromNote().
I should have a new version of this utility sometime soon-ish.
I successfully added stream support to my Generic PSF Driver... rather, I actually finished it. I started to add it sometime a couple years ago, just never got around to completing it.
That is very nice, will you be able to upload that new version with the channel muting feature, would be awesome! :D Thanks a ton man, appreciate people who can code programs :)
yes I know, but maybe muting samples like SPCTool can with spc (snes) music, that would be more better, because AO psf muting works, however the channels seem to mix. In one channel, you can find parts of strings mixed with parts of a piano sound, etc and that is not good. The recent 2sf (DS) has been expanded to allow specific instrument/sample muting, so that helps for muting only strings, piano, etc. So, I was thinking if 2sf format can do that, probably other xSF formats can also, psf, gsf, etc. But I would love to see that for psf first.
I have successfully implemented the channel muting feature, using the SsChannelMute() function. :)
Any MIDI channel from 0-15 can be muted. As previously mentioned, the user (you) can easily select the channels they wish to mute via GenPSF or PSF-o-Cycle.
OK, thanks for latest release, but can you show a quick text tutorial on how to mute channels from a psf file? Let's say I have a file called music.psf, how would I mute the channels from it? Open in your program and then what?
Channel muting and other parameters that are specific to this application/PSF sound driver cannot be carried over to any PSF that was not created with my generic sound driver.
In-order to achieve channel muting, you must create a PSF with this application.
I get error: "Error processing <C:\...\115 Viper Manor.psf>. Error received: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: startIndex"
As Mark said, it only works on PSFs created with his tools. In other words, you meed to create a PSF. These tools don't work on PSFs that already exist.
To clarify - you need to use VGMToolBox on the original game, not on a PSF. Essentially, you need to re-rip the game (from the PSX executable file), and create a new PSF set.
In theory, you might be able to take a PSF, and convert it back into a PSX executable file (which could then be played on actual PSX hardware). I'm fairly certain there's tools to do that. Then you might be able to extract the SEQ, VB, and VH data from the converted file.
However, what it comes down to is, as Mark already said, it won't work on PSF files. That's why you're getting an error. At least, that's the way his post reads to me.
[EDIT]Kirishima: It's from Chrono Cross. It's got to be. One of my favorite PSF sets. I could be mistaken, but I doubt it. It should be noted that Chrono Cross (Crono Cross?) is an original driver rip, as it predates (by years) the creation of the Generic Driver rip-kit tools. And it's a SquareSoft title. They like doing things custom. I expect it to be difficult (though certainly not impossible) to be rippable with the Rip-Kit. Maybe the format they used isn't all that different after all, and will work? Good luck.... Mouser X over and out.
So how does one then extract samples/instruments from Chrono Cross. I can convert psf to exe using Mark's tool, it gives a small file of about 1.31mb or something and I can use another tool called ps sound extractor to get the samples, BUT, in wav form i think, I cannot save that as VB, VH, SEQ... so it's again useless... Is there any way to extract that data and I tried many tools on the original chrono cross psx discs (because I still have them :) ) and I cannot seem to extract or see anything that is real data of the game. Those guys at SquareSoft must have used some very special encryption to keep this all hidden from people... or maybe I am using the wrong tools/methods, but then how? :(
Mouser is right - you can convert the PSF to a PSone executable file and simply rip the data from there. After all, a PSF file is nothing more than a zlib compressed PSone executable with a special header. Really, it's the only reason I included PSF->EXE functionality in this app.
Using this logic, it is technically possible to convert any set for use with my driver, even sets that predate the present "rip-kit" era.
To locate the SEQ, VH and VB data, simply look for the magic words - pQES and pBAV...
...which leads me to your current issue, Bobby. Again, Mouser is right - SquareSoft likes to use their own custom, proprietary stuff. They're one of the only companies to do so (at least, in the PSone era).
Unfortunately, the sequence format simply isn't compatible for use with anything other than the original driver. Specifically, the sequence data is in AKAO format, created by SquareSoft's in-house Sound Engineer. IIRC, the sound banks are usually in VAB format, however.
If anyone has any information on AKAO that I can use, perhaps a AKAO->MID converter, this issue will be smashed.
tl;dr Practically any game can use my sound driver, except SquareSoft titles. :/
VGMTrans can scan psf and extract instrument/sequence and convert to dls/sf2 and midi, BUT, it doesnt sound good, something is off. It detects as Akao also. We need a way to convert that into .seq, vb and vh and remake the psf, etc.
The first site you linked gives very limited information.
VGMtrans source code isn't much better, either, but at least it doesn't contradict itself.
I used VGMtrans to convert a few AKAO sequences to MIDI format, but the output MID files don't work with MIDI players(?). I had to load them into Guitar Pro in-order to get them to work. Also, VGMtrans doesn't seem to work with FF7 at all, either.
It will certainly take quite awhile, as I haven't an infinite amount of time to work on something like this, but it is certainly possible.
EDIT:
I noticed a bug in the last release - 'Drag-and-Drop' was disabled before compiling >_<. It has since been fixed.
Also, I added support for creating and editing PSF files via command line, which is especially useful for batch operations.
I completely forgot to mention what's new in the driver core since v.4.2
All SPU channels (0-23) are now reserved for Sequence playback (*.SEQ, *.SEP). Before, only channels 0-15 were reserved, which caused issues with rare sequences that used any channels above that range.
Volume levels have taken a high priority at the SPU hardware level. Any given track will now sound more vibrant during playback, pretty damn close to CD quality. That said, there's no need for a player's replay gain settings, unless absolutely desired.
Further work on the reverberation engine, bringing it to final status. The average user probably won't notice this, but it's certainly there for those who will.
Alright, here's an issue from a game i'm sure absolutely nobody cares about. There's a strange issue from the Tower music from "The Crow" where when it loops, there supposed to be some noise that happens in game.
Recording from emulator: https://www.sendspace.com/file/n6aogt
To be honest, I'm not sure if the psf one is the way the song is supposed to sound (wouldn't suprise me). I wonder what causes that sound in the real game...
I'm ripping Crash Bandicoot 2 PSFs and every track seems fine except for the Boulder stage themes, where the string section is crazy loud compared to the original.
@Kirishima - Noted. It sounds like I probably forgot to disable a certain debugging feature *embarrassed*
@Moose - That's a rare case that happens with a select few titles (Mortal Kombat II being a notable example - the bass and snare drum is horrendous in a few songs). I have never been able to isolate the bug, as there's few games that bug out.
The only fix I'm aware of is loading the VAB data into a tool that will allow you to adjust the various Program/Tone volume levels. I'd suggest Sony's 'VABtool' for that.
Of course, I could always implement flags to set the VAB data's Program/misc volume settings. Unfortunately, that will bloat the PSF-o-Cycle dialog... so again, I suggest to just simply use VABtool.
EDIT: On second thought, I will probably just create my own VAB editor which will be implemented into GenPSF. That way, the user can simply load the data as normal, adjust VAB settings if desired, then save the PSF. This would prevent both the PSF-o-Cycle and GenPSF dialogs from becoming even more bloated.
Does that SsPitchFromNote function mentioned earlier return the original rate of the raw sample, or the rate of the base-note of an instrument, or what does "note" imply? Because it's not like there's note data in VAB files, right? (Only instruments/patches/programs and sample data..)
If it doesn't calculate the rate of the raw sample, I wonder if there is any way to do so at all? It's been bugging me for a while not to be able to hear samples from VABs at their original true pitch. Surely there must be something that passes an original rate to VAB drivers so that base notes etc. can be properly offset relative to that.. ?! Or were they really technically limited to something absolute (22050Hz?) so composers were required to set the base note of instruments so that it matches their desired pitch at that absolute rate?
I'm wondering specifically because I have a sample (from its original source) that Akira Yamaoka used for Silent Hill 1 and the sample rate GenPSF spits out for the in-game version of the sample is slightly off. Compare:
For posterity's sake I looked into what exactly SsPitchFromNote() uses from the VAB header to calculate the sample rate, and it looks like it's the Pitch Tune value (0x5 in instrument regions) that is used, which indeed appears to be a way for composers to adjust the pitch relative to 22050 Hz (or maybe it's automatically generated somehow; whatever). So I guess getting the true original sample for samples just isn't possible. :/
by Squaresoft74 at 7:47 AM EDT on October 23, 2015
Hello, using the current GenPSF 4.2.1.0 utility, i noticed that when using the "VAB > Split" function, the resulting .vh seems to have incorrect size.
It's smaller than what is reported by Sony's VAB file editor.
Still, merging back extracted .vh and .vb will give proper .vab file
Sony's VAB Tool reports the size of the entire VAB file (VH+VB combined).
The same exact value must be stored in the VH file itself (at offset 0x0C, IIRC).
It's likely that Sony's VAB Tool, which I use often myself, simply reads that value and displays it in the editor.
If not, then Sony's VAB Tool simply calculates the total size by reading the VAG size table located in the VH file.
Either way, it's not a bug, so far as I am aware :)
by Squaresoft74 at 4:37 PM EDT on October 23, 2015
Ok not sure i understood properly or properly explained myself to start with. Let me try again :
Load VAB_File_104.VAB with Sony's VAB Tool , it will report : Total (VH+VB) File Size 147904 Header (VH) File Size 9248 VAG (VB) File Size 138 656
Using "GenPSF v02" or "PSF VAB Splitter from VGMToolbox SVN r1004" to split the VAB file will result with : VAB_File_104.vh 9,03 Kb (9 248 bytes) // Matches with VAB Tool's info VAB_File_104.vb 135 Kb (138 656 bytes) // Matches with VAB Tool's info Total 144 Kb (147 904 bytes) // Matches with VAB Tool's info
Using "GenPSF 4.2.1.0" to split the VAB file will result with : VAB_File_104.vh 8,57 Kb (8 776 bytes) // Doesn't match with VAB Tool's info VAB_File_104.vb 135 Kb (138 656 bytes) // Matches with VAB Tool's info Total 143 Kb (147 432 bytes) // Doesn't match with VAB Tool's info
Now if i combine again VAB_File_104.vh with VAB_File_104.vb i will get the correct original VAB_File_104.VAB back.
Is there any reason later tool doesn't extract the .vh to the "expected" size ?
The end of the VH file can be up to 0x200 bytes, reserved for the VAG table size. GenPSF only writes the needed data and doesn't bother bloating the file with unread/unused zero padding.
The zero padding is only required when the VH is combined with the corresponding VB file -- when the data is combined to make a VAB file.
It's not a bug and I've tested it with VAB Tool and even numerous games in hardware consoles a thousand times.
If it really matters that much, here is a newer version that fixes that (I've had this complaint before).
by Squaresoft74 at 9:00 PM EDT on October 23, 2015
Thank you very much for the updated version ! :)
It's been a long while since i last ripped some PSF stuff and from memory i was always referring to Sony's VAB Tool to check if i had my .vh and.vb files extracted properly.
I was manually hex editing files back in time so i'm more than happy to find new tools like yours to help with the job and save a lot of time ! :)
Many years ago, I was inspired by your rips to create the generic PSF driver which is commonly used today. I coded it from scratch with minor help from CaitSith2... it was the very first program I ever wrote and compiled. I wrote it specifically because at the time, I had no clue how to read/write MIPS r3000a, but I wanted some PSF sets from games that hadn't been ripped.
Since, I have went on to design and develop many, many more applications, even making some money on the side with it. Suffice to say, GenPSF wouldn't exist otherwise.
...so, thank you for the inspiration!
by Squaresoft74 at 5:25 AM EDT on October 28, 2015
:) As for testing on the real hardware , I'd be curious to know how to do that , any way to do it without wasting countless discs ?
Is there any homebrew, maybe using your generic driver that would allow to load and play seq/vab files on the real system ?
The many hardware tests I've conducted are varied.
I only run a couple tests when the driver is compiled, in order to ensure that it's worthy of release.
...but I also use GenPSF for video game creation and modification. In both cases, I have to burn to a disc when testing in hardware.
An exploit for the PS2 was discovered a few years ago called "POP Station" -- an official PSone game launcher from Sony. It works by mounting disc images (in Sony's proprietary VCD format) and uses the original PSone hardware located inside each PS2. This is probably the easiest way, but requires your PS2 to be soft-modded.
Other than that, your only other option would be the obvious -- testing in emulators. For the utmost accuracy, I think XEBRA is where it's at.
by Squaresoft74 at 10:22 AM EDT on October 31, 2015
Can somebody help fix this track. It does not sound right and I have no idea how to fix it because I'm brain-dead. It is a track from Biohazard 2 and asking here since it was made using this utility.
You can set the track length of a specific psf using winamp(right-click song in winamp, view file info) or vgmtoolbox, since it sounds like you have a file that doesn't have one. Make sure to toggle the "Force songs to play indefinitely" setting off in the plugin's settings if you're converting to wav with winamp.
Yes, I know that but its extremely tedious to decode every single psf to wave, search for the loop point in an audio editor and then create the psf again with the correct length. Isn't there an option to automatically set the time to the end of the SEQ? If not, is it possible to implement?
I didn't understand your question initially, so I just gave out an answer for what I thought you were asking, just to keep myself from rambling too long.
As for a more automated way, use psf timer in vgmtoolbox if it's just for seq files. A batch file should be generated which then you'd have to run with psfpoint and bin2psf(maybe) in the folder. Also, i think psf-o-cycle can do that, but I haven't used that in a while.
Apparently I'm a bit too dumb. Here's what I do: I drop all the seq files into the PSF timer, run the batch with psfpoint and try to create the files with PSF.exe. PSF always shows 3:00 as time, no matter, which seq file I choose. If I try to run the PSF Maker in VGM Toolbox, I just get the error message that access to bin2psf.exe was denies. When I try to run bin2psf manually, I get the same error message from Windows. What's wrong here?
It's my fault. I should have said drop the psf's into psf timer. It will only work with psf's with that use the generic seq\vh\vb formats. Others it won't work for afaik. About the issue with bin2psf, I have no idea of what to do about that. Sorry.
There didn't appear to be any issues with the psf as far as I could tell.
Here is compressed folder with the psf already timed along with the timer bat file generated. Turns out bin2psf is entirely unnecessary for timing purposes. TBH, I don't remember why I thought it was needed.
Sorry, I didn't look at this forum for quite some time. Meanwhile the link went offline. Can you please re-upload the file so I can take a look? Thanks!