binmerge icon indicating copy to clipboard operation
binmerge copied to clipboard

Preserve CD-TEXT fields when merging

Open bikerspade opened this issue 1 year ago • 7 comments

Example input cuesheet (from redump ID 120371 for Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle)):

TITLE "Castlevania Requiem"
PERFORMER "Konami"
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 01).bin" BINARY
  TRACK 01 AUDIO
    TITLE "Nocturne in the Moonlight"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 02).bin" BINARY
  TRACK 02 AUDIO
    TITLE "Dracula Castle"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 03).bin" BINARY
  TRACK 03 AUDIO
    TITLE "Dance of Gold"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 04).bin" BINARY
  TRACK 04 AUDIO
    TITLE "Marble Gallery"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 05).bin" BINARY
  TRACK 05 AUDIO
    TITLE "Nocturne"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 06).bin" BINARY
  TRACK 06 AUDIO
    TITLE "Wood Carving Partita"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 07).bin" BINARY
  TRACK 07 AUDIO
    TITLE "Lost Paintings"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 08).bin" BINARY
  TRACK 08 AUDIO
    TITLE "Dance of Pearls"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 09).bin" BINARY
  TRACK 09 AUDIO
    TITLE "Wandering Ghosts"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 10).bin" BINARY
  TRACK 10 AUDIO
    TITLE "The Tragic Prince"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 11).bin" BINARY
  TRACK 11 AUDIO
    TITLE "Strange Bloodlines"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 12).bin" BINARY
  TRACK 12 AUDIO
    TITLE "Mournful Serenade"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 13).bin" BINARY
  TRACK 13 AUDIO
    TITLE "Divine Bloodlines"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 14).bin" BINARY
  TRACK 14 AUDIO
    TITLE "Vampire Killer"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 15).bin" BINARY
  TRACK 15 AUDIO
    TITLE "Cross Fear"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 16).bin" BINARY
  TRACK 16 AUDIO
    TITLE "Bloody Tears"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 17).bin" BINARY
  TRACK 17 AUDIO
    TITLE "Cemetery"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 18).bin" BINARY
  TRACK 18 AUDIO
    TITLE "Beginning"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 19).bin" BINARY
  TRACK 19 AUDIO
    TITLE "Slash"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 20).bin" BINARY
  TRACK 20 AUDIO
    TITLE "Ghost Ship Painting"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 21).bin" BINARY
  TRACK 21 AUDIO
    TITLE "Red Dawn"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 22).bin" BINARY
  TRACK 22 AUDIO
    TITLE "Tues Deus meus (in manibus tuis)"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 23).bin" BINARY
  TRACK 23 AUDIO
    TITLE "Moon Fight"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 24).bin" BINARY
  TRACK 24 AUDIO
    TITLE "Dance of Illusions"
    PERFORMER "Konami"
    INDEX 01 00:00:00
FILE "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle) (Track 25).bin" BINARY
  TRACK 25 AUDIO
    TITLE "Daybreak"
    PERFORMER "Konami"
    INDEX 01 00:00:00

After running the following: binmerge "Castlevania Requiem - Symphony of the Night & Rondo of Blood - Soundtrack Selection (USA) (PS4 Game Bundle).cue" test

Contents of generated test.cue:

FILE "test.bin" BINARY
  TRACK 01 AUDIO
    INDEX 01 00:00:00
  TRACK 02 AUDIO
    INDEX 01 01:47:34
  TRACK 03 AUDIO
    INDEX 01 03:42:55
  TRACK 04 AUDIO
    INDEX 01 05:37:47
  TRACK 05 AUDIO
    INDEX 01 07:04:18
  TRACK 06 AUDIO
    INDEX 01 09:25:30
  TRACK 07 AUDIO
    INDEX 01 12:11:54
  TRACK 08 AUDIO
    INDEX 01 13:55:07
  TRACK 09 AUDIO
    INDEX 01 16:27:70
  TRACK 10 AUDIO
    INDEX 01 19:21:39
  TRACK 11 AUDIO
    INDEX 01 23:27:69
  TRACK 12 AUDIO
    INDEX 01 25:03:51
  TRACK 13 AUDIO
    INDEX 01 29:44:14
  TRACK 14 AUDIO
    INDEX 01 32:58:08
  TRACK 15 AUDIO
    INDEX 01 37:30:65
  TRACK 16 AUDIO
    INDEX 01 40:09:20
  TRACK 17 AUDIO
    INDEX 01 41:41:43
  TRACK 18 AUDIO
    INDEX 01 44:57:36
  TRACK 19 AUDIO
    INDEX 01 48:02:05
  TRACK 20 AUDIO
    INDEX 01 50:26:65
  TRACK 21 AUDIO
    INDEX 01 53:05:15
  TRACK 22 AUDIO
    INDEX 01 55:58:48
  TRACK 23 AUDIO
    INDEX 01 58:02:69
  TRACK 24 AUDIO
    INDEX 01 60:34:72
  TRACK 25 AUDIO
    INDEX 01 63:54:04

bikerspade avatar Dec 16 '24 16:12 bikerspade

Doable, but can you give a use case?

putnam avatar Dec 18 '24 00:12 putnam

Use case: CUETools 2.2.6 supports converting a monolithic bin/cue to flac, but it does not support redump split bin/cue. Preserving CD-TEXT in the merged bin/cue can be helpful when populating default track information.

bikerspade avatar Dec 18 '24 14:12 bikerspade

Please support this

thomasb9511 avatar Mar 23 '25 17:03 thomasb9511

Use case: CUETools 2.2.6 supports converting a monolithic bin/cue to flac, but it does not support redump split bin/cue. Preserving CD-TEXT in the merged bin/cue can be helpful when populating default track information.

This is also an issue with CUETools, right? I always thought it expected the files to have the WAVE tag at the end, not BINARY, that's why it failed. I never tried a single-file image to see what happened. BTW, you can convert the bin files directly to flac using: flac -8 --force-raw-format --endian=little --channels=2 --bps=16 --sample-rate=44100 --sign=signed --verify -- filename*.bin

malvarenga123 avatar Aug 24 '25 18:08 malvarenga123

It looks like the change to support this for tracks only would be quite minor. Just 4 differences/+10 lines.

Basically just a new metadata dict per track and another regex processing block in read_cue_file after the INDEX one with the regex: r'(FLAGS|ISRC|TITLE|PERFORMER|SONGWRITER) (.*)'.

The global TITLE and PERFORMER cue commands at the top would still be lost though. @bikerspade Are those necessary?

Supporting global stuff too would be more work with perhaps some extra logic required to keep things from getting mixed up with tracks and what not.

cgarz avatar Sep 03 '25 08:09 cgarz

Ideally, top-level TITLE and PERFORMER tags should be preserved so that the process is lossless.

bikerspade avatar Sep 03 '25 11:09 bikerspade

Ah well, pity. Figured I'd ask if just track metadata would be enough since it was an easy change.

I might get back to it. But stuff like REM and what not can appear anywhere and then there are global commands with the same name as track commands and some other stuff that would need to be handled.

cgarz avatar Sep 03 '25 23:09 cgarz