chemicalcain: a dog standing at a computer (computer)
cain ([personal profile] chemicalcain) wrote in [community profile] fancoded2023-06-29 12:49 am
Entry tags:

Proposing custom music metadata

Hey does anybody know stuff about audio track metadata?

I've had an idea rattling around in my head for a while but didn't have an easy and community-based way to organize my thoughts about it. So I am really pleased to see a DW fan coding community pop up! I not only welcome but plead for input on this concept:

I want to build a way to create custom tags on music files.

You know how you can sort by artist, album, year published, and all that, because those are categories embedded in ID3 metadata? I wish ID3 metadata allowed for custom categories. I want to be able to sort my music collection by color, mood, character, and fanfiction trope, to name a few. I think this has huge potential in being able to easily make playlists, fandom or otherwise, that flow smoothly and center around a common theme.

The core features I want for this custom tag metadata:

  • encoded in the audio files themselves (like ID3)
  • does not interfere with existing ID3 metadata (still able to be read by existing ID3-compatible software)
  • allows many custom tag slots (should limit it, for file size reasons, but I do want 10+ custom slots per track)
  • ideally compatible with ReplayGain or similar audio normalization metadata

The end goal would be to create a music player program that can auto-generate a playlist based on matching criteria from one song to the next (eg: selecting only songs tagged with colors, and playing them in rainbow order) but that is probably years away. Step one is metadata formatting & storage-- I should get a format structured and a few tracks set up before I try to make a program read and sort it, right?

My current questions:

  • Is there a way to access ID3 metadata as raw text, so I can inspect its current formatting? Or does it get encoded into computer gibberish and have to be processed into words through ID3-reading software? (I'm guessing the latter, but if you know of a program that would let me read it as raw text, let me know.)
  • Do you have any links or know of any resources to read on how exactly file metadata works? It's easy to get lost in Wikipedia's tall grasses.
  • Other than ID3, Vorbis comments, and other music metadata, what technologies should I try to become familiar with now while I'm in the early planning stages?
  • Are there any obvious issues or roadblocks that come to mind as you read through this concept?

Thanks all!

Mods, if you create tags that should be added to this, let me know.

bluedreaming: text: in pursuit of magic (pink toned image) (acme-graphics - in pursuit of magic)

[personal profile] bluedreaming 2023-06-29 12:22 pm (UTC)(link)
I’m afraid I don’t know anything about this but I really love the idea so much. I often associate songs with colours!
There’s a program I use for metadata (now mostly used for podfic) that lets me add custom fields; obviously this isn’t the scope of what you’re looking for but now I wonder if I’ll be able to add a colour field and corresponding column in windows explorer to sort by that field 🤔
bluedreaming: digital art of a person overlaid with blue, with ace-aro-agender buttons (Default)

[personal profile] bluedreaming 2023-07-06 03:47 pm (UTC)(link)
I can add the fields but windows won’t recognize them (and windows appears to have a color field but I can’t seem to add anything to the correct color field so that it shows up) so I’m afraid I’m not much help here; sorry about that! Hopefully some of the other suggestions panned out?
cmdonovann: self portrait (Default)

[personal profile] cmdonovann 2023-06-29 06:50 pm (UTC)(link)
ohohoho i forgot about this project idea. i'm mostly commenting so i don't lose this post, lol, so i don't really have any suggestions. it is a cool as fuck idea tho!
hojarasca: Natsume from My Little Monster, with a surprised expression on her face. (natsume)

[personal profile] hojarasca 2023-06-29 08:14 pm (UTC)(link)
  • I encourage you to not use MP3s to store your music going forward, both because it is worse sound quality (lol) and because ID3 is bad. However, ID3 does support a private frame (PRIV) which can be used to encode arbitrary metadata.

  • You can use kid3 to view and edit the metadata tags on most audio files and I highly recommend doing so. There is a handbook here.

  • If you want to get really serious about metadata, there is XMP which is built upon RDF. There is a mechanism for encoding XMP into MP3 and MP4 files (not sure about Vorbis but I expect so), although I wouldn’t expect most media players to recognize this data (they will just use the ID3/etc tags instead). It’s trivial to add your own properties to XMP (the X stands for “eXtensible”), but this is a big topic which probably involves a whole bunch of new concepts if you haven’t ever done this kind of metadata work before. Be prepared for a kind of steep learning curve if you decide to go this route.

hojarasca: Natsume from My Little Monster, with a surprised expression on her face. (natsume)

[personal profile] hojarasca 2023-06-29 10:05 pm (UTC)(link)

Personally? I use MP4, either with AAC (which is pretty broadly supported these days) or ALAC (Apple Lossless), but this is because I mostly only use Apple devices and those formats have broad support there. ALAC is the one which is less portable (although it is an open format, so support is growing); your other options for lossless audio are WAV (typically on Windows) or FLAC (typically on Linux), neither of which really have desirable metadata properties IMO. But IDK, don’t take my recommendations too seriously here; there aren’t any perfect solutions.

I’m happy to help talk you through some RDF concepts and point you towards relevant XMP stuff!! I haven’t worked too much with XMP in particular myself, but I have a lot of background knowledge in metadata more generally, and it’s a part of the ecosystem I wouldn’t mind being a bit more familiar with.

momijizukamori: Grey tabby cat with paws on keyboard and mouse. The text reads 'code cat is on the job', lolcats-style (CODE CAT)

[personal profile] momijizukamori 2023-06-29 10:10 pm (UTC)(link)
flac is a popular one among a lot of audiophiles - idk if there's more niche stuff out there (there probably is, haha).

I have only dug around in image metadata stuff, not audio, but in terms of resources, ExifTool has a truly insane level of documentation on metadata formats and file formats, and it looks like it's got some audio and video formats on top of about a million image formats.
silveradept: A kodama with a trombone. The trombone is playing music, even though it is held in a rest position (Default)

[personal profile] silveradept 2023-06-30 04:42 pm (UTC)(link)
You may be able to accomplish your goals from within the ID3 standard, if the tool you use outputs ID3 2.4.0 with the files, and supports the frames put forth in that version. I'm using this ID3 version comparison chart and its associated replication of a document detailing what frames are present in 2.4.0. For example, you could use the "mood" frame (TMOO) or the user defined text frame (TXXX) to put in the metadata that you want into the file, and then have the theoretical playlist-building program extract that frame and build playlists from the contents of those frames.

I haven't a clue how that is actually accomplished, or whether most of the ID3 tag editors implement all the possible frames into their ID3v2 tags, but that's a possible way of getting those tags into place without having to necessarily learn a completely different framework just to accomplish a goal. (If that's what you want to do, fabulous, go for it.)