# A simple tracklist generator

**URL:** https://community.metabrainz.org/t/a-simple-tracklist-generator/438839
**Category:** MusicBrainz
**Tags:** tools, musicbrainz
**Created:** [August 9, 2019, 3:08pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839 "2019-08-09T15:08:30Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [August 9, 2019, 3:08pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/1 "2019-08-09T15:08:30Z")

</div>

Hello all,

I have been wanting to learn the Ruby programming language for some time, and I needed a way to generate a tracklist on my Linux/OS X machines in my terminal. I created the Ruby gem [track\_list](https://rubygems.org/gems/track_list) as a hobby project to learn the language and also make me more productive on MusicBrainz. You can customize the output of your tracklist as well. Please see the instructions at [my GitLab repo](https://gitlab.com/DomenicF/track_list/blob/master/README.md) if you are interested in trying this program out. And if you need help, please ask.

Please note that I am sure that there are better tools out there to get the job done, but I wanted a simple and fast way of getting a tracklist while I manually added metadata to MusicBrainz. If you have any suggestions or run into any issues, please let me know. Thanks for reading.

---

<div class="post-metadata">

### Author: ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)
#### Post date: [August 9, 2019, 3:23pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/2 "2019-08-09T15:23:11Z")

</div>

Hello Retro,  
It reads some media file (mp3, flac) tags?

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [August 9, 2019, 3:24pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/3 "2019-08-09T15:24:26Z")

</div>

Yes, exactly! It can currently read track, title, length, artist, album, year, genre, and comment. I plan to extend this in the future if needed, but that should be more than enough for generating a tracklist 🙂.

---

<div class="post-metadata">

### Author: ![Freso](https://community.metabrainz.org/user_avatar/community.metabrainz.org/freso/32/25_2.png) [@Freso](https://community.metabrainz.org/u/Freso)
#### Post date: [August 10, 2019, 6:07pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/4 "2019-08-10T18:07:55Z")

</div>

Maybe consider opening a [seeded release (add) editor](https://musicbrainz.org/doc/Development/Release_Editor_Seeding) instead of “just” making a text blurb for the track list parser? This would enable you to submit track lengths with millisecond accuracy instead of “just” second accuracy. It would also likely reduce a fair amount of typing as it could also handle adding the release title and the release artist and would remove the need for copying and pasting the track list blurb at all as well.

You can see an example implementation of this (in Python) here:

> <https://github.com/metabrainz/picard-plugins/blob/2.0/plugins/addrelease/addrelease.py>

(Of course, this will only work easily for new releases, so if you use your script for editing existing ones, then feel free to disregard this. 🙂 )

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [August 12, 2019, 6:48am UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/5 "2019-08-12T06:48:55Z")

</div>

I will look into making a seeded release editor, however, I don’t know if millisecond accuracy will be possible, at least with the library that I’m using for getting audio file information.

---

<div class="post-metadata">

### Author: ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)
#### Post date: [August 12, 2019, 8:53am UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/6 "2019-08-12T08:53:24Z")

</div>

It seems that you can use [`audio_properties.lengthInMilliseconds()`](https://taglib.org/api/classTagLib_1_1AudioProperties.html#a5321c07c5e4eb0bfc0f33c12a6584dfe) instead of `audio_properties.length()`. 🙂

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [December 31, 2019, 9:23am UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/7 "2019-12-31T09:23:29Z")

</div>

Sorry for the late response on this, it’s been a seriously messed up few months lol. I have tried using that lengthInMilliseconds method but it seems like it’s not actually implemented, maybe the dev started it then forgot about it or something I don’t know. I will try and figure out a way to just convert it to MS.

Edit: Tried to convert directly to MS, seems like it’s rounding which I should have expected obviously. I’ll check out the library’s source code.

---

<div class="post-metadata">

### Author: ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)
#### Post date: [December 31, 2019, 12:02pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/8 "2019-12-31T12:02:11Z")

</div>

This feature was added in 2015:

> <https://github.com/taglib/taglib/pull/506>

I don’t see any open issue about **lengthInMilliseconds** , yet:

> **[taglib/taglib](https://github.com/taglib/taglib/issues?q=lengthInMilliseconds%20is%3Aopen)**
>
> TagLib Audio Meta-Data Library. Contribute to taglib/taglib development by creating an account on GitHub.

Check if you have a recent version of TagLib, maybe.

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [December 31, 2019, 2:02pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/9 "2019-12-31T14:02:43Z")

</div>

I believe it’s not implemented in the Ruby library, I looked through the source code and I only found it referenced here: [https://github.com/robinst/taglib-ruby/blob/master/ext/taglib\_base/taglib\_base\_wrap.cxx#L2819](https://github.com/robinst/taglib-ruby/blob/master/ext/taglib_base/taglib_base_wrap.cxx#L2819)

I tried directly calling it like I call length and it has a method not found error: `undefined method `length_in_milliseconds' for #<TagLib::AudioProperties:0x00005643fb4c07a8> (NoMethodError)`

The docs in the Ruby library also do not have it referenced: [https://rubydoc.info/gems/taglib-ruby/TagLib/AudioProperties](https://rubydoc.info/gems/taglib-ruby/TagLib/AudioProperties)

I will create an issue on their GitHub page, maybe I’m doing something wrong but it looks like the Ruby library just doesn’t implement it.

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [December 31, 2019, 2:27pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/10 "2019-12-31T14:27:41Z")

</div>

Actually I take that back, it looks like the developers of that Ruby library just haven’t pushed their code to Ruby Gems. I got it to work locally with a build I compiled. I’ll try and get in touch with them.

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [July 28, 2022, 10:26pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/11 "2022-07-28T22:26:30Z")

</div>

@jesus2099 finally added it in v0.3.0 😅

> **[Domenic Fiore / track\_list · GitLab](https://gitlab.com/DomenicF/track_list)**
>
> GitLab.com

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [July 29, 2022, 9:04pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/12 "2022-07-29T21:04:47Z")

</div>

I know this is 4 posts in a row here but I forgot to ask this: @jesus2099 or @Freso, how do I actually use milliseconds when adding a track list to MB?

---

<div class="post-metadata">

### Author: ![rdswift](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rdswift/32/7032_2.png) [@rdswift](https://community.metabrainz.org/u/rdswift)
#### Post date: [July 29, 2022, 10:03pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/13 "2022-07-29T22:03:14Z")

</div>

I may be mistaken, but I think the only way is by attaching a disc id to a release. I don’t think that you can enter them manually.

---

<div class="post-metadata">

### Author: ![kellnerd](https://community.metabrainz.org/user_avatar/community.metabrainz.org/kellnerd/32/66963_2.png) [@kellnerd](https://community.metabrainz.org/u/kellnerd)
#### Post date: [July 29, 2022, 10:21pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/14 "2022-07-29T22:21:06Z")

</div>

> [@rdswift](#):
>
> I think the only way is by attaching a disc id to a release.

The other way is release editor seeding which has already been suggested:

> [@Freso](#):
>
> Maybe consider opening a [seeded release (add) editor](https://musicbrainz.org/doc/Development/Release_Editor_Seeding) instead of “just” making a text blurb for the track list parser? This would enable you to submit track lengths with millisecond accuracy instead of “just” second accuracy.

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [July 31, 2022, 8:08am UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/15 "2022-07-31T08:08:34Z")

</div>

Thanks for the reminder! I can’t believe I forgot the entire context to why I was doing this, haha. Alright, I’ll look into making a seeder.

---

<div class="post-metadata">

### Author: ![RetroPunk](https://community.metabrainz.org/user_avatar/community.metabrainz.org/retropunk/32/41102_2.png) [@RetroPunk](https://community.metabrainz.org/u/RetroPunk)
#### Post date: [July 9, 2024, 10:43pm UTC](https://community.metabrainz.org/t/a-simple-tracklist-generator/438839/16 "2024-07-09T22:43:10Z")

</div>

If anyone other than me still uses this, I am rewriting it in Rust. The taglib Ruby wrapper isn’t compiling for me on Arch anymore and I did not want to deal with it so I figured this would be a good excuse to dive into Rust.

It’s very preliminary and the format options are missing so far but it works for quickly copying and pasting track list’s to MusicBrainz.

Binaries released for Linux and Windows. Repository URL: [DomenicF/tracklist-rs: Output MusicBrainz pastable tracklist given a directory of audio files. - Codeberg.org](https://codeberg.org/DomenicF/tracklist-rs)

Thanks for reading 🙂
