The following is a summary of my thoughts about track grouping discussed on irc today:
hawke_1 offers an interesting alternative idea, which I will not further consider in the proposal below, but I will link to it for completeness: http://chatlogs.musicbrainz.org/musicbrainz/2012/2012-01/2012-01-13.html#T17-24-48-162101
Tracks are grouped for various reasons in the real world, this proposal attempts to provide a general purpose solution for all such groupings.
Some obvious groupings are the sides of a medium, or a group of tracks which together have been given a title and may form a work.
Music for the Jilted Generation
Let's start with a simple example: http://www.discogs.com/viewimages?release=6526
The final three tracks are grouped together and given a title, "The Narcotic Suite". All CD versions of this release have the final three tracks split up, it is merely a title given to a group of tracks/recordings.
If you look at the backcover of Enigma's "MCMXCD a.D." you would probably think track II is called "Principles of Lust", and the track has three parts. In practice it turns out there are versions of the CD where the track is split up in three parts, and versions where it is not. http://www.discogs.com/viewimages?release=35912
We have both kinds of editions of this release in the database, some have the tracks split up, and some don't. One of the cricicsms often levelled at musicbrainz is that musicbrainz is too focused on tagging mp3 files. There should not be a 1:1 mapping of recording entities to audio files. We should be able to split up the recordings for all these editions into the seperate parts, and then merge the duplicates, so we do not have duplicate entries in the database for these recordings.
Der Ring Des Nibelungen
The ring is a good example of nested groups of works. It is a collection of four opera's, intended to be performed in sequence on four sperate days. Each opera has several acts, and each act has several scenes. It is typically released on CD using two discs for the first opera, and three for the subsequent opera's.
Note that in this particular version, http://www.discogs.com/release/1002838 , scene 3 starts on the first disc and ends on the second disc. A group of tracks therefore has to support starting and ending at arbitrary points on different mediums.
Nirvana's nevermind ( http://musicbrainz.org/release/b52a8f31-b5ab-34e9-92f4-f5b7110220f0 ) is one of the canonical examples of a CD with a "hidden" track. The final song on the CD is followed by a certain amount of silence, and then followed by another song -- all within a single track. Because of the 1:1 mapping of recording -> audio file, we have recording entries in the database for these [song / silence / hidden song] tracks which really should be split up in three separate recordings.
I suggest we solve this by having a seperate track group take the place of the CD track -- it signifies that a particular sequence of recordings are typically stored in a single audio file. If the medium has a CDTOC, a track grouping can take the place of a proper track for the purposes of enforcing a duration.
Track groups would be a new first class entity, which are directly linked to a release. A track group link to a work (is a release of?).
The table would look like this:
(id, gid, release_id, type, start_medium_pos, start_track_pos, end_medium_pos, end_track_pos, name)
Alternatively, I can imagine using medium and/or track ids instead of positions, or referring to tracklists instead of mediums.
A release can have multiple overlapping track groups. Each track group has a type which indicates what kind of group it is, we shoud at least have the following types:
- audio file, indicates to a tagger program that this group of tracks are typically stored in a single audio file. It may wont to split up these files when tagging, or incorporate all the track names in a single tag. If the release has a CDTOC this group of tracks is actually a single track on the CD.
- side, indicates this group of tracks is the side of a medium. the name should be something like "A", "AA", "B", etc.. (perhaps with a subtitle if applicable).
- other, any other grouping, these groups should have a name like "the narcotic suite", "act 2", "scene 1", etc..
For the "other" type a hierarchy is implied by having groups like "act 2" entirely overlap smaller groups like "scene 1".
[perhaps type should be a bit field, so that a track grouping can be both the side of a medium and an audio file]