HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: ryanmichaelmcclure on 2015-03-22 20:25:56

Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: ryanmichaelmcclure on 2015-03-22 20:25:56
I've been ripping my CDs to individual FLAC files for each track. I've been keeping the cuesheets and logs for each rip. I would like to start keeping my CD collection as single FLAC files with cuesheets. I do have all of the original CDs, but not all of them are at my apartment. Is there a way that I could join my files?

I'm running Linux right now. I've found that I can use
Code: [Select]
shntool join *.flac -o flac
to join the files into one image, but I need to find a way to make the cuesheet work with the joined file. I want to also be sure that all indexes from the split cuesheet are in the joined cuesheet. Does anyone have any thoughts?
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: tuffy on 2015-03-22 22:19:23
Couldn't you just use metaflac to import the cuesheet into the image's metadata, like:
Code: [Select]
metaflac --import-cuesheet-from file.cue image.flac

This will preserve all the cuesheet's index points losslessly and you can always export an equivalent cuesheet back out again if need be.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: korth on 2015-03-22 22:36:01
The OP has a multiple file CUE sheet. Won't that give the error "CD-DA INDEX offsets must increase in time"?

Quote
shntool cue *.flac > joined.cue

will create a simple CUE sheet but won't preserve tags or all indexes from original CUE sheet.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: ryanmichaelmcclure on 2015-03-23 02:17:37
Korth, I've tried this method and, as you said, it does not preserve tags or some indexes, which is the most important thing to me. Could I possibly copy-paste the indexes from the split cuesheet to the joined one? Would this make a mess of things?
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: korth on 2015-03-23 03:26:45
EDIT: I'm assuming the CUE files that have extra indexes are "Multiple files with gaps (Noncompliant)" CUE files. An example is in the link below.

You have to do some math. In the multiple file CUE (except for track 1) the INDEX 00 is from the beginning of the preceding file (track). Once you join all the files together the INDEX 00 is from the beginning of that larger single file. So you have to use the start position (INDEX 01) of the preceding track in the CDImage CUE + the INDEX 00 value from the original CUE. Remember times are mm:ss:ff where mm=00-59, ss=00-59 and ff=00-74

Take a look at the Multiple files with gaps (Noncompliant) (http://wiki.hydrogenaud.io/index.php?title=Cue_sheet#Multiple_files_with_gaps_.28Noncompliant.29) example then the two examples that follow that one.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: Juha on 2015-03-23 06:14:13
Hmm.. if you get cue sheet through freedb (etc.), don't you usually just need to edit the <filename>.extention/type tag from <filename>.mp3 MP3 <filename>.wav WAVE to <filename>.flac WAVE to get it working for CD in one FLAC file?
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: korth on 2015-03-23 11:27:56
The CUE generated from freedb DISCID won't include gaps (INDEX 00) but yes to TITLE/PERFORMER data and track start positions.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: greynol on 2015-03-23 11:54:10
It won't include indices >1, preemphasis information as well as other information which may or may not be of any use to the end user.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: ryanmichaelmcclure on 2015-03-24 14:26:55
It won't include indices >1, preemphasis information as well as other information which may or may not be of any use to the end user.


Personally, I'd like to have the indices and preemphasis information--as much information that I can have.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: greynol on 2015-03-24 17:51:48
Cuetools.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: mjb2006 on 2015-03-24 19:16:18
Cuetools.

On Linux?
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: greynol on 2015-03-24 19:26:09
Does anyone have any thoughts?

Yes, use CUETools.
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: ryanmichaelmcclure on 2015-04-02 22:16:15
@greynol, CUETools does exactly what I need!!! Thank you for the recommendation. However, I'd like to eventually have a Linux solution. Until then, I'll surely use CUETools to take care of my sheets.

@korth, You're exactly right--they are Noncompliant gaps. Thank you for the tip for the math! I'm going to see if I can write a batch script that will do the process for me...trying to code "add mm:ss:ff" may prove to be a little tricky, but I'll get it to work.

If I were to get a working script, I'd like to share it with the HydrogenAudio community. Where should I post it upon finishing it?
Title: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: mjb2006 on 2015-04-02 22:31:20
Even if only works with FLAC rips, a script that does CUETools-style conversion of cue sheets and rips would probably belong in...

the CD hardware/software/ripping forum
http://www.hydrogenaud.io/forums/index.php?showforum=20 (http://www.hydrogenaud.io/forums/index.php?showforum=20)

or the General Audio forum
http://www.hydrogenaud.io/forums/index.php?showforum=1 (http://www.hydrogenaud.io/forums/index.php?showforum=1)
Title: Re: Joining split FLAC files and cuesheet to single FLAC and cuesheet
Post by: sziebadam on 2023-11-07 13:02:05
CUETools, yes. I was stuck for awhile until I saw that I have to pick `Encode` action + `Image + CUE` mode instead of `Create CUE Sheet` action.

PS. Sorry for revamping but Google search got me to this topic and I thought this info might spare some time for someone.