Cue2cu2: A Python script to create CU2 sheets

Generic Customer Feedback, Content and Reviews based directly on PSIO
User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 10th, 2019, 9:44 pm

Hi everyone,

because I like using Linux/UNIX and the terminal, wanted to try doing something in Python, and learn a thing or two about CDs and disc images, I started writing my own Cue sheet to CU2 sheet conversion tool. I figure, one or the other here might find it useful, as some don't have a Windows machine in reach at all times or don't want to use Wine.

I released Cue2cu2 on GitHub as open source software. Feel free to try it out (at your own risk). I'm keen on your guys' feedback!

I quote the Readme file:
By default, Cue2cu2 uses the compatibility mode, and thus, aims to create a CU2 sheet that is identical to what the PSIO System Console would output. While the resulting CU2 sheets seem to work fine with the PSIO, they appear to be inconsistent. Each track's starting position is 2 seconds behind the position noted in the original cue sheet, and "trk end" is 6 seconds beyond the bin file's end. Disabling compatibility mode uses the timecodes from the original cue sheet as well as seemingly correct values for size, data1 and trk end. However, as of writing this, it is unconfirmed if/what is the reason behind the timings per PSIO System Console. Thus, the non-compatibility mode is to be treated as experimental and subject to change.
Matt and Yuri, are the mentioned inconsistencies maybe a bug? As I don't know what exactly the PSIO does internally, I have no idea if this is really how the timecodes in the CU2 sheet should look like.

For comparison, here are (shortened) CU2 sheets for Destruction Derby 2:

Compatibility mode, identical to PSIO System Console output:

Code: Select all

ntracks 19
size      61:30:06
data1     00:02:00
track02   06:59:49
(...)
track19   58:06:60

trk end   61:34:06
Non-compatibility mode:

Code: Select all

ntracks 19
size      61:28:06
data1     00:00:00
track02   06:57:49
(...)
track19   58:04:60

trk end   61:28:06
Note especially the trk end timecodes.

I haven't tested non-compatibility mode CU2 sheets on my PSIO yet, as I consider compatibility the highest priority for Cue2cu2 and the non-compatibility mode very experimental until I have feedback from Matt and Yuri.

Cheers

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 10th, 2019, 11:17 pm

Would be great to expand it with multi-bin merging and MULTIDISC.LST generation.

BTW, the current version of System Console creates a return line in MULTIDISC.LST. Isn't that supposed to be a big no-no?
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 11th, 2019, 4:46 am

I might look into the merging for an updated version. No guarantees, though, yet. :-)

The multidisc.lst file can be very easily created on unixoid systems already. You just need dos2unix installed, which includes a variant to go the other way.

Code: Select all

ls *.bin | unix2dos > multidisc.lst
That's how I created all my multidisc.lsts if I remember correctly. Should work.

I don't know what you mean by "return line", if it's an empty line, that indeed should not happen for what I know. An ending carriage return and line feed as per DOS line breaks is okay, though. Even though the CU2 sheets do not have them, which seems odd to me. Cue2cu2 also does not add them in compatibility mode in order to have the result bit-identical to what the System Console would produce.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 11th, 2019, 5:14 am

NRGDEAD wrote:
April 11th, 2019, 4:46 am

Code: Select all

ls *.bin | unix2dos > multidisc.lst
That's how I created all my multidisc.lsts if I remember correctly. Should work.
Yeah, but it would be great to have a GUI for this as well. All things in one place, basically.
NRGDEAD wrote:
April 11th, 2019, 4:46 am
I don't know what you mean by "return line", if it's an empty line, that indeed should not happen for what I know.
This is how an automated file from System Console looks right now.

Image
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 11th, 2019, 5:23 am

I won't do a GUI. Just a bit of Python. Also, remember the UNIX philosophy: do one thing, but do it well. ;-)

And yes, that is an empty line that shouldn't be there as far as I know.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 11th, 2019, 5:25 am

NRGDEAD wrote:
April 11th, 2019, 5:23 am
I won't do a GUI. Just a bit of Python. Also, remember the UNIX philosophy: do one thing, but do it well. ;-)
Too bad. A simple GUI always makes things cleaner and faster to me.
NRGDEAD wrote:
April 11th, 2019, 5:23 am
And yes, that is an empty line that shouldn't be there as far as I know.
It's always there, although CU2 files are generated without it. I think it's a bug in the current version of System Console. Just try it out on your setup.
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 11th, 2019, 5:45 am

I'm not really good at coding. And one of the motivations for Cue2cu2 was to be able to do create the CU2 sheet from the command line. I use custom scripts around the DiscImageCreater from Redump.org and cdrdao to create my images on Linux, and having to use the System Console to create the CU2 sheet was always a little break in that workflow.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » April 11th, 2019, 6:00 am

No problem with the command line. I just thought a Linux version of System Console (at least the basic features) would be cool, but since it works on Wine (except for that annoying tooltip crash), I guess it's not really needed.
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » April 24th, 2019, 8:22 am

NRGDEAD wrote:
April 10th, 2019, 9:44 pm
Matt and Yuri, are the mentioned inconsistencies maybe a bug?
I have since confirmed with Matt that this is indeed a workaround and expected behavior. So compatibility mode stays as default.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » May 7th, 2019, 8:40 pm

NRGDEAD wrote:
April 24th, 2019, 8:22 am
NRGDEAD wrote:
April 10th, 2019, 9:44 pm
Matt and Yuri, are the mentioned inconsistencies maybe a bug?
I have since confirmed with Matt that this is indeed a workaround and expected behavior. So compatibility mode stays as default.
Can you please explain what is this workaround for? It is quite jarring to see different timecodes. For example, the .cue file for my Tomb Raider II dump has "Total 70:25:03 ", but the .cu2 file has "trk end 70:29:03".

4 seconds of difference in total. Isn't this throwing off the playback of audio tracks?
Last edited by Takehaniyasubiko on May 7th, 2019, 11:41 pm, edited 2 times in total.
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » May 7th, 2019, 10:11 pm

It seems to be an offset for or regarding lead-in and lead-out. Two seconds for each track start due to lead-in, and two additional seconds for at least (but I assume only) the last track's end due to lead-out.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » May 7th, 2019, 10:37 pm

NRGDEAD wrote:
May 7th, 2019, 10:11 pm
It seems to be an offset for or regarding lead-in and lead-out. Two seconds for each track start due to lead-in, and two additional seconds for at least (but I assume only) the last track's end due to lead-out.
Well, that explains the difference being so big with games like Tomb Raider II (61 tracks).
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » May 7th, 2019, 11:12 pm

I phrased that badly. It's two seconds for all track starts; they don't add up. When you compare a CU2 sheet to it's cue counterpart, you see the difference never changes. Except for the last track end, obviously, but that isn't even listed in the cue sheet.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » May 7th, 2019, 11:35 pm

NRGDEAD wrote:
May 7th, 2019, 11:12 pm
I phrased that badly. It's two seconds for all track starts; they don't add up. When you compare a CU2 sheet to it's cue counterpart, you see the difference never changes. Except for the last track end, obviously, but that isn't even listed in the cue sheet.
Timecodes from Redump:

Code: Select all

#	Type	Pregap	Length	Sectors	Size	CRC-32	MD5	SHA-1
1	Data/Mode 2	00:00:00	23:20:44	105044	247063488	22413e77	3355db5e7b5445b024f8c65992c45274	9b802ab619b84adb8ccfa74c8762cf78e276ad34
2	Audio	00:02:00	01:27:34	6559	15426768	aaddc00c	881af6b9fa293b296c015129ebf98d54	9594ff31790bf4f3f2ab32cd79f7713bc2bbedd5
3	Audio	00:02:00	01:56:25	8725	20521200	9b203a93	3212fa24750aacbd376343328e0d71f4	5784924da193bf2572427bfa286e07e8e2abd802
4	Audio	00:02:00	02:17:60	10335	24307920	1b2ec8bf	6447389168775a8d29f5b8ddf71880b3	ea7b60841623e544017948c64c6403fd373fb269
5	Audio	00:02:00	00:09:60	735	1728720	a24f9c12	c6e3bd5950494b640f59c61e0c1ad0da	b0fdbb17f81d11c884ef5388fc5b8bb8d43a0d91
6	Audio	00:02:00	00:08:72	672	1580544	f9e9787c	5d7e91c57fbc7411db963edb24e91529	8bb78772f3bacd7c48ef039143e1c68a904fc14d
7	Audio	00:02:00	00:07:01	526	1237152	de3f1c21	7443608ae0483e7605e0c4c0e0345d4d	62bc6549ff7ea4b23a0ac5e7170618fb647b0d44
8	Audio	00:02:00	00:07:02	527	1239504	0049ed29	93846e5c97fdcb496b5966452037545a	519419d1ba87385b5ac47474ee6daaa1e91b854f
9	Audio	00:02:00	00:08:00	600	1411200	bc64d271	745319b3eebd99bba08c17575d586ea4	d82046d1eefeb7eed91cd4a59226f39890d0a533
10	Audio	00:02:00	00:13:24	999	2349648	fbe68bc9	aeb8810bc0e37c6e9f21295a6db57566	bb8e8bc8faed2d2c51fa2918eb2f47d75d26e564
11	Audio	00:02:00	00:17:60	1335	3139920	d8e782b4	0b1c0fad72b1a9e3cad9e39c627d2f48	41f41bd267c6e29afd51630cc74ae23b02309053
12	Audio	00:02:00	00:10:38	788	1853376	b74214d7	8f649b8b2ac3ff8cf9a5ef75eec3a1c8	4c4522577aa22d0a23f10201a32f5617c74fadeb
13	Audio	00:02:00	00:11:09	834	1961568	8d3ce6f2	01ae3d7329bc0e02e7e0ac702ec5d29e	d4e82a44c4be0f4d854827a1ff331ed1b0842d1f
14	Audio	00:02:00	00:07:01	526	1237152	67eeac80	8ef90c542de4979f6964ea45ab4bff20	5a65603eccf464848d001d698643dbbe4216f874
15	Audio	00:02:00	00:07:01	526	1237152	ec67678c	009edeadbfee28d2b38c1851d067310b	f3d78c480808b5558d517ad7bbfa6a0468ddfc36
16	Audio	00:02:00	00:07:02	527	1239504	bf7113d6	28ef8b50bce2becb4494bc0bdbcf6cfa	d47e6ca5bc002843e9ec179218d1cab0acc2a115
17	Audio	00:02:00	00:11:02	827	1945104	1cc01cd5	be94b9f59ec914c5d939f22e20197fa8	2e5647fcdbe0eff62dc9769f9040f39296ec8aba
18	Audio	00:02:00	00:07:01	526	1237152	72255d2d	3fac19bdd3ccd52b0321a2b26d37d27b	f5bc07df1afb2700c1f48451ae344c3eeef4a7ed
19	Audio	00:02:00	00:07:01	526	1237152	e96a2eb2	d36ff28ac42be00f6eda7fbc472eeec0	bd4df2a6c0c712a6ff9530cfdcb335a6e3e0ca7a
20	Audio	00:02:00	00:07:01	526	1237152	41c1851a	ab48461343dd120eba7916c34897c878	dbd63fd5cc6ef4bf293d7971cb60d8b3a0d3829a
21	Audio	00:02:00	00:07:01	526	1237152	5c55fd7e	58cc1cad545310079e591f010152e7aa	c3c804724c9e48a395a0c6b5ce16948b99c7ad6b
22	Audio	00:02:00	00:07:01	526	1237152	c3da53f5	cf75a20d797798b7439d3d42143a6a00	bf03271cbef48da5cdaab1c8a2610d9a499dee24
23	Audio	00:02:00	00:18:49	1399	3290448	88754797	e011d4321a488ac194ed38702d51187d	7f8410ec5efe1f741f339f41de34b6a918267699
24	Audio	00:02:00	00:11:01	826	1942752	f5491bbe	37998dae723b1555b7dbdb9272375237	c981e5e0447c7237d904f90a52ddd6de2c46ad37
25	Audio	00:02:00	00:07:01	526	1237152	e5e71d00	4f3cbf9d4a70721564fb35d7f4091ac9	4b759c07dbd700c05cabef680400c8166aff2b18
26	Audio	00:02:00	00:53:65	4040	9502080	58662361	2c4fb36e42aaf9e66351007278f298e9	70decd1b14bbd825734296f039051913e9c29e4c
27	Audio	00:02:00	02:00:11	9011	21193872	28fd9c44	063b43125684b0e627da92b2a7a76fad	e37f8b87bb9f6bf5939975fe65a41ae350a92ebd
28	Audio	00:02:00	01:59:58	8983	21128016	dc5665da	613f41897f5fc4f07728382083a3b1df	280b6f63a11ab9dfafa860d12488869eae0c696a
29	Audio	00:02:00	02:48:34	12634	29715168	e752fd2c	07a5d3397bff39b2f621a6256d145ab5	0a6b0868789d2914e755fb929b0a6ece43e9910c
30	Audio	00:02:00	03:05:60	13935	32775120	b89eb1b7	65ccf50ed604d06fe1ac8a2d702ac1dc	61b59c7e67c584065d164236e0761c64438aff67
31	Audio	00:02:00	00:09:57	732	1721664	a295b216	7c9bbd7a7ba5afc30d478ab07e1d9a93	6e8fed46aea0fdfe9522ff2e578a725dd81c6f16
32	Audio	00:02:00	00:06:48	498	1171296	0c3caeb7	3d47e6c4076dfacc268510fc8d73059c	6d1b46bc823427af8b411b704bbbe0cbae27fd09
33	Audio	00:02:00	00:18:35	1385	3257520	4df31b88	54eba5d9538952e3d410330a332b67e6	66cbebd6d1d71e6905131c33890231a953470920
34	Audio	00:02:00	00:56:34	4234	9958368	8ac3d4a0	d73ac3ed207407d9f1d8b6b2d8cc1edd	fa88fac6013486654aa4803e621f6701546f03b0
35	Audio	00:02:00	00:21:66	1641	3859632	4048fc40	bfc646b9391b87b8dbb2f1335ebcb62e	4621cbfc50ef56112ed402ef3180da9ddbe1b00a
36	Audio	00:02:00	02:40:69	12069	28386288	c980d46c	4d88f6e35e93ef5f012ed9aba7934cbc	7d67c9ca5c6961f89d3e2beb1c6e0750923b7fbe
37	Audio	00:02:00	00:14:13	1063	2500176	f1292761	7536cc3dc65c9f016cd95c21b70d4f02	2b5893d36e5b21100fb9550307f934e3db83ffdc
38	Audio	00:02:00	00:13:32	1007	2368464	7b9c4815	0c2cb795b10c1d5a26af6741eed59d9a	5dae8401724fbd6600be88f4bd19ce860f96d559
39	Audio	00:02:00	00:16:63	1263	2970576	7e24fa22	a997b735454cb4889f884c68b0cf99f6	b328d58775419d2cf184a234fcd4ef15316e932a
40	Audio	00:02:00	00:19:63	1488	3499776	aee8e286	07662f901a12702ff98682983459c4fa	7235b3088d3de7846d2dabbf40808c9b90fe8c2e
41	Audio	00:02:00	01:01:06	4581	10774512	05f78a21	3786e64809acc6472325479cb914d5b3	2774ef9399d8b28ddbdc940f4d5b37e48ac4a804
42	Audio	00:02:00	00:35:30	2655	6244560	a2bf602e	89aa22829f76d57d7af14868b687f336	e08d2d2a98c2aaa05aa89ae3a7b2429f9b624b77
43	Audio	00:02:00	00:06:29	479	1126608	9eb27ee2	b2edf8975c1a66e106e89c1f018db155	13b5e6eec3ccb8e2b355efc90ff4183208855aa7
44	Audio	00:02:00	00:15:74	1199	2820048	c940b9dc	96a9d9e930e7528a4a9119fd3e26df39	37f259fb4d415a4b069fdcd2fb130b8c360a3e42
45	Audio	00:02:00	00:11:73	898	2112096	52068edb	397407bcd7e30809ddd7059749d85548	41f087850f372aa623630af2d50f483b1b12aa37
46	Audio	00:02:00	00:14:27	1077	2533104	94249f1a	c0eb0af863f792c2953702cc8687e532	1595740783b524ff83fd28b737f4d374fef4665f
47	Audio	00:02:00	00:10:33	783	1841616	97c9a533	9b6b726b2ffdc4da8cf50b031f30eda0	40bdff7857fb2b513f801968e06721b67735b130
48	Audio	00:02:00	02:45:08	12383	29124816	b92229d3	ca9be4d801b27caf31ff664251715292	8392ad37b9c102f2d8fbd2c9ec6c7e0415e61ef1
49	Audio	00:02:00	01:13:25	5500	12936000	ae4e84af	0466722e28022c551d24712d3f623989	be1c00d64aea6aad96004199e61daca6460fb6b9
50	Audio	00:02:00	00:09:47	722	1698144	59e836ae	2c5f2e3192efc10f3461f9413fc9a465	0145d1312f11819c3aa5e83b32a8e68859e07e6c
51	Audio	00:02:00	00:44:08	3308	7780416	a3e95e7b	0d4573214c30ca88bf87ec658062bc1c	82be0707687b2487fb38504ef2fd46ce1a4e6d8a
52	Audio	00:02:00	00:11:60	885	2081520	be09b35f	fd19890c153598a06afb515b8e54bbd1	c713ea05ffeef478eb58b2ad46b142b85af98823
53	Audio	00:02:00	00:51:06	3831	9010512	b79e3fab	7b9e60083aedd5ed0068f3b87c793861	d5dc983ff7cadd2cf41ad7678bd5053d7f682330
54	Audio	00:02:00	03:31:44	15869	37323888	fada1d3a	8112663bc77601d8a3f86aa1aba5f7f2	83fc907c6c74115756bdb89874d23dc8e7acfb19
55	Audio	00:02:00	03:31:57	15882	37354464	15797e41	6b95f72d279aa352f30c864d6bdb61e2	9f8c3e7a3cafdcc66ad4e84c0a751ce45a628659
56	Audio	00:02:00	01:47:53	8078	18999456	baa531cd	a29bd8224666ed8868524138312b2222	52bf44d3bf4f44d70383ae46b67ea8959649f10b
57	Audio	00:02:00	00:25:45	1920	4515840	ebf1623d	cae5eefc247f361919f38b1e368413c0	f30daff1774b3c6692b749c57a2849decd3b186d
58	Audio	00:02:00	00:23:49	1774	4172448	0fed4585	45c558e6072e0b10f36657ab3f882fa2	884c3bfe178e3df05ed2259c1ab18eb5c1131792
59	Audio	00:02:00	00:19:54	1479	3478608	4fcb03a1	4f8b716ea25cac93f17e36d435b8928e	bbfa24e35a6acfce438ab8c6c4da74a6b8dec33e
60	Audio	00:02:00	02:48:47	12647	29745744	977cdb5e	cbe8e549b5f7673d247f8dbe63cebabb	de47fa5bdc6679b3d2c46344297c7f81618b0913
61	Audio	00:02:00	00:19:54	1479	3478608	4fcb03a1	4f8b716ea25cac93f17e36d435b8928e	bbfa24e35a6acfce438ab8c6c4da74a6b8dec33e
	Total		70:25:03	316878	745297056	d14c0299		
Timecodes from the .cu2 file of the same image:

Code: Select all

ntracks 61
size      70:25:03
data1     00:02:00
track02   23:22:44
track03   24:50:03
track04   26:46:28
track05   29:04:13
track06   29:13:73
track07   29:22:70
track08   29:29:71
track09   29:36:73
track10   29:44:73
track11   29:58:22
track12   30:16:07
track13   30:26:45
track14   30:37:54
track15   30:44:55
track16   30:51:56
track17   30:58:58
track18   31:09:60
track19   31:16:61
track20   31:23:62
track21   31:30:63
track22   31:37:64
track23   31:44:65
track24   32:03:39
track25   32:14:40
track26   32:21:41
track27   33:15:31
track28   35:15:42
track29   37:15:25
track30   40:03:59
track31   43:09:44
track32   43:19:26
track33   43:25:74
track34   43:44:34
track35   44:40:68
track36   45:02:59
track37   47:43:53
track38   47:57:66
track39   48:11:23
track40   48:28:11
track41   48:47:74
track42   49:49:05
track43   50:24:35
track44   50:30:64
track45   50:46:63
track46   50:58:61
track47   51:13:13
track48   51:23:46
track49   54:08:54
track50   55:22:04
track51   55:31:51
track52   56:15:59
track53   56:27:44
track54   57:18:50
track55   60:50:19
track56   64:22:01
track57   66:09:54
track58   66:35:24
track59   66:58:73
track60   67:18:52
track61   70:07:24

trk end   70:29:03
So it seems that System Console simply adds 2 seconds of pregap to each track's timecode in the .cu2 file?

I still don't understand how come the total time is always different between .cu2 files and the database of redump.org. It's not always 4 seconds, too. Does it change because of varying lead-out times?
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » May 7th, 2019, 11:57 pm

It should be always +4 when compared to the original cue sheet. Both System Console and Cue2cu2 add 4 seconds in total to the track end. Technically, System Console does length + 2 +2 while Cue2cu2 does length + 4. Which doesn't matter in the end because the output files are identical. I haven't looked at what/how Redump provides in the table, as it wasn't necessary; you always work with what you have locally, be it Redump compatible or not.
Last edited by NRGDEAD on June 14th, 2020, 3:50 am, edited 1 time in total.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » May 8th, 2019, 12:10 am

NRGDEAD wrote:
May 7th, 2019, 11:57 pm
It should be always +4 when compared to the original cue sheet.
Well, it's not always four. For example, the total for Vagrant Story USA is 70:55:26, but the .cu2 for that image says 71:01:26. That would 6 seconds of difference.
Last edited by Takehaniyasubiko on May 8th, 2019, 12:26 am, edited 1 time in total.
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » May 8th, 2019, 12:26 am

Remember, we're not looking at what Redump says. "trk end" is calculated from the actual size of the image file + 4 seconds.

First, we get the raw file size and convert that to a cue sheet timecode.

Code: Select all

size = convert_sectors_to_timecode(convert_filesize_to_sectors(binaryfile))
And then we add 4 seconds to it before outputting it in compatibility mode.

Code: Select all

track_end = timecode_addition(size,"00:04:00")
...versus the non-compatibility mode that would just output the variable size as it is above.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » May 8th, 2019, 12:27 am

What worries me is that milliseconds match in total, but they don't seem to match per track. Did System Console merge them in a wrong order? Unless this is some weird timing code for miliseconds and it goes to 75, not 100?

Also, it's the Redump table that adds 2 seconds of pregap to each track, whereas System Console adds it only once at the beginning.
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

User avatar
NRGDEAD
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 939
Joined: September 22nd, 2017, 3:10 am
I am a: Noob
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by NRGDEAD » May 8th, 2019, 1:47 am

It's not milliseconds, it's sectors. Yes, there are only 75 per second. Each sector is 2352 bytes as per MODE2/2352.

CDs are weird.
Cue2cu2: A Python script for creating CU2 sheets via the command line on Linux/Mac/Windows.
GitHub / Forum

PSIO wallpaper template in Photoshop format.

User avatar
Takehaniyasubiko
/// CYBDYN SYSTEMS ELITE ///
/// CYBDYN SYSTEMS ELITE ///
Posts: 2250
Joined: March 13th, 2018, 5:04 am
PlayStation Model: SCPH-1002

Re: Cue2cu2: A Python script to create CU2 sheets

Post by Takehaniyasubiko » May 8th, 2019, 1:55 am

NRGDEAD wrote:
May 8th, 2019, 1:47 am
It's not milliseconds, it's sectors. Yes, there are only 75 per second. Each sector is 2352 bytes as per MODE2/2352.

CDs are weird.
I was going by this, where it's described as milliseconds. https://www.enfis.it/cue-splitter-tutorial/

But yeah, this is only XX, so I guess it's sectors, although that's so confusing to describe length with minutes, seconds, and sectors.

Everything matches with 75 sectors per second. I was getting paranoid with the recent issues people are having. I hope my SD card is prepared well.
Because we don't know when we will die, we get to think of life as an inexhaustible well. Yet everything happens only a certain number of times, and a very small number really. How many more times will you remember a certain afternoon of your childhood, an afternoon that is so deeply a part of your being that you can't even conceive of your life without it? Perhaps four, five times more, perhaps not even that.
― Paul Bowles

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests