An MP3 Metadata Minimiser

Herewith another small software tool that I built because I needed it, and because I couldn’t find anything that already addressed that need.

ID3Minimiser minimises and simplifies the ID3 metadata found in MP3 audio files. This is the information that describes attributes like the album name, track name, genre, track number, etc. Point ID3Minimiser at directories containing MP3 files and it will re-write the metadata to make it simpler. The use-case is older, non-software media players that don’t understand proper audio tagging practices.

My need for this was because my car, a Ford Fiesta, is equipped with a somewhat idiosyncratic navigation and media system called SYNC. And while SYNC is happy to play audio files on a USB flash drive that’s plugged into the car, it often doesn’t really understand what it is doing. Modern versions of SYNC might do better, but the v1.x system that my car has is still living 2018. Sometimes it might play the tracks in the right order, and sometimes it might not. Multiple genres confuse it, as do multiple artists. Give it files that define a disc number and total discs (the TPOS tag) and it will happily play track 1 from each disc in turn (often in some almost-random order), then all the track 2s, then all the track 3s, etc. Not what I want.

ID3Minimiser fixes this by batch-editing a copyof your audio files: collapsing the track ordering to use only the normal track numbering tag (TRCK), removing multiple genres, artists, etc., and renaming files so that that their sort-order corresponds to the intended track order. It also removes some unnecessary tags. It does what I need, and not a whole lot more.

Not many people will need this. Most people just stream music on their phone, or some other more capable device. But if, like me, you need it, then the repo and initial release are here.

TakeoutExtractor v1.2

I have just pushed v1.2 of my TakeoutExtractor app to github. This is a housekeeping release that updates the projects to .NET 9, the GUI to MAUI 9, and the tests to NUnit 3. There are no new features, and this is a source-only release. The repo is at https://github.com/andyjohnson0/TakeoutExtractor.

For background, the original announcement is here (albeit mixed-up with a digression on command-line parsing) and other posts can be found here.

Loss as the Price of Love

It is perhaps a truism that to love is to acknowledge the inevitability of loss. Either by time or circumstances, all that you love will be lost. People will change, depart, die, eventually become dust. Nothing lasts, and we will lose all that we love. But still we love anyway.

This has been on my mind recently, and I was struck by this quote from an author whom I hadn’t encountered before.

“Life will break you. Nobody can protect you from that, and living alone won’t either, for solitude will also break you with its yearning. You have to love. You have to feel. It is the reason you are here on earth. You are here to risk your heart. You are here to be swallowed up. And when it happens that you are broken, or betrayed, or left, or hurt, or death brushes near, let yourself sit by an apple tree and listen to the apples falling all around you in heaps, wasting their sweetness. Tell yourself that you tasted as many as you could.”

— From The Painted Drum by Louise Erdrich1

This morning, as I left for work, there were plump, ripe apples on the tree in the front garden of my house. A reminder not just of the start of autumn here in the northern hemisphere, but also that things of sustaining wonder can persist and recur over your whole life.

And, inevitably, a reminder too that sometimes that which is wonderful does not last — and can be taken from you, and be betrayed and ruined, and become forever lost.

Time is shorter than you remember.

  1. Via the wonderful Maria Popova ↩︎

Eigiau walk

After a weekend at Blaen y Nant I had time for a Sunday afternoon walk in the Carneddau— a circuit of the valley north of Llyn Eigiau taking in the two reservoirs near Dulyn bothy.

Having recently started a new job, I was thinking about this new stage in my life. And also, with the change in season, about a few people who are unfortunately no longer around. It was good to be out.

Some pictures:

Mountain landscape with lake, and open gate in foreground
Llyn Eigiau with Pen yr Helgi Du and Pen Llithrig y Wrach

Mountain landscape
Classic Carneddau landscape

Lake and mountains
Dulyn reservoir

Lanscape with standing stone
Near Dulyn reservoir, looking north-east

Wild ponies on mountain landscape
Wild Carneddau ponies

Landscape with trees
Looking north-east

Total distance was about 10km, with a nice mix of tracks and more open ground, plus a visit to the bothy and some wild Carneddau ponies. The start and end was the parking area at the roadhead near Llyn Eigiau. Here’s the route for anyone who is curious:

CPU Journey

The 6502 was the first CPU that I programmed1 in machine code — on my Vic-202 and on BBC Micros3 at school, back in the 80s. I wrote a few simple games for the Vic-20, mostly because its limited 3.5Kb memory made it hard to do anything in BASIC. On the BBC Micro I got a bit more ambitious and wrote something that I imagined was like a simple round-robin, cooperative multitasking scheduler. The cassette tapes containing that code will all be somewhere in a landfill site near Hull, whiling-away the time until entropy reduces the bits to noise.

Later I wrote some code for the Motorola 6809. And later still I used 68000 dev boards as an undergraduate. We had to upload assembly language to an honest-to-god minicomputer to be assembled to machine code before we could find out if the seven-segment LED display would do the right thing, or whatever it was.

(During an intern year at IBM I remember talking to an employee who was writing System/36 microcode to interface a transputer development board to a 3090 mainframe. Godlike stuff, and way beyond me.)

It’s been a while now, but I remember feeling that the 68000 was clearly powerful and elegant and a “proper CPU”, but also that I had little hope of understanding all the details of its operation. The 6502 was my first, and with hindsight was far less elegant with plenty of warts, but I felt at the time that I understood it pretty well. The 6809 was somewhere in-between, I guess, and a very nice CPU to work with.

As a professional developer I haven’t had to write a single line of machine code or assembly language these thirty-odd years. Maybe I should be glad. Even now, though, I try to think of computers as physical machines with physical characteristics and limits — even if the tools and developer experience try to convince me otherwise.

I’ve never thought about it before today, but I suppose I benefited from that early progression from 6502 to 6809 to 680004. Whether or not it makes sense as a journey nowadays, I couldn’t say.

  1. It occurs to me that we seldom talk about programming computers any more. We write code or apps, separated from the hardware. ↩︎
  2. Yes, machine code. The Vic-20 didn’t have a built-in assembler and, while I think I was aware that such as thing could theoretically be obtained somehow, I had no idea how to go about doing that. All I had was a monthly subscription to Commodore User magazine and my falling-apart copy of the Vic 20 Programmers Reference Guide. So I wrote-out the assembly language on paper and hand-converted it to machine code. Debugging was even more fun. ↩︎
  3. BBC Basic had a good, built-in, two-stage assembler. ↩︎
  4. I never got on with the Z80: that brash upstart /s ↩︎

Photos news

Herewith a housekeeping announcement about changes to the photo galleries on this site.

Prior to some time in November the photos at andyjohnson.uk/photos were served by an old installation of Lychee. Nice as Lychee is, I’d grown a little frustrated by the difficulties of uploading photos from my phone. I’d also, frankly, forgotten how to build Lychee on Windows — a problem, as I was intermittently aware that the installation was out of date.

So I retired Lychee and, for a while, brought the photos into WordPress and served them using a plug-in called Modula. This worked fairly well, and Modula is slick and pretty, but in the end I concluded that it wasn’t the best solution for a couple of reasons:

  1. Modula requires that all photos are stored in the WordPress media library, which lacks a way to group related images into albums. There are various plug-ins that provide a folder-like overlay on-top of the media library, but they don’t change the underlying organisation of the library. Without using some sort of naming file convention, it looked like it would be difficult to keep things organised.
  2. Modula is primarily designed for ecommerce sites that use images for product information. Its not a good fit for a personal photo gallery.

So I looked around at self-hostable photo gallery software that could run on the VPS that hosts this blog: basically a standard Linux/Apache/PHP virtual machine with only control panel and ftp access. And after a bit of research I decided to try Piwigo.

I’d looked at Piwigo several years ago but found it to be clunky and distinctly web 1.0-ish. In the years since it seems to have been successfully dragged into the JavaScript era, and now seemed quite snappy and pretty. It also has an updated Android uploader app. I decided to give it a go using Bootstrap Darkroom, which looked to be the most up-to-date of the various themes that Piwigo supports. I fairly quickly found that it did 90% of what I wanted, but the theme lacked some polish. Piwigo has a nice event-driven extensibility mechanism that allowed me to push this to 95% using just config tweaks, but the theme still lacked one thing I wanted: the ability to show the EXIF description or IPTC description metadata next to the image.

At this point I thought “hey, I’m a software developer – how hard can it be…” so I forked the repo. What I should have thought is “hey, I’m not a web developer – this will be hard…“. But I persevered and got properly familiar with npm and yarn and sass and PHP and VS Code, and dug into how to build the five year-old theme code with all its legacy dependencies… and it wasn’t easy. But I’m back now, battle-hardened and glad to be alive, and now I give you my Dark Aperture theme for Piwigo:

Dark Aperture theme screenshot
Dark Aperture theme example screenshot

It’s based on the Bootstrap Darkroom codebase, with a bunch of enhancements and fixes that are specific to my needs. I make no claims that it is useful to anyone else. My thanks to Thomas Kuther, who wrote the code that I merely adapted and tweaked

The theme’s name comes from Wide Aperture, which is the least-worst name I could come up with for the new Piwigo site running my new theme. I think it looks pretty good.

For the time-being the site has a few albums that are a subset of the photos that were on the old Lychee site. After I’ve recovered from all this webdev I’ll upload a better, wider selection.