A simple tracklist generator

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.

7 Likes

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: )

5 Likes

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:

4 Likes

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.

3 Likes

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.

2 Likes

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.

2 Likes

@jesus2099 finally added it in v0.3.0 :sweat_smile:

2 Likes

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?

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.

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

4 Likes

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.