Tuesday, November 28, 2023

Schirmer's Early Intermediate Level Masterpieces

During the pandemic, I started teaching myself piano. Recently, I've been working my way through a book of 'selected piano masterpieces' from Schirmer's Library of Musical Classics: Early Intermediate Level. Of course, this is all public domain, and you can get the music online, but it's nice to have it in a book.

That said, it's also nice to be able to hear the pieces, and for that I've been using MuseScore, which is open source music notation software that will also 'play' whatever you enter into it. There's also a huge library of music that various people have uploaded into it, including a lot of the 'classics'. 

So here's a list of links to versions of the pieces in the mentioned book. Note that you can download these or play them directly from the site. Please let me know if any of the links should break.

Sunday, November 19, 2023

Comparing PDFs, Round 2

I've found an even better application for the idea mentioned in my last post. It can be very hard to see all the copy editor's corrections. Well, PDF comparison to the rescue! This script is slightly more complex, since I have a number of different files from them, one for each chapter. But not a problem. First, explode the PDFs into images using pdftocairo, as before. Now:

#!/bin/bash

#DEBUG=echo;
# basename of the images for this
# chapter from copy editor
TYP=$1;
# basename for 'original' pages
BASE=
SenseBook-19-IX-2023-Revised
# first page number of 'original' pages
XPAGE=$2;

for PG in $TYP*tif; do
    NEXT=$XPAGE;
    if (($XPAGE < 10)); then NEXT=0$NEXT; fi
    if (($XPAGE < 100)); then NEXT=0$NEXT; fi
    $DEBUG compare $PG $BASE-$NEXT.tif Comp-$NEXT.tif;
    XPAGE=$(($XPAGE + 1));
done

When that's done, it gives me the comparison images for that chapter. So now just:

convert Comp*tif Edited-ChN.pdf

And now it's easy to see where the corrections are:



Saturday, November 18, 2023

Comparing PDFs

I'm working on final corrections for my book Modes of Presentation, which I'm again typesetting myself via LyX and LaTeX (as I did Frege's Theorem and Reading Frege's Grundgesetze). I'm paranoid about something weird creeping into the book and have been comparing the new and old pages as I go. I figured there had to be a better way to do that than flipping back and forth between the two PDFs. All the more so given that doing so feels like one of those change-blindness experiments.

Well, Linux and the command line to the rescue. The ImageMagick suite contains a 'compare' command that takes two images and produces a new one that shows the differences between them. So all I have to do is explode the PDF into a bunch of page images and run the compare command on them. Here's a generic script to do it:

#!/bin/bash

# Uncomment to test with just a few pages
#D2="-l 10";
# Image resolution
RES=100;

pdftocairo $D2 -gray -tiff -r $RES NEWPDF.pdf New;
pdftocairo $D2 -gray -tiff -r $RES OLDPDF.pdf Old;
for NEW in New*tif; do
    BASE=${NEW#New};
    OLD=Old$BASE;
    compare $NEW $OLD Comp$BASE;
done

Here's an example of what you get:

It's not readable, but you can easily see where the changes have been made and, if need be, check the actual page. Mostly, I want to make sure that nothing dramatic has changed with the page breaks, etc, anyway.

Of course, you can also do this on other operating systems, but they do not encourage you, as Linux does, to use the command line.


Sunday, November 12, 2023

Setting Up Soft Synths in Linux---Even Windows Ones!

I've been wanting to have a keyboard at my office, so I can practice a bit when I have a free moment. Eventually, I want to get a digital piano, or something similar, but at the moment I don't have the room for that. So I've bought an Arturia KeyLab 88 Mk II for the time being. It's just a MIDI controller, so does not make any sound by itself. The plan is to use software synthesizers on my computer for the sound.