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.

Emulate the “Automatically Add to iTunes” feature. 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.