A simple tracklist generator

Tags: #<Tag:0x00007fe316c0d0e0> #<Tag:0x00007fe316c0cd98>

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 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 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.


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

1 Like

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 :slight_smile:.

1 Like

Maybe consider opening a seeded release (add) editor 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:

(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. :slight_smile: )


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.

It seems that you can use audio_properties.lengthInMilliseconds() instead of audio_properties.length(). :slight_smile:


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.

1 Like

This feature was added in 2015:

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

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


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

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

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.


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.