Note: In this tutorial I will assume you already have every instrument sample you need in WAV format.
WAV to VAG
Converting samples into something the playstation can use is not as straightforward with the current tools available.
Even though most samples have metadata inside indicating the starting and ending points of the loop, neither AIFF2VAG, WAV2VAG or VAGEDIT will be able to read this information out of the original file. Additionally, it is required that the starting and ending points to be aligned in blocks of 28 samples. Most samples will have arbitrary looping points and most of the time they will not match the 28 sample boundaries and the converters will pad out the necessary alignment with silence. This is not a problem with one-shot samples but makes looping samples unusable.
In order to counter that you will need to edit and align the sample so it aligns with this boundary. If you don't know or have any software capable of changing sample points in audio files, I recommend this one:
I won't go in depth into how to use this program, and the method I'll present here is not the only way to fix this, but this is the one I find easier to deal with.
Start by opening up the sample you want to convert in LoopAuditioneer or any other software that is able to edit samples, this tutorial shows how to do this using LoopAuditioneer, but there should be similar functions in other software with the same capabilities.
For my method, we will start by getting the number of samples in the Start field and divide it by 28.
Now round this number to the lowest value (Example: 19394 / 28 -> 692.642 -> 692).
Then multiply it again by 28 (692 * 28 -> 19376), this should round the number of samples into the nearest block of 28 samples.
Do the same thing for the end sample. (24925 -> 24920)
With this, you have changed the looping points, but it still won't loop perfectly because most of the time, the duration won't be 28 sample aligned either, for that, you'll need to do a cross-fade in order to hide the artifacts.
Click the "view waveform overlay at looppoints" button:
Here you will type in the values you got from calculating you sample's nearest 28-sample-aligned loop point in the Loopstart field, and the ending in the Loopend field, then click Save Changes.
If the red and blue graph aligns pretty closely, play the sample and listen for artifacts, if it's clean, you can skip the next step.
If you hear looping artifacts, then use the cross-fade tool:
Choose any of the settings, usually linear is fine, and duration and check if your sample now loops properly, if so, you can now save your sample. (I recommend saving to another file)
Now open VAG Editor (VAGEDIT.EXE) from the Psy-Q SDK.
Click Open and in the file type drop-down choose WAV.
Note: For some reason, the VAG Editor refuses to open files modified by the LoopAuditioneer, if this happens to your sample, you will need to open the sample in any audio editor and save it in a way that removes any metadata)
Click the first field (Select Start) and type in the value you you put for the starting point of your loop.
Then click the Set Loop button.
Now the end of the loop should be red, this means the loop point was set.
In the same field, put the value of the end point:
You should be at the very end of your loop, with some leftovers.
The area to the left of the selection cursor needs to be deleted. In order to do that, simply click on the up arrow in the field to the left of the selection start field until the selection reaches the end of the file, it will usually be 28 but depending on your sample might be more.
Then delete the rest by clicking into Edit > Del (or pressing the del key on your keyboard)
Now play the sample and listen for artifacts, if it sounds good, then you can export your VAG.
Of course, you need to do this for every looped sample in the music you want to convert.
Building a VAB
As you might already know, a VAB is like a database of samples, it defines how the instrument sounds.
It needs to be built using the VAB File Editor, so open it up.
Note: There is an earlier beta version of the VAB File Editor in one of the Development discs floating round (version beta 2.0a). I don't recommend using it because it can corrupt your VAB file and you won't be able to edit it again. Look for the version that has the "VAB" icon (Version 2.1):
Click the Create new file button on the top left of the window, it will generate a new program.
Note: If you don't have development hardware, you won't be able to preview how the instruments will sound properly, but you can enable basic support for sample playback by clicking in Preview > Select Mode > Sound Blaster Preview (works on any modern sound card)
A program is what you could call an instrument. It has a bunch of settings that define how the sample will be played.
Once you have created a new file, click the View VAGs button, a new window will open.
Now click Add Extra VAG, choose your sample and click Open, add more samples if you need to. Take note of the Vag Number each sample has, then click Close.
Back at the main window, double click on the first program and another window will popup. This is the Tone Attribute Table for each program inside the VAB file.
There will already be an entry added for you. It is here where you will define how your instruments will sound.
Here you will set up tones. Tones are the samples an instrument/program has.
For instance, if you want a Drum Kit, you don't want to set a program for each of the elements that make up a Drum Kit, and also your midi file probably has all the notes of each drum kit in the same track. Each tone can be a different sample and has a range (MinNote, MaxNote), this means that this sample will only play in the keys inside the range of it's Min and Max notes.
Another use for this are for instruments that change in resonance (pretty much every single one of them) when notes goes higher or lower. If you need multiple tones or not will depend on your music and your samples.
There are a bunch of settings here, so let's go through each one of them:
Priority: This one is unused, you can ignore it.
Reverb: Enables reverb processing for a single tone.
Volume: This is the volume of this specific tone, the volume of the instrument/program can be set in the main screen.
Pan: The difference of volume between the Left and Right channels.
Centre: This one is the most important. This is the root note, or, the note that your sample is in. If you got your sample from a Sample CD, often it will have what note it is somewhere. If you don't know what note your sample is in, LoopAuditioneer can find it out for you.
Note: Most likely your DAW or music edition software will show what note it is, it can be the note name or/and the note number, the VAB tool expects a note number. If the software you are using does not show the number, in order to find out which number a note is you can calculate, for instance: C5 = 60, C4 = 48, etc. You can subtract or add from this in order to find the note number.
Pitch: This is the pitch fine-tuning, it might be needed depending on the sample you are using.
Note: The VAB tool can't preview pitch fine-tuning if you are not using a dev board.
MinNote: The lowest note in which this tone will be played.
MaxNote: The highest note in which this tone will be played.
PBmin: Minimum pitch bend distortion for this tone.
PBmax: Maximum pitch bend distortion for this tone.
ADSR: ADSR Envelope settings. Clicking this button will open a new window with all the settings you can change.
Note: The VAB tool can't preview the ADSR Envelope if you are not using a dev board.
Vag: This is the VAG id to be used for this tone. You can check the VAG id in the main window, by clicking the View VAGs button. (Alternatively, you can just try each VAG id until you hear the one you want)
Extracting the Header and Body
This is not strictly necessary, but makes it easier to load the VAB later using the samples in the SDK.
Using a comand line, run VABSPLIT
Code: Select all
VABSPLIT [VAB filename without extension]
Preparing the MIDI File for Conversion
This is the most important step, I think here is where most people get confused by the complete lack of documentation or how to.
To prepare your MIDI to convert into SEQ you will need to setup a few things:
In your DAW/Editor Software (this will change depending on what you are using) in order to set which instrument/program that specific track will use.
Set the Patch value to the corresponding instrument inside your VAB file.
For instance, assuming you want to set a track to the first instrument in the VAB file:
(For example purposes I'm using FLStudio, since it's what I have here, but this applies to other software too)
Here I set the channel to use Patch 1, which is "Acoustic Grand Piano", but you can ignore that name, it only applies to General Midi. What matters here is the "Patch ID", which will select which program(instrument) will be used inside a VAB.
It is important to notice that the instrument indexes inside MIDI software is 1-indexed (starts at 1) while the Program ID is 0-indexed (starts at 0), so whatever the program ID is inside your VAB file, simple add 1: Program 0 -> Patch 1, Program 1 -> Patch 2, Program 15 -> Patch 16.
Now you can export your MIDI file.
Converting MIDI to SEQ
The name doesn't really help, in order to convert MIDI into a SEQ file, you need to use SMF2SEQ.
In order to convert, just call:
Code: Select all
SMF2SEQ -V [MIDIFILENAME] (without extension)
Note: Most of the command line programs won't work on newer versions of Windows, VAGEDIT, VABTOOL do work at least on Windows 7.
Bonus: Setting Loop Points in your MIDI File
Looping points in MIDI files are not standardized, so the loop event from your DAW might not work for SEQ files.
In oder to set up a loop for PlayStation games, you need to send an event through CC#99 and CC#06.
To setup the start of your loop point, you send an midi event through CC#99 containing the value 20, and at the same time another event through CC#06 containing the number of loops you want. 127 is the maximum and equals to infinite loop.
And to set the end of your loop point, you just send an event through CC#99 with the value 30.
How you do this depends on the software you are using. I will show how to achieve this using FLStudio:
Start by opening the Midi Out settings and right-click on any of the knobs below the "Page 1" drop-down:
Then select configure, Set a name and in Controller # type in 99, click accept, now do the same in the next knob, set Controller # to 6.
Now, right-click again in the CC99 knob, and click Edit Event and find the location where your loop is supposed to start and add an event, the event value must be 20 for this to work. I don't know if there is a way of setting an arbitrary value with FLStudio, but once you set this for the start of the loop, do the same for the end of the loop and set 30.
Then do the same for the CC06 knob, but only for the loop start, must be the exact same time as the CC99 event. You can set it to the maximum possible value. (127)
Well, that's it. If you have any questions don't hesitate to ask.