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.
@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