How to Play Custom Songs in Vib-Ribbon on an Emulator
Vib-Ribbon is a game that released on the PS1 in 1999, and the PS3 and PS Vita in 2014. It has an innovative feature that allows players to insert their own Music CD into their PlayStation, and play a level generated from that CD. Players occasionally use a PC emulator to play their copy of the game so they can see 4K graphics, among other things, but the available guides on how to play custom songs on an emulator tell the reader to download disc burning software, which is completely uneccessary, because the Audio CD format is more simple than they think.
I have tools to convert an audio file to an Audio CD format automatically, but first I would like to teach you about the Audio CD format.
Audio CD Format: the Cue File
The Audio CD format consists of multiple files: one audio file for each song on the disc, and a cue sheet file containing text that states where on the cd each song is located; this cue file allows CD players to play the disc, and it is also the file you load when you want to load a digital CD image in an emulator. Converting an audio file to Audio CD format could be as simple as typing a cue sheet for it (if the audio file is already in the correct format).
Here is an example cue sheet. "music.wav" is the name of the audio file. The Audio CD format allows the audio formats BINARY (which is usually .bin), WAVE (.wav or .flac), MP3, AIFF, and MOTOROLA; However, DuckStation will only read cue files that use BINARY. If you want to put multiple audio files on the same "CD", simply repeat the first three lines, change music.wav to your file name, and change TRACK 01 AUDIO to TRACK 02 AUDIO. You can add as many tracks as you want as long as the total file size of all the audio files combined is less than 700 MB (the maximum storage of a physical CD).
Audio CD Format: Audio Files
Different emulators support different file types. As stated previously, DuckStation only supports Audio CD wav files that are marked as BINARY in the .cue. A wav file needs to have its properties set to the exact ones specified by the Audio CD wav format in order to work (the codec: PCM, signed 16-bit little endian; a sample rate of 44100Hz; and stereo). One way to convert an audio file to an Audio CD wav is to use VLC Media Player (Media > Convert / Save... > Add files > Profile > Audio - CD). I also have a webapp that can take any input audio file and convert it to a wav + cue pair.
Compressing Music With chdman
If you're converting all your files to wav, you may find yourself quickly losing space on your hard drive because wav is an uncompressed format. If you want to compress your songs while still being able to play them in DuckStation, you can use chdman, a command-line program that comes with MAME, to compress them to chd (a file format that can compress each wav + cue pair to a single .chd file).
The official chdman executable is for Windows. Linux users can install chdman by installing the "mame-tools" package. MacOS users can install chdman using brew. Android users can use chdman by following this guide.
I once attempted to compile chdman to a webapp so that anyone could use it, but I was unsuccessful.
Tools to Automatically Convert Audio Files to Audio CD Format
Manually converting many audio files to Audio CD format then compressing them to chd will take a lot of time, so I wrote a script to speed up the process. You will still need to install VLC and (optionally) chdman to use this script, because it's nothing more than a shortcut to do the steps I already told you about. You can download the script at my GitHub repository.
If you cannot or do not want to use the script, you can use the previously mentioned webapp to convert any input audio file to a wav + cue pair; however, the webapp cannot compress the wav + cue pair to chd.