Script to generate cuesheet from audio cd

interpretive language scripts


Moderator: Forum moderators

Post Reply
User avatar
fredx181
Posts: 3089
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 376 times
Been thanked: 1316 times
Contact:

Script to generate cuesheet from audio cd

Post 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 1370 times
capture14677.png
capture14677.png (50.72 KiB) Viewed 1370 times
User avatar
greengeek
Posts: 1384
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 535 times
Been thanked: 192 times

Re: Script to generate cuesheet from audio cd

Post by greengeek »

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

User avatar
fredx181
Posts: 3089
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 376 times
Been thanked: 1316 times
Contact:

Re: Script to generate cuesheet from audio cd

Post 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

User avatar
greengeek
Posts: 1384
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 535 times
Been thanked: 192 times

Re: Script to generate cuesheet from audio cd

Post 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!

Post Reply

Return to “Scripts”