Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Read ISRC from .cue files #42

Open
Hawke opened this issue Jan 10, 2013 · 15 comments
Open

Feature request: Read ISRC from .cue files #42

Hawke opened this issue Jan 10, 2013 · 15 comments
Labels

Comments

@Hawke
Copy link

Hawke commented Jan 10, 2013

It would be handy if isrcsubmit could read/submit ISRCs from .cue files which include them.

@JonnyJD
Copy link
Owner

JonnyJD commented Jan 11, 2013

Parsing ISRCs from cue sheets is not a big deal.

The problem is getting the Disc ID from the cuesheet. The official library (libdiscid) does only support creating these from physical discs.
It might be possible to calculate the disc id with the track times, but that might also be out of scope for the script and error-prone. (quite easy in general, but there are some pitfalls). There are possibly also bugs/problems that led to a wrong cuesheet (i.e. problems with data tracks).

On the pro side: cuesheets are somewhat widespread.

Do you have many cuesheets lying around?

@JonnyJD
Copy link
Owner

JonnyJD commented Jan 11, 2013

The calculation is defined in http://musicbrainz.org/doc/Disc_ID_Calculation

This would need a couple of tests, that the resulting ids are the same using libdiscid (the reference) and our implementation.

@Hawke
Copy link
Author

Hawke commented Jan 11, 2013

I tend to have cue sheets + EAC logs (the latter is sufficient to generate a discID of course). Is it necessary to have a discID to submit ISRCs?

@JonnyJD
Copy link
Owner

JonnyJD commented Jan 11, 2013

Technically ISRCs are a property of recordings and submission works over tracks entities.
However, how would you match to the correct recording or release where this recording is attached to?

You could provide the release mbid or recording mbid at the command line,
but when you are that far, adding more code to your own script (that gathers this information) might be a better option.

Searching with the artist/title/track information from the cuesheet (if present) and then giving a choice is an option, but not the first.

I also want to note, that this won't be fully automatic.
You will be given a choice which is the correct release quite often (for popular releases) and then it is better to have the disc/case at hand to check for barcodes and release dates. (though the correct release dates are not the same as production dates at the cover)
Again, if you need the disc/case anyways..

I will see if I can add disc id calculation when I have time, but this isn't high priority.

@JonnyJD
Copy link
Owner

JonnyJD commented Jan 11, 2013

By the way, if you do want to create a script for your use case, isrcsubmit-cdrdao (ngs) might be a better start.
That script uses a newer musicbrainz backend, reading a cdrdao toc is very similar to reading a cue sheet and it doesn't include much code you don't need :-)

However, that script also is missing the matching part from the cue to the recordings/releases.
You might want to try and extract mbids from the actual files (which would be much better in your case).

@JonnyJD
Copy link
Owner

JonnyJD commented Jan 11, 2013

Another thing to note:

libdiscid itself includes a function that calculates a disc id when given the offsets (from a toc/cue):
https://github.com/metabrainz/libdiscid/blob/master/include/discid/discid.h

It's just that the python library I am using (python-musicbrainz2) doesn't expose this interface in any way.
Again, isrcsubmit 2 should use another musicbrainz library which should export this interface.

@JonnyJD
Copy link
Owner

JonnyJD commented Jan 11, 2013

I started a libdiscid python binding:
https://github.com/JonnyJD/python-discid

When that binding is done, calculating the disc id should only be a couple of lines in isrcsubmit.

@JonnyJD
Copy link
Owner

JonnyJD commented Feb 22, 2013

@kepstin indicated in #musicbrainz
that cue files alone are not enough for disc IDs (missing overall length)

There is a C library to wrap CUE+WAV and other formats:
http://cdemu.sourceforge.net/pkg_libmirage.php

Kepstin also has a library that might already help you (uses libdiscid and libmirage):
http://www.kepstin.ca/projects/image-id

@kepstin
Copy link

kepstin commented Feb 22, 2013

It might be possible to add ISRC reading in my tool via the libmirage interfaces, I might take a look at that at some point. Opened kepstin/image-id#1 for this.

@JonnyJD
Copy link
Owner

JonnyJD commented Jul 4, 2013

image-id does have ISRC output now.
Isrcsubmit version 2 can possibly support submitting from cue files with the help of image-id.

My current idea would be to haven an --image parameter that, if given an image file, would get ID and ISRCs from the image-id output, store this in some Disc object (or similar?) and then go on asking which MB release should be chosen.

@kepstin
Copy link

kepstin commented Jul 4, 2013

I plan to make an actual release of image-id shortly, so you can have a version to refer to in docs, etc.

@JonnyJD
Copy link
Owner

JonnyJD commented Jul 25, 2013

image-id 1.0.1 is released now. I'll implement this when I have some time.

@JonnyJD
Copy link
Owner

JonnyJD commented Nov 16, 2013

@LordSputnik implemented a small script that submits ISRCs from cue files to musicbrainz.
The mbid/discid isn't yet found/calculated. That part could be done with the help of @kepstin's http://www.kepstin.ca/projects/image-id.

@JonnyJD
Copy link
Owner

JonnyJD commented Nov 16, 2013

Not really sure if I can implement this for 2.0. I'll see.
I do take patches though ;-)

@JonnyJD
Copy link
Owner

JonnyJD commented Dec 2, 2013

Still planned, but moved to 2.1.x, so I am hopefully able to release version 2 soon, since I already wanted to do that a long time ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants