Skip to main content

Topic: Noncompliant to single wav cuesheet (Read 133424 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Moitah
  • [*][*][*]
Noncompliant to single wav cuesheet
Reply #100
Thanks for your reply, I will update CUE Tools after I finish working on a few other programs.
  • Last Edit: 02 August, 2006, 05:29:36 PM by Moitah

  • shrinkmail
  • [*][*]
Noncompliant to single wav cuesheet
Reply #101
Thanks for your reply, I will update CUE Tools after I finish working on a few other programs.

Glad to hear that you are still working on it. So far your program is working like a gem. Special thanks for this.

  • Fandango
  • [*][*][*][*][*]
Noncompliant to single wav cuesheet
Reply #102
Yes, it always worked like flawlessly. The conversion quality even surpassed the cue sheet interpreter of fb2k 0.8.x and in fact I've never found a difference between a CUETool-created conversion and test rips done with EAC set to the corresponding modes.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Noncompliant to single wav cuesheet
Reply #103
I wrote this a while back.

It's a batch file that that you just drag and drop a separate track CUE onto and it will create a single wave CUE based on the size of the wave files called out in the separate track CUE.

It will accept noncompliant, corrected gaps, as well as leftout gaps CUEs.  If you feed it a corrected gaps CUE it will ask if the waves were created with gaps apended to the beginning or end of the track.  If you feed it a leftout gaps CUE it will ask you if you want to proceed assuming the tracks were created with gaps appended to the end of the track.

Code: [Select]
@ECHO OFF

SET _outfile="%~dpn1 (single wav).cue"

IF EXIST %_outfile% (
  ECHO "%~n1 (single wav).cue"
  ECHO already exists!
  ECHO.
  ECHO Press any key to end . . .
  PAUSE>nul
  GOTO end
)

SET _line=
SET _skip=
SET _file=0
SET _total_frames=0
SET _correct_cue=

GOTO start

:get_next_line
SET /A _line+=1
SET _skip=skip=%_line%

:start
FOR /F "usebackq tokens=1,2* %_skip%" %%X IN (%1) DO (
  SET _x=%%X
  SET _y=%%Y
  SET _z=%%Z
  GOTO generate_cue
)
GOTO end

:generate_cue
IF "%_x%" == "FILE" (
  CALL :file "%~dp1%_y:~1% %_z:~0,-5%
  GOTO check_for_error
)
IF "%_x%" == "PREGAP" (
  IF %_file% GTR 1 (
   IF "%_correct_cue%" NEQ "c" (
     GOTO leftout_gaps
   ) ELSE (
     GOTO lg_index
   )
  )
)
IF "%_x%" NEQ "INDEX" GOTO other
IF "%_z%" == "00:00:00" (
  GOTO start_index
) ELSE (
  GOTO non_start_index
)
:other
IF %_file% NEQ 0 (
  IF "%_x%" == "TRACK" (
   SET _x=  TRACK
  ) ELSE (
   SET _x=    %_x%
  )
)
IF DEFINED _z (
  ECHO %_x% %_y% %_z%>>%_outfile%
  GOTO get_next_line
)
IF DEFINED _y (
  ECHO %_x% %_y%>>%_outfile%
  GOTO get_next_line
)
ECHO %_x%>>%_outfile%
GOTO get_next_line


:start_index
IF "%_y%" == "01" GOTO new_start_index
IF "%_correct_cue%" == "" GOTO corrected_gaps
IF /I "%_correct_cue%" == "p" GOTO get_next_line

:new_start_index
CALL :format_index %_prev_ftotal%
ECHO    INDEX %_y% %mm%:%ss%:%ff%>>%_outfile%
GOTO get_next_line


:non_start_index
IF "%_y%" == "01" (
  IF /I "%_correct_cue%" == "p" (
   CALL :new_00_index %_z%
   GOTO new_start_index
  )
)
CALL :extract_index %_z%
SET /A _iframes=_prev_ftotal + mm*4500+ss*75+ff - _pregap
CALL :format_index %_iframes%
ECHO    INDEX %_y% %mm%:%ss%:%ff%>>%_outfile%
GOTO get_next_line


:new_00_index
CALL :extract_index %1
SET /A _pregap=mm*4500+ss*75+ff
IF %_file% == 1 GOTO :pregap
SET /A _iframes=_prev_ftotal - _pregap
CALL :format_index %_iframes%
ECHO    INDEX 00 %mm%:%ss%:%ff%>>%_outfile%
GOTO :eof

:pregap
ECHO    PREGAP %1>>%_outfile%
GOTO :eof


:file
IF NOT "%~x1"==".wav" (
  ECHO The source CUE sheet must reference wave files!
  SET _error=1
  GOTO :eof
)
IF NOT EXIST %1 (
  ECHO "%~nx1"
  ECHO does not exist!
  SET _error=2
  GOTO :eof
)
SET /A _boundry=(%~z1 - 44)%%2352
IF %_boundry% GTR 0 (
  ECHO The time for
  ECHO "%~n1"
  ECHO cannot be accurately calculated.
  ECHO.
  ECHO The file may not end on a frame boundry.
  SET _error=3
  GOTO :eof
)
SET _prev_ftotal=%_total_frames%
SET /A _total_frames+=(%~z1 - 44)/2352
SET /A _file+=1
SET _pregap=
IF %_file% GTR 1 GOTO :eof
ECHO FILE "Range.wav" WAVE>>%_outfile%
GOTO :eof

:check_for_error
IF "%_error%" NEQ "" GOTO error
GOTO get_next_line


:extract_index
SET _z=%1
IF %_z:~0,1% == 0 (
  SET mm=%_z:~1,1%
) ELSE (
  SET mm=%_z:~0,2%
)
IF %_z:~3,1% == 0 (
  SET ss=%_z:~4,1%
) ELSE (
  SET ss=%_z:~3,2%
)
IF %_z:~6,1% == 0 (
  SET ff=%_z:~7,1%
) ELSE (
  SET ff=%_z:~6,2%
)
GOTO :eof

:format_index
SET /A mm=%1/4500
SET /A ss=%1%%4500/75
SET /A ff=%1%%4500%%75
IF %mm% LSS 10 (SET mm=0%mm%)
IF %ss% LSS 10 (SET ss=0%ss%)
IF %ff% LSS 10 (SET ff=0%ff%)
GOTO :eof


:corrected_gaps
ECHO The source CUE sheet was likely created using
ECHO the Multiple WAV Files With Corrected Gaps option.
ECHO.
ECHO Enter "P" to continue assuming the corresponding files were created
ECHO with the Append Gaps To (P)revious Track (default) option selected,
ECHO.
ECHO enter "N" to continue assuming the corresponding files were created
ECHO with the Append Gaps To (N)ext Track option selected, or
ECHO.
SET /P _correct_cue=press ^<Enter^> to exit:
IF /I "%_correct_cue%" == "p" GOTO get_next_line
IF /I "%_correct_cue%" == "n" GOTO new_start_index
GOTO del_outfile


:leftout_gaps
ECHO The source CUE sheet was likely created using
ECHO the Multiple WAV Files With Leftout Gaps option.
ECHO.
ECHO Enter "c" to continue assuming the corresponding files were created
ECHO with the Append Gaps To Previous Track (default) option selected or
SET /P _correct_cue=press ^<Enter^> to exit:
IF /I "%_correct_cue%" NEQ "c" GOTO del_outfile

:lg_index
CALL :new_00_index %_y%
SET _pregap=
GOTO get_next_line


:error
ECHO.
ECHO Press any key to end . . .
PAUSE>nul

:del_outfile
DEL %_outfile%

:end
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • directjj
  • [*][*]
Noncompliant to single wav cuesheet
Reply #104
Thanks for your reply, I will update CUE Tools after I finish working on a few other programs.


I just joined this thread, just heard about Cue Tools.

Can Cue Tools be used to automate the change of cast to proper case (Title Case) for Song Titles & Performers in Audio cue sheets?

Can it help me understand what is wrong with a .cue file (e.g. won't play in FooBar, plays track 2 twice in FooBar, plays track 12 for every track in WinAmp)?

In a nutshell what can Cue Tools Do.

I was referred to the download page and downloaded it but don't see a description at Moitah.net.

Thanks
"J.J."

  • Moitah
  • [*][*][*]
Noncompliant to single wav cuesheet
Reply #105
[Link removed, see here for updated link]

This fixes the "Index length cannot be 0" and data track issues.  It also adds an option for FLAC output, though the resulting files don't have seektables (which is why it's not 1.6.0 final), and the ability to stop/cancel during the writing of the audio files.
  • Last Edit: 12 November, 2006, 01:59:56 AM by Moitah

  • Fandango
  • [*][*][*][*][*]
Noncompliant to single wav cuesheet
Reply #106
Ah, that's great news! Thanks for this new release. I've tested the Data Track conversion already and it works as expected... ignoring the Data Track when converting seperate track cue sheets to single WAV cue sheet.

Then I have a suggestion for the opposite conversion scenario: add an option like "data track present". This will add an "EAC compliant" data track entry at the end of a seperate track cue sheet, they all look pretty much the same:
Code: [Select]
  TRACK 08 MODEx/2xxx
    TITLE "CD-Rom Track For PC and Mac "
    PERFORMER "Creation Rebel"
    ISRC 000000000000
    INDEX 00 04:10:15

The only thing that needs to be calculated is the "INDEX 00" line, it's the length of the last track. This way the user who knows what he is doing can easily "fake back" a seperate track cue sheet when he made a single wav rip of a CDDA disc with a data track. Also note that TITLE "CD-Rom Track For PC and Mac " is actually correct, the space between Mac and " is a typo in EAC's code, and for compliant's sake I'd adopt it because of that. 

Unfortunately I'm not able to test the "Index length cannot be 0" thing anymore since I've deleted that rip some time ago. The remixes of those Can songs weren't that good anyway...

I also like the FLAC output, too. And I'm sure it will be the most awaited feature by most people.

Btw, how about starting your own thread here in the CD-HW/SW forum? It would be much easier to keep track of CUETools development and also easier to guide people in need of a tool like yours to that thread. Maybe it even becomes a sticky. And I'd contact a moderator to split this thread (at the point where you came up with your tool) and append it to that new thread, so the discussion about CUETools development will remain in one dedicated thread.
  • Last Edit: 14 October, 2006, 11:42:10 AM by Fandango

  • Xenion
  • [*][*][*][*][*]
Noncompliant to single wav cuesheet
Reply #107
cool! thanks for the work. VERY useful

  • Moitah
  • [*][*][*]
Noncompliant to single wav cuesheet
Reply #108
CUE Tools v1.6.0:
  • Added: Option to output FLAC files.
  • Fixed: "Index length cannot be 0" error.
  • Fixed: Couldn't handle CUE sheets with data tracks.
  • It's now possible to stop/cancel when writing audio files.
Download (Binary and Source) - .NET Framework 2.0 required

This version uses the FLAC 1.1.3 beta 2 library for decoding and encoding.  The compression level and "verify" settings can be changed by editing "%AppData%\CUE Tools\settings.txt".  The FLACCompressionLevel setting can range from 0 to 8 (inclusive), FLACVerify is 0 for disabled and 1 for enabled.  The encoded FLAC files do have seektables and were bit-identical when I compared with the official "flac.exe" command line encoder with padding set to 4096 bytes.
  • Last Edit: 03 November, 2006, 11:30:16 PM by Moitah

  • Moitah
  • [*][*][*]
Noncompliant to single wav cuesheet
Reply #109
[Link removed, see here for updated link]

This adds WavPack decoding (no encoding, I'll see how much work that would involve).  I haven't tested it with lossy+correction files but I think it should work.
  • Last Edit: 12 November, 2006, 02:00:14 AM by Moitah

  • ChangFest
  • [*][*][*][*]
Noncompliant to single wav cuesheet
Reply #110
CUE Tools v1.7.0 Beta 1

This adds WavPack decoding (no encoding, I'll see how much work that would involve).  I haven't tested it with lossy+correction files but I think it should work.

Appreciated very much. Thanks!

  • Moitah
  • [*][*][*]
Noncompliant to single wav cuesheet
Reply #111
CUE Tools v1.7.0:
  • Added: WavPack support, both read and write.
[Link removed, see here for updated link] - .NET Framework 2.0 required



I tested the WavPack reader with lossy+correction and it works fine.  The WavPack writer uses the default settings, currently there isn't a way to change the compression level.
  • Last Edit: 12 November, 2006, 02:00:35 AM by Moitah

  • Moitah
  • [*][*][*]
Noncompliant to single wav cuesheet
Reply #112
CUE Tools now has its own thread, please post any new replies there instead of in this thread.