go get github.com/vszakats/xmcd2cue
This program will convert xmcd compatible CD descriptor files (which can be downloaded from freedb.org) into .cue sheet files, so that you can use them players to see which song is played from an all-in-one CD rip.
There exists a freeware Windows GUI tool named CueMaster to handle similar tasks.
The package contains full source code, and a precompiled binary for the Windows platform.
xmcd2cue [options[s]] xmcd-file[mask] Options: -t Swap album artist and title -s Swap artist and title in track titles -n Rename the .cue sheet file according to album title
The downloadable xmcd files do not always conform to the standard.
Sometimes wrong artist / title separator is used, so xmcd2cue will
" - " as a valid separator as well, but it cannot do anything
"/" (without surrounding spaces), if this is the
case you should fix the xmdb file manually. Sometimes the order of
the artist / title is reversed, in xmcd2cue you should use the
-s command line options to correct this.
You can use wildcards to convert more than one file at once.
+ rewritten in Go + added -t option - deleted -L option
* moved to GitHub * internal cleanups
* hb_osnewline() -> hb_eol() * dropped Clipper compatibility * removed spaces at EOL * version update * updated comment on usage
* Copyright date updates. * Converted spaces to tabs. * Removed @ from email addresses. % Reduced binary size.
* URL change.
% Some FUNCs converted to PROCs. % ExtGet() optimized. ! Chr( 13 ) + Chr( 10 ) -> hb_OSNewLine() ! TITLE and PERFORMER lines swapped again for the album.
+ Puts album ID to a REM. * Puts album length in a separate REM line instead of cluttering the TITLE. + Added PREGAP for the first track. + TITLE and PERFORMER lines swapped. ; Thanks to Ynte for the above ideas. + Puts command line switches in a REM. ! readme.html updated. ! Never write more than 99 tracks. ! Limit the TITLE and PERFORMER command parameters to a maximum of 80 characters.
! Fixed time format where the third part of the time was not correctly calculated. Thanks to Ynte for reporting this. * Updated email address.
+ Generates separate PERFORMER line for the album header instead of combining the artist name with the album title.
! Fixed handling of artist/title when more than one space was used as a separator between them.
; Initial version
The program has a complete read algorithm for the xmcd files, so it can be easily extended to support other output formats.
The program is written in Go language. You can compile it to binary executable on most platforms using:
go build xmcd2cue.go
or run directly:
go run xmcd2cue.go <arguments>
Sample .cue file (generated from the file above)
PERFORMER "Pink Floyd" TITLE "Dark Side of The Moon" REM Total length: 00:42:28 REM ID: 7e09f20a REM Command line option: -t FILE "7e09f20a.mp3" MP3 TRACK 01 AUDIO TITLE "Speak to Me" PREGAP 00:02:00 INDEX 01 00:00:00 TRACK 02 AUDIO TITLE "Breathe" INDEX 01 01:13:18 TRACK 03 AUDIO TITLE "On the Run" INDEX 01 04:00:41 TRACK 04 AUDIO TITLE "Time" INDEX 01 07:33:41 TRACK 05 AUDIO TITLE "The Great Gig in the Sky" INDEX 01 14:38:24 TRACK 06 AUDIO TITLE "Money" INDEX 01 18:43:32 TRACK 07 AUDIO TITLE "Us and Them" INDEX 01 25:15:31 TRACK 08 AUDIO TITLE "Any Colour You Like" INDEX 01 33:05:48 TRACK 09 AUDIO TITLE "Brain Damage" INDEX 01 36:31:18 TRACK 10 AUDIO TITLE "Eclipse" INDEX 01 40:21:55