[Update: cue-splitter 0.2 re-written in python/pyGTK > GUI, Batch Processing]
[2011/04: 0.2.3 added split-to-FLAC, simplified GUI]
[2011/06: 0.2.4 added [File > Show the Log File] ]
My use case
Some time ago I started converting my CD collection to FLAC for playback in my Linux media center.
I chose to rip my CDs to single FLAC files + cuesheets, in order to preserve the inter-track gaps (classical CDs can be rendered un-listenable without this).
Every now and then, I upload a few of my CDs to my portable digital audio player. For this, I needed a practical tool to cut the single FLAC into Ogg & MP3 files.
The tool I needed
Since I am not a real geek, I wanted to use Nautilus' context menu for this. I also wanted my tool to handle FLAC, APE and Wavpack (wv) files, as some of my older rips were in those formats. What's more, I wanted the tool to ask me the output base folder, in which a sub-folder would be automatically created based on the Artist and Album names. A standard gnome filechooser dialog would be used for this.
And pushing the boundaries even more, I wanted the ID3 tags in the generated MP3 files to be automatically filled-in based on the cuesheet file information, so my tiny new Sansa Clip player would be able to index the songs per album and per artist.
The lossless audio file + cuesheet splitter script I wrote
Unfortunately, I couldn't find any existing tool to suit my exact needs, so I wrote my own tool, which does all the above, and using the nautilus-scripts package, can be nicely integrated into nautilus.
The cue-splitter script I wrote provides support for UTF and non-UTF-encoded cuesheet files, properly handling accented characters in filenames and songnames (tested with spanish and french accents), generating non-accented filenames for the mp3 cuts, but preserving the accents in the ID3 tags.
Update: as a Python-learning exercise, I rewrote the original bash script in python/pyGTK, adding a GUI (pardon my total lack of GUI-designer skills), allowing easy selection of the output codec and quality, and also adding intuitive (or so I think) batch-processing functionality, allowing drag and drop of cuesheet files from Nautilus. Besides that, by using the neat python-mutagen library, the resulting MP3 files now have ID3v2 tags instead of ID3v1. Integration with Nautilus context menu using nautilus-scripts is still supported and practical but no longer mandatory. For new command line options, run "cue-splitter --help"
I'm guessing there must be someone out there with similar needs to mine, so here's my script...
Installation of Dependencies
Code:
sudo apt-get install shntool lame flac wavpack vorbis-tools nautilus-script-manager python-mutagen
Download the script (attached to this post) and move it (or link it) to this folder in your home folder:
Code:
~/.gnome2/nautilus-scripts
To use it, use nautilus to navigate to the folder that contains the .cue and the lossless audio file, right-click on the .cue, and select Scripts > cue-splitter, then select the output base folder (a sub-folder will be automagically generated), and wait for the pulsating bar to disappear. Enjoy.
This has been tested in Ubuntu 10.04 but should work in other variants and Linux distros as well, provided the dependencies are met.
Please beware of my rusty coding style, and use at your own risk : ) The code is GPL'd. More info inside the script file.
If you improve the script, fix bugs &c, feel free to post back the new code.
-----------------------
News:
Version 0.2.4: added [File > Show the Log File] option in the menu
Version 0.2.3: added split-to-FLAC support; simplified GUI (smaller footprint)
Version 0.2.2: missing DATE in cuesheet no longer causes trouble with the cuesheet parser
Version 0.2.1: major GUI improvements; better handling of long folder names for the splitted output (limits to 44 chars, which is what the Sansa Clip+ player can safely handle)
Version 0.2.0: script completely rewritten in python/pyGTK, now with a GUI, batch processing and ID3v2.4 support
Version 0.10: added some python code to support "REM GENRE" and "REM DATE" tag transfer from cuesheet to ogg track file (cuetag does not support "REM *" tags)
Version 0.9: changed output to ogg vorbis quality 6 and added dependency to vorbis-tools; now converts the cuesheet to UTF-8 encoding
Version 0.8: stopping the script by selecting "Cancel" in zenity's destination folder selection now works; better guessing of destination folder
Version 0.7 - fixed issue with filenames with multiple dots - 20080914
Version 0.6 - improves handling of accented song titles - 20080913
Bookmarks