How to denote gapless audio in a MusicBrainz Release entry?

If the question here isn’t about DJ-mixes/crossfades, but actually about silence between tracks, then the answer is a stronger “No” because
recordings with variations in the length of silence at either end of tracks are merged.

3 Likes

I don’t think how software rips the gaps is relevant to how the MB database stores information about a medium.

For me what’s more relevant is, is the information about the gaps on the CD’s themselves consistent and measurable. And as far as I know, yes?
Just based off EAC cue sheets, and how they’re considered accurate. Someone correct me if I’m wrong.

Non-CD media is in its own little universe in this regard I suppose.

Well the answer is yes but also no. On paper you simply read the Q subchannel of the CD and all this information is there in all its perfect digital glory.

Reality is more complicated of course. The problem is that we do this with PCs and PC CD-ROM drives are notoriously bad at reading any of this data from audio CDs without stupid errors, which is why EAC has multiple user-selectable modes for how this information is read from the disc, with multiple user-selectable “accuracy” settings. I’ve seen many bad rips over the years.

Quality checking this would be virtually impossible and given that this is useful mostly for compact disc players when actually playing a disc I still don’t really see why this information would be useful for a music encyclopedia? Without the rest of the rip, what would anyone even do with this information?

3 Likes

I think you cannot know, from any logs, if the CD is playing tracks continuously or not.
Whether INDEX 00 is placed 2 seconds prior to INDEX 01 or not, doesn’t change the fact that you won’t know if its content is silence or sound.

It’s just some information about the track content itself.
Like the genre or folksonomy tags, or like AcousticBrainz.

3 Likes

If I may sum up the discussion how I understand it: It’s structure of a CD vs. content of a CD. Which of these is MB striving to preserve?

3 Likes

Great discussion, everyone! But it’s going in lots of different directions, so it’s hard to reply to every comment. Here I’ll pull together a thead about: does metadata about inter-track gaps belong in MusicBrainz?

Thesis: the content of a CD or LP audio signal consists of tracks and inter-track gaps. They are different kinds of content. Artist Intent determines where the tracks start and stop, and whether there are inter-track gaps, and whether those gaps are silent or have audible content. Metadata describing the gaps is in scope for MusicBrainz. Having it would provide concrete, practical benefits for certain use cases. There ought to be an optional way of describing gaps as part of a Release entry.

What kind of Releases will find gap metadata significant? It is Releases where the Artist decided that the content of one track should follow the content of a preceding track with zero pause, seamlessly, so that for example a musical beat is not interrupted. There are several examples of such Releases in this thread. They tend to be concept albums, live recordings, opera, and classical music works (if much longer than pop songs). I’m willing to believe that gap metadata will not be significant for most Releases in MusicBrainz.

To clarify:

Crossfade (a Release where the Artist records a crossfade from one track into the next, but still labels the two tracks as different, rather than as one long track) is not my use case, but it is one of the use cases where the absence of an inter-track gap is significant information. (If my reference to an enhancement request about “Crossfade” in my first message confused the discussion, I apologise.)

I read this as evidence that the Artist and the CD player designers consider inter-track gaps to be a different kind of content than tracks. The Artist uses the CD format to indicate that the crowd noise (starts at INDEX=00) is not part of the track proper (which starts INDEX=01). The CD Player jumps to the start of the track proper (INDEX=01) when shuffling, but plays track, then inter-track gap, then next track, when in consecutive order.

I read this as more evidence that the CD format designers recognise inter-track gaps (from INDEX=0 to INDEX=1) as different from track content (from INDEX=1 to start of next TRACK). During the inter-track gap, the timestamps are negative. When jumping to a TRACK, the CD player goes to INDEX=1 instead of INDEX=0.

And note the use of that term “pregap”, because:

If someone rips a CD this way, then the CD’s “pregaps” become the music file’s “post-gaps”, and are attached to a different track. This says to me that they don’t belong to either track. It makes sense for MusicBrainz to describe them as entities separate from either track.

And, different rippers behave differently, and are configured differently. We should not base MusicBrainz handling of inter-track gaps on one way of using one ripper, to put gaps at the end of the previous track’s file. And, digital music files bought as digital media likely will not have silent gaps appended to the end.

I believe this is incorrect. The track length in the database is not defined as the length of audio in a digital music file. It is whatever length Picard uploads via a TOC file, or whatever length a user types in by reading a listing on the back cover of the Release, or from a web store’s listing. I expect only some, maybe none, of those values will include the duration of an inter-track gap. A user typing in a track length based on the audio duration of a ripped music file is probably a small fraction of the cases.

By the way, apparently Discogs agrees that inter-track gap duration is not part of the track.

I think this confuses Releases with Recordings. They are different. A Recording describes the contents of a Track, not of inter-track gaps. The Release has a tracklist with separate track durations from the durations of the linked recordings. Multiple Releases using the same Recording might all have different Track durations, for valid reasons. The inter-track gaps are a property of the Release’s medium, and won’t propagate to the Recording entities. And by the way, the fact that a Release (= Track contents) disregards silence at either end points to the inter-track gaps as being a different kind of content than the tracks.

The most useful metadata about inter-track gaps is: a) gap is absent, b) gap is present and silent, c) gap is present and has audible content, or d) no information about gap (the default). This is something which a human could determine with high reliability by just listening to the Release on CD or LP or cassette media.

It could also be determined by something like an enhanced libdiscid or Picard tagger, but I wouldn’t base a proposal for this metadata on an enhancement like this. It would be useful simply with human input on those Releases where gapless playback mattered to the Artist.

What about finding inter-track gap metadata from the Disc ID?

and,

This is a factual question. Someone could read the MusicBrainz server code which creates a Release Entry based on a Disc ID, and see if it is aware of inter-track gap information. But the answer appears to be “no”. The Disc ID Calculation article says the disc ID is based only on the CD’s internal track-start addresses, with no information about INDEX=0 or INDEX=1. And,

So, let’s assume that present mechanisms don’t provide any automated way to get information about inter-track gaps. The only way to enter it will be for editors to do so manually. That means that for the foreseeable future, inter-track gap metadata will be entered by humans, and only where it makes a difference. In addition to allowing metadata on inter-track gaps, MusicBrainz needs some reasonable default assumption about inter-track gaps in the absence of metadata, and absence will be the usual case.

I disagree with this view. The silence is an inter-track gap, a piece of content distinct from the tracks. Whether someone’s ripped file contains the silence is not a question for MusicBrainz metadata design.

That’s interesting Let’s think about the inter-track gaps of the LP medium for a moment. The gap before track 1 of an LP is probably silent by definition, because once the audio begins, we consider track 1 to begin. The gap between tracks has a physical purpose, to let the person operating the turntable see where to put the needle to play a specific track. And unlike a CD, an LP has a usable gap after the final track. It spirals into an inner self-connected groove. It is normally silent, but I have heard audio in this gap used for artistic effect by Monty Python and others. Metadata on inter-track gaps should be able to describe LP and other media, not just CDs.

I think it is still quite feasible to have simple metadata about whether inter-track gaps are present or absent between tracks of an LP. (I don’t know if it’s reasonable for an LP to have a gap with audio, because the gap is measured mostly by silence. One could look for the different colour of the groove in the gap, I suppose.)

What about storing gap metadata as an annotation, instead of as structured data?

and,

Yes, editors can put anything into a Release annotation, including gap metadata. But part of the value proposition is that gap metadata be visible to taggers, so that they can tag music files, so that players provide a gapless playback experience. Taggers cannot read annotations reliably. Thus, to deliver value, this metadata deserves to be structured in the database.

Because a) it is part of describing the Release fully, b) it advances MB’s mission of being the “ultimate source of music information”, and c) because it enables a useful listener feature: for the listener to hear the intertrack gaps intended by the Artist. Here’s the scenario: MB stores metadata that inter-track gaps are included or not included in the Release. A tagger uses this metadata to include or not include a “gapless” tag in digital audio files ripped from that Release. A player uses the “gapless” tag to either do special work to read in the next file before the previous file finishes playing, or to allow a gap. (Some players apparently do this special work for gapless playback all the time. But some need the tag: I’ll post separately about that.)

I think I know. The MP4 format defines a tag pgap, which Picard calls gapless. If present in a sequence of m4a files, the Apple iTunes player, when playing those files, provides a gapless listening experience. I just put this to use: the Release The Ship was authored with no inter-track gaps on either side of the LP. Apple Music supplied this album as *.m4a files without the pgap tag. iTunes played it with short, fractional-second but noticeable, gaps between tracks. When I used Picard to add gapless tags with value 1, iTunes played these files gaplessly, as the Artist intended.

No, I’m not going that far. The value of allowing metadata about inter-track gaps in MusicBrainz is primarily to let Picard add tags to music files for Releases that have no intertrack gaps, to encourage players to provide the correct gapless playback experience. This would be a simple enhancement for Picard. The feature you describe — having players add a small gap again — is possible, but it’s not the primary value is see from the metadata.

By the way, @outsidecontext, you gives a really good summary of the thread here. Thank you.

How gaps are ripped is not the concern of the MusicBrainz database. But inter-track gaps should be. These gaps exist on CD or LP medium because the Artist put them there. They exist whether the medium is ripped or not. And I argue it is in scope, and useful, for MusicBrainz to be able to store metadata about them.

Standalone CD or LP players are not part of the value proposition for this metadata. The Artist authored the medium with gaps, or without them, based on how those players play the audio continuously. Instead, taggers and players of digital music files are what benefit from this metadata — by letting the tagger pass on the metadata about the Artist’s desired playback experience, and by letting the player deliver that experience.

and,

I think this is the wrong way to frame the question. MusicBrainz "collects music metadata… [and] aims to be… The ultimate source of music information". Metadata describing structure of a CD is in scope. Metadata describing the content of a CD is also in scope.

For example, MusicBrainz has a way of noting which person was producer for a release, and whether two Releases re-use the same Recording. That is metadata about content, not about structure.

Whether you call inter-track gaps “structure” or “content”, metadata about them is in scope for MusicBrainz.

Interestingly, I can’t find anyplace where the MusicBrainz documentation specifies what the track length field means, or how to determine track length. It’s probably one of those things which is so apparently simple that it’s easy to overlook its hidden complexity.

Sorry this has turned out so long. Thank you for all the discussion.

Given all this discussion, I now am firmly of the opinion that metadata describing the inter-track gaps of Releases is in scope for MusicBrainz. Having it would provide concrete, practical benefits for certain use cases. There ought to be an optional way of describing gaps as part of a Release entry.

2 Likes

I can’t say I follow this reasoning. How does knowing how long CD pregaps are help you hear them as intended? Doesn’t that already happen when you put the CD in your CD player?

I think this scenario would benefit from a specific example of a track on MB, and a description of exactly what tags this information would be used to insert and exactly what effect that would have on real-world audio players.

MusicBrainz metadata is about digital music files played on a computer, not about CDs played in a CD player. Let me clarify my wording: “c) because it enables a useful listener feature: for the listener of digital per-track music files, on a music file player, to hear the absence of intertrack gaps — gapless playback — intended by the Artist.”

I think I answered this in my message above. From there:

Is that the sort of specific example you are looking for?

If there are no pregaps on the CD (other than the mandatory 2s track 1 pregap) then they certainly won’t be included in ripped audio files, so the nonexistent pregap audio will not be played, right? I’m still not getting why tracking CD timing information in MB helps playback.

If you rip the CD audio into separate files split according to the TOC track start timestamps, the result is that each track’s pregap gets appended to the previous track (and track 1 pregap would normally not be ripped at all so you probably don’t get HTOA). For sequential playback (starting from an arbitrary file) this is, for all practical purposes, the same as what you’d get from the real CD on a real CD player (starting from an arbitrary track).

Many formats such as flac can exactly represent the ripped CDDA structure via embedded cuesheets that include detailed track and index timestamps. I don’t use such files; TBH I’m not sure how much software exists that can actually simulate how a real CD player works when playing them.

I’m totally unfamiliar with this software, but this seems like an on/off thing and it does not seem like it would need any detailed timing information from the CD to set this tag? From your description, it seems to me that gaps or no gaps this tag needs to be set on any files that come from splitting a CD rip into 1-file-per-track in order for iTunes to play them correctly.

For Picard, since this tool only really supports tagging split tracks, this means that this tag should be set whenever the metadata indicates a CD audio track. I believe most if not all the needed information is already available to tagger scripts. I imagine something like $set(gapless,$ne($find(CD,%media%),)) (totally untested) should handle the vast majority of cases…

I’ll be honest, I think it’s been close to 2 decades since I’ve seen an audio player that failed to play ripped files back to back without delay. I thought this was a long-solved problem (obviously I am mistaken).

2 Likes

From what I know about CD I don’t agree.
CD are played continuously like cassettes.
There is no inter-track.
Everything is intra-track.
There are just markers (indexes) and the tracks themselves are also just markers placed on the continuous wave of sound (that can contain silence in whatever places but obviously often around the track markers, often between indexes 0 and 1.

I have authored myself such seamless play audio CD.

So really I don’t believe we should add the burden of gap management in MusicBrainz other than using disambiguation comments to prevent merging recordings that are not the same (additional silence at the beginning or ending is not a difference).

1 Like

No, wrong. Many players, including the iTunes player I observed in my example, will leave a gap of a fraction of a second between tracks, unless the track has a metadata tag which tells the iTunes player to make the transition between tracks seamless.

When I say the player leaves a “gap”, I don’t mean something as long as a 2-second silent pause. I mean a fraction of a second, maybe 0.2 seconds. That is less than the conventional silence between tracks of a pop album, but long enough for the listener to hear a gap in the audience cheering, or a break in the music playing through from one track to another.

Again, not in my experience, with my players. The players I know insert a pause of a fraction of a second. Perhaps they are closing one music file and opening the other. So the practical use case is more about getting the music player to reduce a short break in audio to zero break, than about getting silence to exactly the right length.

And remember, not everyone rips files the way you indicate, with silence appended to the end of the previous track’s audio.

So it sounds like you are suggesting a workaround, to set a tag indicating that an album has no inter-track gaps, for every digital music file, even for albums which do have inter-track gaps. That’s an interesting hack. But it is not as clean as setting the tag only for those digital music files where it corresponds to the reality of the original album.

It may be that part of the difference is that we are operating on different definitions of “without delay”. Maybe you are disregarding a brief pause of perhaps 0.2 seconds? Maybe you aren’t testing with albums that have continuous through-playing music, where you might really notice a gap in the rhythm, or a hiccup in the middle of crowd cheers?

I agree with you that the audio signal on a CD is continuous, like an LP or a cassette tape. And I agree with you that the CD has a Table of Contents that has addresses to that continuous audio signal. And I agree that the Table of Contents uses the terms “Track” and “Index”.

But I think we might be getting tangled in the difference between meaning of the word “track”. There is one meaning, as understood by Artists making albums and fans listening to albums. That is, the “track” is the part with audible sound, and the “gap” is silence between the audible sound. The silence is not the “track”, it separates tracks. Then there is a second meaning, as understood by people reading the CD format specifications and using fancy ripping software. There, every second audio on the CD is part of a “track” in the TOC.

Do you agree that Artists and mastering pros treat the audio content between index 0 and 1 within a CD TOC’s “track” differently than the other audio content? For instance, when you tell a physical CD player to go to the “start of a track”, it goes to the address of index 1, not the address of index 0? Doesn’t that indicate to you that CD player treats the content between indexes 0 and 1 differently?

I am advocating that we add metadata to describe the common-sense, listener meaning of “track” and “gap”. I’m not talking about the technical CD TOC meaning of “track”. Especially, I am in favour of a way of saying with metadata, “there is no gap here”.

1 Like

There is no such thing as an inter-track gap on an audio CD. There is only the pregap which is at the beginning of the tracks (called pause in the compact disc specification). Pregap is optional for all tracks except the first, as are all subdivisions/indices beyond 01. When ripping a CD everything should be included in the ripped audio somewhere.

I drew a picture with some made up numbers, maybe this helps to show the structure:

Edit: on review, I think I have the disc timestamp row wrong in the diagram, looking at the spec it looks like it should start counting up from 0 right from the start of the track 1 pause/pregap, so add 2s to all the timestamps on the top row.

I think it is accurate to say that all split-out tracks ripped from an audio CD must have this gapless tag in order for your player to work correctly, without exception. In no cases should the player add any silence or delay between ripped CD tracks if the goal is to reproduce an actual CD listening experience.

By without delay I mean literally zero delay, i.e., what you are calling “gapless”.

3 Likes

Escuse me if I’m oversimplifying again, but the discussion also seems to be audio vs. music. All music is audio, but not all audio is music. The database is still called MusicBrainz, not AudioBrainz :slight_smile:

Yes, “All music is audio, but not all audio is music”. But I think that is not relevant. All this discussion concerns music Releases, e.g. The Ship, Dark Side of the Moon, most complete operas like Tristan und Isolde.

2 Likes

Please see my reply to @jesus2099 about the multiple meanings of “track” between ordinary listeners and the technical CD specification. When I say “track” and “gap”, I mean as ordinary listeners understand these terms.

I am familiar with the technical CD structure and its terms “track” and “index”. Note that CD players, and people mastering CDs, treat the sound between index=0 and index=1 specially. That is the part of the audio which I am calling “gap”.

This thread is already on lots of tangents… so off down a rabbit hole the OP has picked on :wink:

I have just been doing work on a strange compilation CD. It consisted of a bootlegger lifting lots of Album tracks. He then chopped the gaps from the ends of the tracks. And then trimmed the tracks agressivly by removing many intros and outros of the actual music. He was making a gapless release of tracks that originally had gaps between them, squeezing more onto one CD-R.

Playback of the rips of the original album had gaps between tracks. Playback of his compilation had music piled on top of music with barely any space between end of one and start of the next.

Due to this research I was listening to both tracks being played at the same time and then directly comparing times on my copies of VLC/Audacity and the MB database. This is why I was pointing to the gaps being in the ripped recordings. And it is these ripped recording times that get uploaded.

In this case I was also working from discIDs too. It was due to variations between the recordings and the original discIDs I dived into this. The discID times are the same ones as you see on your media player. These are the lengths of the rips that EAC produces.

As noted with your earlier links, this is showing the problem lies with your source and choice of media player. You should nag Apple Music to sell you the music in the format the artist intended. This is not data that MB should be storing to make up for the failings in the source data.

Buy CDs, rip with EAC, playback with a decent media player and you will get your gapless perfection. I know that’s what I do with very little effort. (And I have far too many gapless albums)

As repeated by many other people above - look at using a better media player. iTunes and Apple Music are the faults here. :slight_smile: Geek software written by music geeks always handles things like Gapless better than a Mega-Company seller like Apple.

1 Like

I am still curious as to how you suggest this data is retrieved. The only accurate way I can see of doing it is for every editor to upload their tracks into Audacity and then note the length of the gaps. A stopwatch is not going to be accurate enough to record the differing lengths of the gaps, and as pointed out above by @draconx there is nothing in the discID that actually notes the lengths of these gaps. The times in a discID used by MB includes the gap or lack of gap as part of the track length.

Being the kind of mad \ curious geek I am I’m about to reload a few tracks into Audactiy and double check the gaps at the ends, then compare to DiscIDs TOCs. just to double check my post above. :stuck_out_tongue_winking_eye: :nerd_face:

Just for the sake of the argument: When ripped correctly in EAC wih cuesheet, the gaps should be visible in the cuesheet, IMHO.

2 Likes

Following my earlier post, I have been throwing a few tracks of an example album into Audacity to look at the gaps at the ends. The FLAC lengths are the same as the TOC lengths. And this example album (nsfw) is an interesting one as all the gaps are of differing lengths, and sometimes there is no gap due to all kinds of extra samples and content between the songs.

Just that one random example shows you can’t have a “per release” setting for “gapless”. And every gap is a different length. Also when is a gap a gap or just a quieter section?

Rip accurately. Problem solved.

Edited to add: Argh! CUE Sheets :exploding_head: I was about to fire up EAC to generate a CUE sheet, and then remembered last time I looked at this. So instead I now run away and leave you with a help page on EAC and Gaps https://wiki.hydrogenaud.io/index.php?title=EAC_Gap_Settings

1 Like