Showing posts with label LilyPond. Show all posts
Showing posts with label LilyPond. Show all posts

Sunday, December 22, 2024

You should hear it in the original Greek!

Singing Angels We Have Heard On High in church this morning reminded me of something I thought of some years back when I was first learning Greek: namely, that you can replace the Latin refrain Gloria in excelsis Deo in the carol with the original Greek, Δόξα ἐν ὑψίστοις θεῷ (Doxa en hupsistois theo). It's not quite a perfect fit since δόξα has two syllables to gloria's three, but it's generally less awkward to stretch a syllable slightly than to squash another one in. 

I've mentioned this curiosity to a few people over the years, but today it occurred to me that with LilyPond I could engrave some sheet music to demonstrate it. I brushed off my LilyPond skills (which I found surprisingly fresh for not having been used in a few years) and spent a few hours today making this lovely rendition:

Thankfully, I found a version of Christ, the Lord, is Risen Today I'd done a few years ago laying around which gave me a very useful hymn template, including useful features like multiple verses and a refrain; otherwise having to figure out how to do that would've taken me a lot more than a few hours. There are a few small cosmetic tweaks I could still do (the lyrics attach to the soprano voice so there are few choices which simplify the lyrics handling at the expense of nice-looking notes), but it should be performable. I hope. Let me know if you do.

Anyway, Merry Christmas! I know it's been pretty quiet around here, but there are positive developments which I hope to share in the not-too-distant future. A hui hou!

Edit: Actually, I forgot to mention the most interesting thing I learned while doing this, which is that the the way I grew up singing Angels We Have Heard On High is different from how the music reads. I'm short on time at the moment and it really needs some music to show visually rather than trying to explain it in words, so I'll return to this in the future when I have time.

Edit 2: Okay, here's a picture showing the music as traditionally written (top) and how I grew up hearing it. I'm just focusing on the melody here for simplicity:

This four-bar phrase gets repeated for the second half of each verse, so we can look at it by itself. The thing that immediately drew my attention is that in the traditional formulation the entire phrase begins and ends on the same note (A), whereas the way I grew up with it has the final three notes descend to the F below. To me, the traditional way sounded quite jarring at first (to the point I thought I'd made a mistake in transcribing the music) because it feels like there's no resolution: you begin on A, sing around it a bit, then end…back on A, where you started. The version I'm familiar with does that in the first half of the phrase (setting up a mild unresolved tension), but then resolves it in the second half at the end.

Of course, in music, there's no right or wrong, just different matters of taste. Having listened to a rendition of the traditional melody a few times I find it growing on me. The song is one whose origins have been lost in the mist of time, so we can't exactly ask the author(s?) what they were thinking. Perhaps the verses are intentionally set up this way to increase the emotional payoff from the spectacular resolution in the refrain, which is the kind of beautiful polyphonic waterfall of sound you no longer find in modern church music. Anyway, let me know in the comments which version you heard growing up, I'm curious if what I learned is widespread or some local phenomenon. I can't really trace it to a single source, it's just…how I know the song.

Saturday, July 11, 2020

The Lockdown Life

This past Wednesday, Melbourne (and one shire to the north) went back into Stage 3 lockdown for six weeks due to rising case number of COVID-19. This is after we'd gotten all the way down a few days in early June with zero new reported cases, then a few weeks of just single-digit new cases. Then, near the end of June, we started getting double-digit numbers, which stretched into two weeks, then eventually breached triple digits just within the last week or so. In contrast, most of the rest of Australia has been completely or almost completely free of reported new cases, other than New South Wales which is still getting a low number irregularly. Practically overnight Victoria has became a pariah state, with all the other states and territories closing their borders and politely but firmly making it known that Victorians aren't welcome 'round these parts, y’hear?

It's a bit of a disappointment, considering we seemed to have beaten the virus more-or-less and were starting to open back up again. Out of an abundance of caution I didn't go anywhere since the lockdown started to lift in late May except for a single visit to friends, but as June progressed I was starting to think about heading into my desk at Swinburne to pick some things up (especially some more paint and something to paint on, as I have a very limited selection of the former and have nearly run out of the latter).

It's odd that this second lockdown hit me harder than the first one, considering I hadn't even really come out of the first one to begin with; I know friends who were starting to get out and about in the interim where it seemed like we were on top of things. It just feels more unjust somehow—those of us who've been being good for months now are forced back into lockdown through no fault of our own due to the actions of a relatively tiny amount of people who took "lockdown being lifted" for "business as usual" and ignored social distancing guidelines put in place to prevent exactly this happening. Before the lockdown, someone could be excused for not knowing what was happening amidst the confusion and unwittingly spreading the virus before becoming symptomatic; it's a lot harder to justify such behavior afterwards when they should know better.

Then as I was preparing to lead our small group Bible study Thursday night, a verse in 1 Peter I'd been looking at all week jumped out at me:
For is it better, if the will of God, that you suffer for doing what is right rather than for doing what is wrong.
   —1 Peter 3:17
While it's still pretty annoying to have to forego any hope of taking a trip anywhere further than walking distance for another month and a half, I can at least agree with this in principle: I'm glad the lockdown isn't of my doing, and I don't have any lives on my conscience from spreading the virus to potential victims. It's just frustrating when the reward for doing good is the absence of a negative rather than a more tangible positive, but I suppose that's just the world we live in. And that I'd probably feel rather differently if I were in the other position.

In the meantime, it's not like I'm ever going to run out of things to do from my home: I've still got a Ph.D. to finish, papers and a thesis to write, plenty of games that won't play themselves, some art projects I should really get around to finishing and sharing, and I've started copying Brahm's absolutely fantastic “Variations and Fugue on a Theme by Handel,” which is of pleasantly maddening complexity. (I find myself needing to dive into the LilyPond documentation quite frequently to figure out how to represent the various intricacies and special cases of music notation that pop up.) And hey, at least it beats being in the hospital! A hui hou!

Monday, June 8, 2020

Orchestrating Handel's “The Harmonious Blacksmith”

Today I'm pleased to finally be able to share a new project I've been working on for a few months now. Back in February I mentioned I started learning LilyPond in order to engrave sheet music, and after finishing copying Ecossaise in E♭ Major by Beethoven as a warm-up exercise I was looking around for something new to practice with. I settled on Handel's piece known as The Harmonious Blacksmith, the name given to the fourth movement from his Suite No. 5 in E major for harpsichord. I discovered this fantastic piece last year, and in the process of writing the LilyPond code for it I listened to a whole bunch of different versions of it, including two versions of it orchestrated for a full orchestra. After copying a version for harpsichord(/piano), this inspired me to undertake something a bit more ambitious: making my own orchestrated version!

I settled on a sixteen-instrument ensemble, where two coincidences neatly dovetailed: MIDI handles channels in groups of 16, and the staves for those instruments also pretty nicely filled exactly one page vertically. It's scored, somewhat arbitrarily, for first and second violins, viola, cello, bass, harp, flute, oboe, English horn, bassoon, clarinet, trumpet, trombone, tuba, French horn, and xylophone. I started sometime in mid-March or so, and worked on it off and on for the next month and a half. In early May I gave a short talk at our astronomy department's weekly Monday lunch (which often features people talking about hobbies or interests) and gave the first public premiere of the (mostly) finished work by playing the synthesized MIDI audio. Since then I've tweaked a few little things (such as changing instrument parts to the correct keys for transposing instruments), and this weekend I finally worked out an easy way to render MIDI to audio. (Turns out there's a convenient Python package, midi2audio, which makes it a snap.)

Anyway, here's a video I made so I could display the sheet music along with the audio:


This was, obviously, my first such attempt at orchestration and I have to say, I really enjoyed it. I'm sure if I actually knew music theory I'd be able to weave even more beautiful passages, but even so I stumbled upon quite a few bits that still give me goosebumps, or which just sound lovely: the gentle introduction of the harp in the first variation, the punctuating xylophone taps on pages 8–10 (but especially on page 9) like little blacksmith's hammers, the interplay between trumpet and oboe (page 11), the pastoral, sublime repetition of the second variation (page 14) right after the bombastic introduction a page before, the staccato viola (page 17) interspersing with the flute*, the introduction of the third variation with its gentle, lilting interplay between the woodwinds and harp, the xylophone intermittently shadowing the oboe (page 23), the growing crescendo involving nearly all the instruments which ends that variation (page 24), those  two insistent growling low notes from the bassoon in the fourth variation (page 27), the trumpet making a surprise appearance in the fifth variation (page 34), the four-part instrument unison between the violins, viola, and trumpet on page 38 (never fails to bring out the goosebumps), and the entirety of the last two pages as everything slows, and builds, and crescendos before the final cascading descent to the finish. I've listened to this piece I don't know how many dozens of times at this point (both my version and others), and I have yet to tire of it.

Anyway, enough of my rambling. I hope you enjoy the music, and feel free to point out any musical mistakes I might have made—I did have an experienced violinist friend look it over so I'm fairly confident the strings don't have any unplayable notes (he found those already), but I might still have made mistakes with the other instruments. A hui hou!

*The staccato markings were one of the few liberties I took with the original notes along with adding a few trills in places, though there are a number of trills in the second variation in the original. The dynamics markings and tempi are also mine.

Saturday, May 9, 2020

Ecossaise in E♭ Major by Beethoven (WoO 86)

Back in February I posted about the new hobby I've picked up of engraving music using the LilyPond markup language. I've thought for a while now that it would be nice to share what the music I'm engraving sounds like (especially for the musically non- or semi-literate such as myself), but it turned out to be more complicated process that I expected. Turning MIDI output into a waveform file format which I could include in a video is a bit tricky if you're coming to it fresh like I am, but I have a provisional method of doing so, so I made the short video below as a proof-of-concept for eventually making longer videos of some of the things I've done since. And I have been busy, but I'll leave it to a later post to go into more detail.



For now, just enjoy this short melody (seriously, it's less than thirty seconds long), and play along at home if you're so inclined and able. A hui hou!

Monday, February 10, 2020

LilyPond: LaTeX for Music

I've written in the past about \(\LaTeX\), the markup language which allows you to typeset math beautifully. This weekend I finally got around to teaching myself LilyPond, which is pretty much (as the title says) \(\LaTeX\) for music: it's a markup language which allows typesetting (or “engraving”) beautiful musical scores.

Now, I'm hardly the most musical person around; my musical education has been haphazard, much of that due, I will freely admit, to my childhood disdain for practicing things. I had a few months of violin lessens when I was about ten (right before moving internationally, which didn't help), and I taught myself to play the harmonica a bit from books in my teens (though I haven't touched it in years). I've always enjoyed listening to classical music, and I'm familiar with a lot of the terms and names for various markings, but that's about it; I can just barely read sheet music at a glacial pace.

So I was rather pleasantly surprised to discover that I took to writing LilyPond code like a fish to water after a few hours spent reading the (exceedingly well-formatted) documentation. (I think I'm just a sucker for markup languages in general; HTML, \(\LaTeX\), even SVG could be considered a form of visual markup language even if I never actually engage with the underlying code.) In less than an hour I'd managed to reproduce the short piece by Beethoven below, which, while certainly not that complex (it only runs for about 40 seconds), is also no “Twinkle, Twinkle, Little Star.” (Part of that time was that I had to look up how to handle repeats, which wasn't covered by the documentation I'd read up that point.)


I had to guess on the tempo, as the sheet music I copied it from didn't have one listed and I was going off the speed I'd heard it played. Looking up tempo names led me to the interesting fact that the pace represented by “allegretto” changed between the 18th and 19th centuries; originally it was considered to be just above andante, but it ‘moved up’ and is now considered just a bit under allegro. I realized that my conception of it has more in common with the 18th century view, and having listened to a lot of Beethoven's music (and the tempos he called allegretto) I feel like he'd probably be fine with it. I added a BPM measure to make it explicit, anyway.

All in all, I had a surprising amount of fun engraving music, and I'm itching to do more (though at this point I guess I'll mostly just be copying existing music). LilyPond is supposed to handle lyrics quite well, so it'd be interesting to try some vocal music, perhaps. I've been using a very nice editor for LilyPond called Frescobaldi, which acts as a GUI and handles a lot of the little things. It has a really nice preview feature where mousing over or selecting any note in the score has the corresponding part of the code highlighted, and vice versa. We'll see where I go with this in the future, I guess! A hui hou!