Introducing seiri — a music 🎶 manager for lots of music.

TL;DR seiri is a lightweight music manager written (mostly) in Rust that helps keep huge music libraries organized. Try it today at chyyran.moe/seiri.

A couple of years ago, I uninstalled iTunes. Once upon a time, I had a (now ancient) iPod touch, and a huge collection of MP3 files. Even back then iTunes would slow to a crawl trying to sync even a thousand songs, and eventually my library outgrew the 32 gigabytes of storage I had in that little thing.

Even then, I kept using iTunes to manage my ever increasing collection. One thousand grew to two, two to five. But iTunes on Windows just doesn’t scale. I hadn’t used any Apple products for a good 3 or 4 years at this point except for iTunes, and purely for library management. I listened to music on my phone with Google Play Music’s excellent upload feature, and foobar2000 on my computer.

But every so often I would drag files over to the “Automatically Add to iTunes” folder after painstakingly tagging them with proper metadata and Album Art, and have to wait about 5 minutes as iTunes dragged my top of the line (at least back then) overclocked Haswell CPU to its knees, and did the simple task of moving some MP3 files to another folder. I of course could have done this myself, but it was a pain in the ass, and the 5 minutes it took for iTunes to finish its job and close it was almost worth it.

But then I decided to reconstitute my entire library of about 7000 tracks into lossless FLAC. The details of the various ways of how I went about that aside (rest assured, no lossy-to-lossy transcodes were involved), iTunes doesn’t support any form of lossless audio besides ALAC. Besides that iTunes doesn’t scale with any more than probably 50 albums! If all I’m using it is to move some files around, I can do a much better job than that. So I uninstalled iTunes.

Katatsuki

かた‐づ・く【片付く】
物が、置いておくのに適当な場所にきちんと納まる。散らかっていた物が整えられた状態になる。

A weekend later, I wrote something up called Katatsuki. It wasn’t really crafted with care or particularly well thought out, but it was faster than iTunes. Since I needed a simple GUI, I did everything in a language called C#, which made it really easy to quickly write up GUIs for Windows. Katatsuki really had two purposes.

  1. Emulate the “Automatically Add to iTunes” feature.
  2. Make a library of about 7 thousand songs quickly searchable, and identify songs that aren’t properly tagged, including poor quality cover art.

And you know what, it damn worked for the 2 or 3 days I spent on it. Sure it had to be restarted every so often, and sure there was no way to quit the app (you had to go into Task Manager), but I was the only one who cared anyways, and it sure as hell beat using iTunes.

katatsuki

I don’t like using Spotify, since I listen to a lot of weaboo music (同人音サイキョウ!) that’s not yet on, or never will be on Spotify, and I am meticulous about track metadata, down to requiring tracks be in their native script. Not only that, while I won’t pretend to be able to hear the differences between CBR 320kbps and lossless FLAC, it’s nice to have an archival copy of your entire library. Katatsuki helped me keep track of what tracks needed new cover art, what tracks were lossless or lossy, and what tracks were simply tagged wrong, after years of cruft piling up. Eventually I managed to finish acquiring lossless copies of most of my old lossy library, and continued to use Katatsuki for a few years as my music organizer.

As an aside, katadzuku means to tidy up something, essentially. Strictly speaking I should have named it Katadzuki, but the unvoiced tsu sounds better in English (in my opinion).

Rewrite it in Rust!

せい‐り【整理】
乱れた状態にあるものを整えて、きちんとすること。

I am extremely productive during finals. In fact, Snowflake, another one of my side projects, got worked on tons, when I was supposed to be studying!

So you know what, instead of studying for finals, why not rewrite Katatsuki in Rust, and fix some of its bugs in the process. Rust is known for being as fast as C++ while being much safer, and seiri is super fast. Searching for tracks in my library of 11000 songs feels snappy and immediate. Occasionally, Katatsuki would seize up when adding too many tracks, and have to be restarted. seiri’s Rust core handles tracks like a champ, all while using only 3MB of memory*.

As for the UI, seiri is built to be cross-platform. Electron has the easiest setup for cross-platform UIs, and I’m interested in hammering out the details of shipping an Electron application as well with Snowflake. I’m aware of the memory usage of running a full Chrome instance, and the UI is only required for searching tracks, so seiri only instantiates the browser process when you need it.

seiri’s Rust core only uses 3MB RAM, while the Electron background process uses only 40MB on idle.

Combining the technique of a lean core, and on-demand UI, seiri manages to use only about 45MB of memory total on idle, which is quite respectable for an Electron app. Also, it definitely beats iTunes.

foobar2000 uses 65MB of RAM.

How to use seiri

Tag, Sort, Play.

When you first start seiri, it’ll ask you where you want to put your music. I suggest you choose a folder separate from your existing library, and migrate over to letting seiri manage your library by backing up then moving your files over from their previous location.

seiri will automatically create an Automatically Add to Library folder next to your chosen folder, where you can drag and drop, or move files for seiri to automatically sort.

You can also create subfolders in the Automatically Add to Library folder. Any tracks that are found under a subfolder will also be found by seiri, and you will be able to search which tracks went into which subfolder using the Source column or bang (more on that later). Called “sources”, this is an easy way to keep track of where you got what music.

seiri was built for my workflow when adding new music, and encourages a similar practice of tagged music. You don’t necessarily have to do things the same way that I do, but there are a few ground rules that seiri enforces that encourage a similar workflow.

  1. Separate your tracks into different files. If you still use FLAC/CUE rips, seiri isn’t for you. seiri assumes one song per file, and FLAC/CUE rips are frankly a pain in the ass to deal with.
  2. seiri keeps your entire music library under one folder. I like to keep mine on a NAS that I keep backed up to Google Drive, but it can be anywhere you want, it just has to be under one folder. There is no way for seiri to keep track of files in multiple different locations. This music library “root” folder is automatically sorted by artist, then album order.
  3. Every track in your library must be properly tagged, with a minimum of Title, Album, Artist, and Album Artist tags. This prevents any “Unknown Artist/Unknown Album” tracks from sneaking in. Since WAV does not have native support for metadata, seiri simply refuses to accept WAV audio as a valid music file. Instead, use AIFF, which supports ID3 tags.
  4. If you include cover art with your songs, they must be stored as a tag. seiri only keeps track of music files, while any cover.jpg will simply be ignored.
  5. Let seiri do its job. Unlike iTunes, there is no “Consolidate Library” option. The only way to add files is through seiri‘s Automatically Add to Library folder, created along side the music library’s root folder. Once a song has been added, you may edit metadata as you normally would, or delete tracks, but do not manually move any files around. Instead, refresh the tracks in the UI to let seiri know you made a change, and the files need to be moved.

seiri has support for most music formats.

  • MP3
  • FLAC
  • AAC (M4A Audio)
  • Apple Lossless
  • Ogg Vorbis
  • Ogg Opus
  • AIFF
  • Monkey’s Audio

If you try to add formats that aren’t supported, or files with missing tags, they will be moved into a .notadded folder inside of the Automatically add to Library folder, for you to deal with later.

Lastly, remember that seiri only does Library Management. You’ll need to rely on another tool to tag, play, and backup your library. In my workflow, I recommend Picard and Mp3Tag for tagging, and foobar2000 for desktop playback. Instead of syncing music to your phone, I use Google Play Music to upload my library to the cloud, allowing me to listen to a lossy version of my entire library anywhere with internet access.

Bangs

seiri’s killer feature is how it makes your library easily queryable (at least when it comes to metadata) in the form of bangs. A bang query looks like this

!t{in the end}
Searches for songs with the title “in the end”.

You can also do a “full text search” query that looks for any track with a similar title, artist, or album title, by querying just a regular string

Linkin Park
Searches for any track with “Linkin Park” in its artist, title, and album fields.

Bangs can be grouped together and combined to get really specific.

!!{!ar{linkin park} & !al{hybrid theory}} | !t{in the end}
Searches for any tracks with the (artist “linkin park”, and the album title “hybrid theory”) or the title “in the end”. (parentheses for grouping)

Bangs are case insensitive, but upper cased bangs are case sensitive

!!{!AR{Linkin Park} & !AL{Hybrid Theory}} & !T{In The End}
Searches for any tracks with the (artist “Linkin Park”, and the album title “Hybrid Theory”) or the title “In The End”, in a case sensitive manner. (parentheses for grouping)

You can also look up the height and width of cover art, and the duration of a song.

!chlt{600} & !cwlt{600} & !dlt{3m30s}
Searches for songs with cover art height (strictly) less than 600px, cover art width (strictly) less than 600px,and duration (strictly) less than 3 minutes and 30 seconds.

For a full list of bangs, type ??bangs into seiri’s search interface.


A note on cross-platform support.

seiri relies on TagLibSharp, because the native C version of TagLib isn’t as fully featured. Using an experimental technology called CoreRT, TagLibSharp’s C# code is compiled into a native binary that can interface with Rust for speed. There is however a bug right now with CoreRT that makes seiri impossible to build on Linux. Until this issue is fixed, I can not provide Linux binaries.

As for macOS support, I don’t own a Mac, so I can’t build anything for macOS. If you’re a macOS user and want to use seiri, and are familiar with macOS development, let me know if you’re interested in being a macOS maintainer.