You are not logged in.

#1 2009-07-11 01:37:14

sen
Member
From: .de
Registered: 2007-02-18
Posts: 152
Website

CUE Audio-CD Image Splitter

I had to split alot of Music CDs today (different filetypes) and created a simple script to automate & speed up the process.
Dunno if there already exists a programm for this but maybe some of you find it useful as well.

The script is a frontend for: cuetools shntool mp3splt
supported filetypes: ape flac mp3 ogg tta wv wav

It splits the image in single files and tags them using the infos provided in the cue file.
ape and wav files will be converted to flac.

Usage: cuesplit /path/to/dir
The default path is the current directory.

cuesplit.sh

#!/bin/sh

# frontend for:            cuetools, shntool, mp3splt
# optional dependencies:    flac, mac, wavpack, ttaenc
# v1.3 sen


SDIR=`pwd`

if [ "$1" = "" ]
  then
    DIR=$SDIR
else
    case $1 in
        -h | --help )
            echo "Usage: cuesplit [Path]"
            echo "       The default path is the current directory."
            exit
            ;;
        * )
        DIR=$1
    esac
fi

echo -e "\

Directory: $DIR
________________________________________
"
cd "$DIR"
TYPE=`ls -t1`

case $TYPE in
    *.ape*)
        mkdir split
        shnsplit -d split -f *.cue -o "flac flac -V --best -o %f -" *.ape -t "%n %p - %t"
        rm -f split/00*pregap*
        cuetag.sh *.cue split/*.flac
        exit
        ;;

    *.flac*)
        mkdir split
        shnsplit -d split -f *.cue -o "flac flac -V --best -o %f -" *.flac -t "%n %p - %t"
        rm -f split/00*pregap*
        cuetag.sh *.cue split/*.flac
        exit
        ;;

    *.mp3*)
        mp3splt -no "@n @p - @t (split)" -c *.cue *.mp3
        cuetag.sh *.cue *split\).mp3
        exit
        ;;

    *.ogg*)
        mp3splt -no "@n @p - @t (split)" -c *.cue *.ogg
        cuetag.sh *.cue *split\).ogg
        exit
        ;;

    *.tta*)
        mkdir split
        shnsplit -d split -f *.cue -o "flac flac -V --best -o %f -" *.tta -t "%n %p - %t"
        rm -f split/00*pregap*
        cuetag.sh *.cue split/*.flac
        exit
        ;;

    *.wv*)
        mkdir split
        shnsplit -d split -f *.cue -o "flac flac -V --best -o %f -" *.wv -t "%n %p - %t"
        rm -f split/00*pregap*
        cuetag.sh *.cue split/*.flac
        exit
        ;;

    *.wav*)
        mkdir split
        shnsplit -d split -f *.cue -o "flac flac -V --best -o %f -" *.wav -t "%n %p - %t"
        rm -f split/00*pregap*
        cuetag.sh *.cue split/*.flac
        exit
        ;;

    * )
    echo "Error: Found no files to split!"
    echo "       --> APE, FLAC, MP3, OGG, TTA, WV, WAV"
esac
exit

edit: Just had to split a tta file and updated the script.
edit2: better file naming for flac files
edit3: parses additional flac encoder settings: -V --best

Last edited by sen (2010-05-16 05:13:00)

Offline

#2 2009-07-12 22:43:44

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,829
Website

Re: CUE Audio-CD Image Splitter

sen wrote:

I had to split alot of Music CDs today (different filetypes) and created a simple script to automate & speed up the process.
Dunno if there already exists a programm for this but maybe some of you find it useful as well.

The script is a frontend for: cuetools shntool mp3splt
supported filetypes: ape flac mp3 ogg wv wav

It splits the image in single files and tags them using the infos provided in the cue file.
ape and wav files will be converted to flac.

Usage: cuesplit /path/to/dir
The default path is the current directoty.

cuesplit.sh

#!/bin/sh

# frontend for:            cuetools, shntool, mp3splt
# optional dependencies:    flac, mac, wavpack

SDIR=`pwd`

if [ "$1" = "" ]
  then
    DIR=$SDIR
else
    case $1 in
        -h | --help )
            echo "Usage: cuesplit [Path]"
            echo "       The default path is the current directory."
            exit
            ;;
        * )
        DIR=$1
    esac
fi

echo -e "\

Directory: $DIR
________________________________________
"
cd "$DIR"
TYPE=`ls -t1`

case $TYPE in
    *.ape*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.ape
        cuetag.sh *.cue track*.flac
        exit
        ;;

    *.flac*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.flac
        cuetag.sh *.cue track*.flac
        exit
        ;;

    *.mp3*)
        mp3splt -no "@n @p - @t (split)" -c *.cue *.mp3
        cuetag.sh *.cue *split\).mp3
        exit
        ;;

    *.ogg*)
        mp3splt -no "@n @p - @t (split)" -c *.cue *.ogg
        cuetag.sh *.cue *split\).ogg
        exit
        ;;

    *.wv*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.wv
        cuetag.sh *.cue track*.flac
        exit
        ;;

    *.wav*)
        cuebreakpoints *.cue | shnsplit -a track -o flac *.wav
        cuetag.sh *.cue track*.flac
        exit
        ;;

    * )
    echo "Error: Found no files to split!"
    echo "       --> APE, FLAC, MP3, OGG, WV, WAV"
esac
exit

Thanks, very nice job....


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2009-07-28 17:34:45

evhan
Member
Registered: 2009-07-20
Posts: 6
Website

Re: CUE Audio-CD Image Splitter

This is excellent -- thanks a ton.

Offline

#4 2010-02-09 20:57:25

hsn
Member
Registered: 2009-02-07
Posts: 17

Re: CUE Audio-CD Image Splitter

Tanks a lot big_smile

Offline

#5 2010-04-26 02:45:18

sen
Member
From: .de
Registered: 2007-02-18
Posts: 152
Website

Re: CUE Audio-CD Image Splitter

Updated to v1.2! wink

Offline

#6 2010-05-15 09:53:58

misc
Member
From: Bavaria, Germany
Registered: 2010-03-22
Posts: 110

Re: CUE Audio-CD Image Splitter

Thanks a lot for this; I was really missing something with a Medieval CUE Splitter functionality.

One dozy question though: Do the scripts / programs it calls make flac encode with the highest compression level?

Offline

#7 2010-05-16 05:22:47

sen
Member
From: .de
Registered: 2007-02-18
Posts: 152
Website

Re: CUE Audio-CD Image Splitter

misc wrote:

Thanks a lot for this; I was really missing something with a Medieval CUE Splitter functionality.

One dozy question though: Do the scripts / programs it calls make flac encode with the highest compression level?

Actually I didn't know if you can parse encoder settings via shnsplit but it is possible and thanks to you I looked into this.

The default flac encoding settings are this:

flac -s -o %f

So the default flac compression level of 6 was used (8 being the highest available).

I've updated the script and added the flac encoder settings -V (verification) and --best (highest available compression level - currently 8).

Offline

#8 2011-02-22 16:08:24

wsduvall
Member
From: Blacksburg
Registered: 2009-02-05
Posts: 54
Website

Re: CUE Audio-CD Image Splitter

Major thanks for this gem. I posted a link to this thread on the APE+CUE Splitting wiki page here: https://wiki.archlinux.org/index.php/AP … _Splitting

Last edited by wsduvall (2011-02-22 16:08:53)


My 5 node 9 CPU cluster: www.amenrecluster.com
OS: Arch Linux
Machines:Fujitsu T4210 and IBM eServer xSeries 335

Offline

#9 2014-10-17 06:33:04

jenniwefer
Member
Registered: 2014-10-17
Posts: 1

Re: CUE Audio-CD Image Splitter

Thank you.

An entire multi-track audio CD may be ripped to a single audio file and a cue sheet. However software audio players and hardware digital audio players often treat each audio file as a single playlist entry, which can make it difficult to select and identify the individual tracks. A common solution is to split the original audio file into a series of separate files, one per track.

There is a step by step on how to split FLAC, MP3, APE, WAV, DTS, WMA, OGG, etc accompanied with CUE file on Mac and Windows which informs us a method of writting a CUE file by yourself:


CUE file looks like this:

PERFORMER "Rainer Kubmaul; Sonja Prunnbauer"
TITLE "Paganini - Sonatas for Violin and Guitar"
FILE "Paganini.-.Sonatas.for.Violin.and.Guitar.flac" WAVE
  TRACK 01 AUDIO
    TITLE "01. I. Allegro Spiritoso"
    PERFORMER "Rainer Kubmaul, Sonja Prunnbauer"
    INDEX 01 00:00:00
TRACK 02 AUDIO
    TITLE "02. II. Adagio Assai Espressivo"
    PERFORMER "Rainer Kubmaul, Sonja Prunnbauer"
    INDEX 01 07:21:00
TRACK 03 AUDIO
    TITLE "03. III. Rondeau"
    PERFORMER "Rainer Kubmaul, Sonja Prunnbauer"
    INDEX 01 10:37:00

Offline

Board footer

Powered by FluxBB