Carolyn plays in a couple of amateur jazz bands. We’re fortunate in BC to have fairly low COVID case numbers, so socially distanced practice sessions have started up again, and the bands have been choosing new songs to work on.

To find sheet music, jazz musicians invariably have a collection of dodgy PDFs called “fakebooks.” For some arcane reason, many of these are titled “Realbook Vol. N.” In any case, these PDFs contain transcriptions of a variety of jazz standards, and are usually scans of photocopies or something, and thus have no bookmarks. You could just remember what page “Girl From Ipanema” is on, but it’s often easier to have individual PDFs of each song, or to somehow introduce bookmarks in your score-browsing app. It’s probably not too onerous to do manually, but there’s a variety of clever tools to help.

There are some collaborative repositories of CSVs that list the title of each song followed by the start page:

The fakebooks themselves are sometimes available on the Internet Archive, or probably just from your buddy’s USB stick.

Screenshot of Fakesplit in action

Using this info, I decided to code up a quick solution to split the fakebook PDFs into per-song files. A Python script would be easiest, but I wanted to make this more usable for non-programmers, and I was looking to learn some new stuff in the process. I ended up settling on:

  • Go
  • pdfcpu for PDF capabilities
  • gotk3 (GTK3 bindings for Go) for the GUI

pdfcpu wasn’t my first choice. The documentation isn’t that clear for what I wanted to do. More intended use cases are very well-documented though! My initial solution was based on UniPDF, but I only belatedly realized that their open-source license was likely intended as a marketing tool. If a license isn’t purchased, the tool will watermark all output PDFs, with no obvious way to just let it know “hey, I’m using this in an AGPL application.” Seeing as it is open-source, it would be possible to remove the watermarking, but for a quick hack, I’d rather use something more straightforwardly free.

I’ve only built on Linux so far (will update once I’ve either gotten around to cross-compiling gotk3 on Linux or set up a Go stack on Windows). The source is available on GitLab.

Download Fakesplit for Linux x64