A topic that’s probably of limited use for most people, and limited interest for even fewer: how I batch-process scans of my scores for digital editing.
I write all my scores by hand. Always have. I wish I could wax lyrical about Craft, or Thinking Through One’s Own Hand… but it’s a bit of a pain in the arse and, honestly, it just happens to work for the way I think and my process. I don’t think there’s anything special about handwriting over digital, it just happens to work for me.
The workflow has been the same for years: sketch in notebooks; mock-up frameworks and structures; write the draft; rewrite the draft; ink it; scan it; digital post-processing to clean up, make tweaks and, ultimately, send it off the PDF. While it might not be the sexiest bit of the workflow, dealing with pages of scans, and cleaning them up always feels the most time-consuming. So I have some automated tricks as a workaround.
Okay, this post is really just for me to record my workflow. For some reason I keep losing the .txt file on my computer that reminds me of the command-line arguments. I’ve recently made the move away from using Photoshop with macros. I’m now using GIMP, and I’ve got a simple little set of Python plug-ins to help automate the process. Here’s the plan (files on GitHub):
- Scan the score (a single, multi-page, PDF file).
- Split the PDF into individual PNG files (pages)
- This is easiest in the command-line using ImageMagick and Ghostscript:
- convert -density 300 input-file.pdf %02d-output-page.png
- you could add an ‘-auto-level‘ call in between the input and output files to have ImageMagick handle the level balance.
- in the past, I’ve also had a lot of luck with the pdftk server
- Automatically balance levels of the PNG, prepare it for editing (XCF file).
- I made a GIMP-python script to do this: thrly-1-png2xcf.py
- I do my editing/clean-up in GIMP.
- Flatten the XCF files down to PDFs.
- I made another GIMP-python script to do this bit: thrly-2-xcf2pdf.py
- Merge the individual PDF pages back into a single PDF document.
- This is easy: if I’m on a Mac, Preview can do it. Otherwise, Ghostscript:
- gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dAutoRotatePages=/None -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dDownsampleMonoImages=false -dDownsampleGrayImages=false -sOutputFile=finalEditedPages-Merged.pdf *.pdf
Pretty riveting stuff. This is always the point in the process where I swear that I’ll learn Sibelius or Finale for the next piece…