Skip to content

Instantly share code, notes, and snippets.

@mogery
Last active July 15, 2023 18:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogery/3de008439190aae23f117913e521432b to your computer and use it in GitHub Desktop.
Save mogery/3de008439190aae23f117913e521432b to your computer and use it in GitHub Desktop.
Vib-Ribbon .cue Maker: Make Vib-Ribbon-compatible CD files (.cue and .bin) out of any audio files.
#!/bin/bash
# This software is under the unlicense, see https://unlicense.org/
# Created by https://github.com/mogery
rm -r vibribbon > /dev/null 2> /dev/null
mkdir vibribbon || { echo "failed to create vibribbon directory"; exit 1; }
if [[ $# -eq 0 ]]
then
echo "Vib-Ribbon .cue Maker"
echo "Generates Vib-Ribbon-compatible CD files from a list of audio files"
echo ""
echo "Usage: vibribbouncemaker.sh [audio files]"
echo "Dependencies: sox"
echo "Will create a vibribbon/ folder in cwd with .bin(s) and .cue file"
exit 1
fi
for file in "$@"
do
bn=$(basename "$file")
sox "$file" -t raw -r 44100 -e signed -b 16 -c 2 "vibribbon/$bn.bin" pad 3 0 || { echo "failed to convert $file"; exit 1; }
done
touch vibribbon/vibribbon.cue
echo "dummy binary file. ignore" > vibribbon/dummy.bin
printf "FILE \"%s\" BINARY\n TRACK 01 MODE2/2352\n INDEX 01 00:00:00\n" $(realpath "vibribbon/dummy.bin") > vibribbon/vibribbon.cue
i=2
for file in "$@"
do
bn=$(basename "$file")
rp=$(realpath "vibribbon/$bn.bin")
duration=$(soxi -d "$file" | cut -b "-8")
printf "FILE \"%s\" BINARY\n TRACK %02d AUDIO\n INDEX 00 00:00:00\n INDEX 01 %s\n" "$rp" $i "$duration" >> vibribbon/vibribbon.cue
i=$((i+1))
done
@k4zo
Copy link

k4zo commented May 24, 2021

hi im a complete bumbling idiot how do i install dependencies again
oops nvm turns out i had to do sudo apt update

hi im back and the files arent getting detected by epsxe

@mogery
Copy link
Author

mogery commented May 27, 2021

@k4zo You need to load the .cue

@ioletsgo
Copy link

ioletsgo commented Jun 4, 2021

everytime i try to open the .cue file it crashed the emulator

@k4zo
Copy link

k4zo commented Jun 6, 2021

everytime i try to open the .cue file it crashed the emulator

yeah happened to me too but i switched to duckstation and it works fine

@ioletsgo
Copy link

everytime i try to open the .cue file it crashed the emulator

yeah happened to me too but i switched to duckstation and it works fine

i tried using duckstation, it is far better than xpsce, but it still doesn't work for me. I personally use Manjaro with i3 as the desktop environment.

@Rult
Copy link

Rult commented Jul 17, 2021

@ioletsgo
ePSXe doesn't understand absolute paths provided by this script, so i removed them in my fork and now it works
https://gist.github.com/Rult/193506e1649a4281ec8779a92b7ebabc

@WX580
Copy link

WX580 commented Mar 24, 2023

Upon running this the vibribbon folder is made but the command to make the .cue file doesnt seem to work and if i open the terminal in the directory of the file then it just says that it isnt a command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment