Programming again

The web application I’m trying to set up for the Serpent Publications
website is the most programming I’ve done for several years.
I made my living as a programmer for several decades, so I wasn’t
expecting it to be quite this hard to get back into it.

Part of the problem is that mysql and php aren’t what I ever did for a
living. I don’t remember the details of the vocabulary even for
what I did used to do very well, but I never knew either mysql
or PHP without a reference book.

Anyway, I was finally making progress on setting up the mysql
views this morning, and I completely forgot that I hadn’t posted
to this blog, so this is a fast one because any minute now Sunny will decide
it’s time for his walk and I’ll have to take him.

Anyway, my advice for what it’s worth, if you haven’t
programmed for a while and need to, is to go back to doing very
small things at a time. It’s generally good advice for
programming anyway — you get testability and reusability and all
kinds of good things by breaking up the job into little

So yesterday, I wrote up a list of all the fields that should
be in the pieceinfo view of my musicpublish database.

This morning I got each of them to work individually in an
interactive environment.

Then I wrote the sql that defines the pieceinfo view, which
takes data from the piece, book, and composer tables, by way of
the Book_Pieces_Table for joining book and piece.

Another good piece of advice is to set up an interactive
environment that you’re comfortable with. The command line mysql
is pretty good, but I got farther and faster when I switched to
the emacs sql mode.

Anyway, the upshot is that I’ve got a working although minimal
CSS theme, most of the hard part of the mysql is written, so what
I mostly have to do is write some PHP (some of which I may be able
to substitute python for), and then I’ll have a subset of the
functionality that I can throw at people for testing.

I’m not really sanguine about getting the whole application
written before BEMF, but I’m
optimistic that I can get at least as much functionality as is in
the current site, with improved design for easier upgrading.

Lilypond vs Petrucci, Round II

I said in the round one of this
that I’d let you know if I got any useful
answers to my query on the lilypond list. One of the list
contributors got interested in the problem and wrote me a new
layout block that does indeed look a lot more like what Petrucci
does. You can read the gory details on the


Here’s the first page of the Petrucci facsimile of Adieu
mes amours
by Josquin:

[Petrucci facsimile]

And here’s the cantus part lilypond produces now that I have
the new layout block:

[Lilypond cantus]

And here’s the tenor part from lilypond with the new layout block:

[Lilypond tenor]

Comparing Lilypond and Petrucci

While I’m working intensely on the site redesign, you might
have to put up with the things I’m writing about it to help me

Here’s a query I made on the lilypond-users
mailing list:

In general, I love the way lilypond output looks when compared with
other computer-generated sheetmusic.

I’m aware that the ideal espoused by the developers is the 19th century
hand-engraved sheet music.

I usually like the look of my lilypond output as compared with the late
sixteenth and early seventeenth century printers I usually transcribe.

I always like the look of lilypond output as compared with anyone’s
hand-written music.

But when I transcribe Petrucci from the facsimile, the spacing lilypond
does always looks clunky, especially in the parts with large

I’ve recently figured out that the large note-values look better if you

override SpacingSpanner #'base-shortest-duration = #(ly:make-moment 1 1)

in the layout block.

I believe Petrucci’s spacing is just equal spacing for every note, no
matter what its value.

Does anyone have any tricks for making lily’s output look a little more
like that?

I’m trying to redesign my website, and one idea I have is to have a
graphic in the header with a facsimile on one side and lily’s output on
the other. So it’s important that people not look at the lilypond
output and say, “Wow, that’s ugly compared to the facsimile.” Of course
one way to do that would be to use an ugly facsimile (of which there are
many), but it would be more fun to use a beautiful facsimile and also
have beautiful lilypond.

I’ll let you know if I get any useful answers.


Here’s the first page of the Petrucci facsimile of Adieu
mes amours
by Josquin:

[Petrucci facsimile]

And here’s the cantus part lilypond produces:

[Lilypond cantus]

And here’s the tenor part from lilypond:

[Lilypond tenor]

Site Redesign Progress

I finally got started on the site redesign, so this has to be a
short one.

It’s the kind of project that every time you solve one problem,
three others pop up, so I suspect it will be at least days if not
weeks before I have it ready even for friendly perusal, let
alone to loose on the unsuspecting public.

I’m starting with the thematic wordpress
theme framework. It allegedly lets you customize almost
anything, but that turns out to be only true if you know CSS. I
learned a bit about it the last time I did site redesign, and
actually sort of liked the look of the site I did for the Boston
Recorder Society (they changed it when I stopped maintaining it,
so you can’t see it there). Anyway, I have the mechanics pretty
much the way I want them, and the look something like the old
BRS site, so now all I have to do is:

  • Write the content for the new pages, including the new
    search form.
  • Fiddle with both LaTeX and Gimp to get the banner at the top
    of the pages right.
  • Fiddle with the wordpress stuff so the sidebars and footers
    are the way I want them.

My accomplishments for yesterday included:

  • Finding where the home page on the new hosting site should go. I
    broke accessing it altogether twice yesterday afternoon trying
    to be too cute about that.
  • Setting up a test environment on my home machine. There’s
    still work to do on this, because I used the Ubuntu wordpress
    package to do it, so I have to fiddle with permissions and
    ownership and groups and maybe links before it really lets me
    work on it right. But I made substantial progress.
  • This morning before breakfast, I installed keyring and now I can do openssh to both the old
    and the new hosting sites without entering passphrases.

I was frustrated enough yesterday when I had access to the new
site broken and hadn’t yet figured out how to customize anything
in thematic that I considered just going to bed and reading
trash fiction, but I have persevered, so far.

The most inspiring story I learned in high school was in the
history of English literature book. Thomas Carlyle had spend
several years writing the history of the French Revolution, and
he gave the only copy of the manuscript to his friend Macauley
to see what he thought. Macauley’s maid (at least, she had to
take the rap) thought it was trash and put it in the fire.
Carlisle went to bed and read trashy fiction for a week and then
got up and wrote the book over again.

I admit that story has more often inspired me to go to bed and
read trashy fiction than to write the history of the French
Revolution. But it’s really true that there are times you just
shouldn’t be doing some things, and it was looking like
yesterday afternoon was the wrong time to be slaving over a hot

Scores are now in PDF’s

It’s lunchtime and I still haven’t posted, so I’m putting up
something I wrote in email to the lilypond
users list

I mostly use lilypond for Renaissance polyphony, where the
original performers didn’t have access to scores, and I feel strongly
that modern performers can play better from parts, so that they have
to learn how their part fits with the others by ear instead of by

But having access to the score does help modern performers analyze,
and that analysis can certainly speed up rehearsals and maybe even
improve the performance. And I do produce a score in the
process of getting the parts typeset and proofread. And of course,
anyone who installs [the right version of] lilypond can print the
score as well as the parts.

For quite a while, I wasn’t putting the score PDF’s up on my site
at all, but now I’ve decided that the scores
Lily makes are so bad that nobody would be tempted to perform from
them if they had access to a nice part with good spacing and *a lot*
fewer page turns. So I have recently modified my scripts so that the
score appears at the end of the parts.

You can see an example in the PDF of Baldwin’s
A Browning

Transcribing from facsimile

It’s Tuesday, which means I have to get ready for the Cantabile
Band rehearsal, and I just finished guessing where to add time in
the parts for the facsimile I’m transcribing.

I had planned a nice post about my marathon train ride through
Germany, but it’s going to take until well past lunch to write,
and I have other things to take care of.

So that one goes on the spindle, and I’ll just tell you how
much I marvel that they ever got any part books right before there
were computers to take the notes from the parts and combine them
into a score for them.

It’s also surprising that the sixteenth century singers didn’t
care more that there were all those mistakes. In the case of the
Weelkes, I think they weren’t really reading the music the way we
do at all — they just learned it to get the basic tune and then
put the parts together they way they had to go. They knew the
style, and so they didn’t need every ending note to be exactly the
right length to know where to start the next phrase.

You’ll be able to see what I’m talking about when I put the
piece I just transcribed up (maybe tomorrow), but there’s an A
section where the parts are supposed to all cadence together, and
a B section where they all end together. In both cases, once I’d
entered the notes as they were in the facsimile, one part was
short — in the A section the cantus was a half note short, and in
the B section the bassus was a quarter note short.

In both cases, if you knew the style and were really singing by
ear, it wouldn’t have thrown you — of course the Cantus goes back
and starts the A section the second time the way it did the first
time, and starts the B section the way it’s written, even if the
Cantus final note should be a half note longer. In the B
section, the Bassus part was clearly doing the obvious cadence,
even though it was written a quarter note short.

So I doubt that Weelke’s singers had any problem with his
mistakes, but the Cantabile Band would have if I hadn’t fixed them.

Additions, March 25, plus some catchup

I am a reformed character, and am trying to put things up as I
transcribe them. So this is what I did yesterday for the Cantabile
rehearsal. I don’t think it will be hard once we
know it, but it wasn’t an easy sightread.

I still owe you some stuff that I transcribed last year when I
wasn’t in the right Zen State for fixing baroque upload
procedures. So here are some Baroque sonatas. I haven’t been
transcribing Baroque sonatas, since there are good editions out
of most of what I play, and I can’t really add much value. But
it’s definitely better to have it electronically for
transposing, which I had to do last Fall because of having to
play with a keyboard at 392. And it turns out to be easier to
get copies to a continuo player at a distance, too.

Canzonets for two voices are now at

I got another order for me to print out the Morley Canzonets for two
, and realized I didn’t really want to be in the
printing business. So I put the hard copies up at the Serpent Publications

I’ve avoided doing that for any of the part books, because I
don’t have enough control over the lulu store to enforce that
anyone who orders one part also orders the other, unless they
say they really, really, really want to do that.
But I put it very clearly into the descriptions, so I’m going to
hope for the best.

I’ve been offering the PDF download for free from this site for
almost a decade. (It looks like the PDF file went up on September
17, 1999.) So I’m going to continue to do that, although I may at
some point move the download to the lulu store.

Website redesign (part one)

I have hitherto avoided inflicting my technical problems on the
readers of this blog, but this subject is what I really need to
think about, so it doesn’t really make sense to go finding other
things to write about the way I did yesterday. I’ll
try to keep the tech talk understandable to the lay user; let me
know if I fail.

This post is going to discuss only the basic functionality of
how the transcribed pieces are described, and how the user finds
them. The other parts of the site will be discussed in future posts.

Why a redesign?

Because the original design has gotten unwieldy both for
me and for the users.

The reason I didn’t add new pieces to the site for over a year
wasn’t that I wasn’t transcribing new pieces, it’s that the
procedure for adding things is quite clumsy. After I changed
computers and ISP’s in August it was clearly going to need an
unknown amount of debugging. The debugging turned out to be small
when I finally got around to it, but adding a piece that’s been
transcribed and proof-played should be just an easy couple of clicks.

For the users, the one-page By
listing is an increasingly unwieldy way to find what
they want, and doesn’t include all the information they need. For
instance, one of the most-requested things is a way to find pieces
by number of parts. It would also be good to have some idea of
the ranges of the parts.

The original site design did have both number and ranges of parts
when you got to the page for the piece,
but it happened by displaying short excerpts
from each of the parts, which
broke fairly early on, and wasn’t really the right answer for
doing searching anyway.

So here’s my picture of how the site should look:

  • The primary entry to the collection of transcribed works
    should be a search page that allows selection by composer,
    dates, number of parts, instrumentation, country, language, or
    any combination of those things. That is, if I’m looking for a
    trio for voices in German, I should be able to just say, “Show
    me all the three-part vocal pieces in German.” Or if I want to
    know what there is by Billings, I should be able to just request
  • The current static html pages which are generated from the
    database by a script I wrote, should be generated dynamically
    from the database. (If that doesn’t make sense, see below.) This will make adding a new piece much
    simpler. You don’t want to know what I do now; what I’ll do
    then is run one script which will add the piece to the database
    and upload the files.
  • I think it might make sense to leave both the current search
    pages (By
    and By
    ) there, but of course have them dynamically generated.
    The idea is that for browsing, having a way to look at what’s
    been added or changed since the last time you browsed, or at
    what the distribution of stuff by composer is, is easier than
    just dealing with the search page. Possibly it would make sense
    to add other pages like that, such as “By Country” or “By number
    of parts”.

Static and dynamic

It looks like the major technical jargon I wasn’t able to edit
out of the above was the static/dynamic distinction. So here’s
an explanation.

In general, if you go to a page like,
it’s static. HTML is a markup language, so the person who
authored the page just wrote text, and then put in some commands
to say things like, “Here’s a new paragraph,” or “Display this
image here.” Then they put that page on the site, and kept
track of where they put it so that they could refer to it from
other pages, or from emails.

If you have 500 pieces, or a couple of blog entries a day, this
might not be such a good idea. So the way most of those sites are
done is that the information you want to maintain about each
individual item is in a database, and
the text you see when you look on the web at that item is
generated by a program from what’s in that database. For
instance, each piece on my site has a title, a composer and a
list of files someone might want to download
in the database, and there could be a program that gets run on the
server every time someone says, “I want to look at that piece,”
that would display that information.

It was even at the time wierd, but when I designed the site, I
did put the information in the database, but instead of having the
program on the server to display it, I have a program that runs on
my own computer that writes an HTML file to display it. This
means I have to rerun that program every time the information
changes, and run the program that generates the “By Composer” and “By
Date” pages every time I add something. This was fine when there
were only a few pieces, but it’s getting tedious now that there
are more than 500, with another hundred or so that I haven’t yet
put up.