Page 1 of 1

Script to generate cuesheet from audio cd

Posted: Wed Oct 14, 2020 4:38 pm
by fredx181
Here's a script (gtkdialog GUI) that generates a 'cue' sheet from an audio cd directly, with metadata (from cddb server lookup, if multiple matches there's choice selection).

There are ways to do similar, e.g. with cdrdao, output to a .toc file, then convert .toc to .cue but that's slow and inconvenient, could not find a program that does it in one step, (only 'mkcue', but it doesn't support a cddb database lookup)
Also cdda2wav can generate a cuesheet but it's part of the ripping process, I wanted to generate it directly, to be able to edit first, so made this for myself, maybe it's useful for someone.
Took some parts from the 'abcde' commandline cd ripper and 'cddb-tool' script.

Once the .cue is generated, say "artist - album".cue, you can rip the cd to a single wav with same name "artist - album", e.g.:

Code: Select all

cdparanoia -Z '1-' "artist - album".wav
Or with cdda2wav:

Code: Select all

cdda2wav -tall -D /dev/cdrom "artist - album".wav
Then you can convert the single .wav to e.g. single .flac, then you need to edit the cuesheet, change .wav to .flac:
FILE "Herbie Hancock - The Herbie Hancock Trio '77.flac" WAVE

There are media players that support playing from .cue, e.g. vlc, mpv, deadbeef and probably more.

To split the single .wav (or .flac), you can use shnsplit (part of the shntool package), using the .cue, e.g. to flac:
(change to what the real artist and album is of course)

Code: Select all

mkdir "artist - album" 
shnsplit -f "artist - album".cue -t '%n-%t' -o flac "artist - album".wav -d "artist - album"
Or to ogg:

Code: Select all

mkdir "artist - album"
shnsplit -f "artist - album".cue -t '%n-%t' -o "cust ext=ogg oggenc -q 5 -o %f -" "artist - album".wav -d "artist - album"
Use cuetag to tag the files (is part of the 'cuetools' package)

Code: Select all

cuetag "artist - album".cue "artist - album"/*.flac       ## or *.ogg
I'm working on a ripping program that is using this method, coming up soon!

Attached cuegen.sh, Remove fake .gz extension and make executable

Fred

cuegen.sh.gz
Remove fake .gz extension and make executable
(41.31 KiB) Downloaded 156 times
Screenshot.png
Screenshot.png (20.56 KiB) Viewed 1369 times
capture14677.png
capture14677.png (50.72 KiB) Viewed 1369 times

Re: Script to generate cuesheet from audio cd

Posted: Fri Nov 20, 2020 9:37 pm
by greengeek

Is CDDB still active? I can't seem to access it from CD ripping utilities.


Re: Script to generate cuesheet from audio cd

Posted: Sat Nov 21, 2020 11:29 am
by fredx181
greengeek wrote:

Is CDDB still active? I can't seem to access it from CD ripping utilities.

Try changing freedb.org to gnudb.org in cd ripper settings, freedb.org is down, but gnudb.org works ok for me (http://gnudb.gnudb.org)

Fred


Re: Script to generate cuesheet from audio cd

Posted: Sun Nov 22, 2020 6:56 am
by greengeek
fredx181 wrote: Sat Nov 21, 2020 11:29 am
greengeek wrote:

Is CDDB still active? I can't seem to access it from CD ripping utilities.

Try changing freedb.org to gnudb.org in cd ripper settings, freedb.org is down, but gnudb.org works ok for me (http://gnudb.gnudb.org)

Fred

Perfect! Thank you!