42 Astoundingly Useful Scripts and Automations for the Macintosh

Holy, Holy! Lord God Almighty!

One of my favorite tunes, and perfect for Easter, is Reginald Heber’s hymn of praise beginning with “Early in the morning, your song shall rise to Thee”. It’s filled with evocative lyrics and a rousing, joyous melody by the Reverend John B. Dykes.

Jerry Stratton, April 13, 2022

Early in the morning (Holy, Holy!)

Easter is coming, and Holy, Holy, Lord God Almighty, while not specifically an Easter Day song, is perfect for that morning sunrise. Reginald Heber wrote the lyrics specifically for Trinity Sunday, the first Sunday after Pentecost. The Easter season officially ends on Pentecost, after which we return to Ordinary Time; the first Sunday in which we return to Ordinary Time is Trinity Sunday, the Solemnity of the Most Holy Trinity.

Which is when we’re most likely to sing this song at Mass.

Holy, Holy is a very beautiful song, both its lyrics and its rousing melody. It’s the melody, of course, that I’m going to reproduce using the piano script.

Here are the full lyrics from Gospel Hymns Combined, an 1879 collection of hymns:

    • Holy, Holy, Holy! Lord God Almighty!
    • Early in the morning our song shall rise to Thee;
    • Holy, Holy, Holy! Merciful and Mighty!
    • God in three Persons, blessed Trinity!
    • Holy, Holy, Holy! all the saints adore Thee,
    • Casting down their golden crowns around the glassy sea;
    • Cherubim and Seraphim falling down before Thee,
    • Which wert and art, and evermore shall be.
    • Holy, Holy, Holy! tho’ the darkness hide Thee,
    • Though the eye of sinful man Thy glory may not see,
    • Only Thou art Holy, there is none beside Thee,
    • Perfect in pow’r, in love, and purity.
    • Holy, Holy, Holy! Lord God Almighty!
    • All Thy works shall praise Thy name in earth and sky, and sea;
    • Holy, Holy, Holy! Merciful and Mighty!
    • God in three Persons, blessed Trinity!
    • Amen.

Modern hymnals often change these lyrics, which I’ll talk about later on my blog, but these are the longest-running lyrics and the most inspirational.

Reginald Heber’s religion wasn’t Catholicism; he was an Anglican. But the songs he wrote, especially this one, have spread throughout the hymnals of Christianity. In the text comparison I used while researching the lyrics, you can find Methodist hymnals, Lutheran hymnals, Presbyterian, Baptist, and Moravian hymnals.

As well as Anglican hymnals, although that’s not an “of course”. At the time Heber wrote his hymns, the Anglican hierarchy didn’t approve of singing hymns in church. This was one of those things that the laity seem to have pretty much ignored. Heber was in favor of an official about-face on the issue, and wrote a lot of songs that people love to sing today, and presumably when he wrote them.

He was writing songs that people wanted to sing, to convince church officials that singing was important.

The melody I’m using is also from Gospel Hymns Combined. It’s the traditional melody by the Reverend Doctor John Bacchus Dykes. Dykes was born in 1823, only three years before Heber died (1826), so this is obviously not the melody that Heber used. But it has been the melody most associated with the lyrics since about 1861, when it appeared in the Anglican hymnal Hymns Ancient and Modern.

Holy, Holy! Lord God Almighty!

The lyrics and melody from Gospel Hymns Combined.

Dykes wrote his melody specifically for Heber’s lyrics. He called his melody Nicaea, after the First Council of Nicaea. It was this council that formalized the doctrine of the Trinity, which makes the lyrics thematically appropriate for Heber’s Trinitarian lyrics.

I don’t know if he wrote the stinger for the piece; it may have been added on by the publishers of Gospel Hymns; it’s a fairly standard “Amen” melody:

--key E-

#treble
1  ["E A" | "E G"] 

#bass
- "-A C" | "E B"

You could play this directly on the command line using:

  • piano --key E- 1 \["E A" "E G"\] - "-A C" "E B"

…if you wanted an Amen for your other scripts. It would be particularly appropriate for scripts that render images. Might make a nice ring tone, too. I’ve included one in the archive (Zip file, 4.7 KB).

The brackets need to be escaped because they have another meaning on the command line. When I wrote piano I thought quite a while about which symbols to use for multiple voices; there really wasn’t a good option. All bracket-like symbols in normal ASCII have a special meaning on the command line. So I decided to go with what best conveyed the purpose of having two voices running concurrently. Parallel voices are difficult to convey on a serial interface like the command line, but square brackets seem to do a good job of it.

You could even create a command-line command called “amen” that plays the melody when you type “amen” on the command line. You could, of course, write a shell script that included piano --key E- 1 \["E A" "E G"\] - "-A C" "E B". But because the piano script reads files and ignores lines that begin with a hash, it can be treated as a scripting shell. If you have the edit script on your system, type edit amen. For the text of the script, use:

[toggle code]

  • #!/Users/USERNAME/bin/piano
  • # Holy, Holy! Lord God Almighty!
  • # Lyrics: Reginald Heber, D.D.
  • # Melody: Rev. John B. Dykes
  • # From Gospel Hymns Combined, 1879.
  • # Jerry Stratton, astoundingscripts.com
  • --key E-
  • #treble
  • 1  ["E A" | "E G"]
  • #bass
  • - "-A C" | "E B"

Replace USERNAME with your own username, or replace all of “/Users/USERNAME/bin/piano” with the path to where you store the piano script.

Save the file, and you can now type “amen” on your command line to get the melody. All the shebang—that first line, that begins with the pound symbol and the exclamation point—does is point to another command, one that accepts filenames. The shell you’re using sees that first line, and calls it, appending the path to the script, in this case the path to the “amen” file we just created. Because /Users/USERNAME/bin/piano amen would work on the command line, it the amen script also works as a command on the command line.

This can be done with any melody, although it will probably be more useful for short melodies that can be useful to mark time or announce the end of some task. Type edit v (using the edit script again) to create a command called “v”:

Reginald Heber

Reginald Heber, around 1822 when he was either canon at St Asaph in Wales, or Preacher at Lincoln’s Inn in Camden, England.

  • #!/Users/USERNAME/bin/piano
  • #Beethoven’s famous fifth introduction
  • #Jerry Stratton, astoundingscripts.com
  • --key E-
  • --tempo 108
  • R 12
  • [- G G G 2 v+++ --E]
  • [-- G G G 2 v+++ --E]
  • [--- G G G 2 v+++ --E]
  • G G G 2 v+++ --E
  • 4 R

Now you have Beethoven’s fifth (this is the same version of the melody as in the book) at your command!

As I usually do, I created separate treble and bass files so that the treble and bass clefs can be played by different instruments in GarageBand. I chose French Horns and Picked Bass for the initial verses, and switched to Cathedral Organ and Bass Organ for the final verse. And of course, I chose a voice-like “Male Chamber Choir” for the final “Amen”.

Here’s the treble clef:

--key E-

4 "-B E" "-B E" "E G" "E G" | [2 B] -D F [2 B] E -D     |
 [C. 8 C] -C -D "E C" "F C"     | 2 "G B" "E G"

4 [B. B] F F "G B" "F B"    | "E +E" "F +E" "F D" "G B" |
 "F F" "-D B" "E. C." 8 "-D B"  | 1 "-D B"

4 "-B E" "-B E" "E G" "E G" | [2 B B] -D F E -D         |
 [C. 8 C] -C -D "E C" "F C"     | 2 "G B" "E B"

2 "E +E" 4 "E B" "E B"      | 2 "E C" [G] 4 E -D=       |
 "-C A" "-C F" "-D. F." 8 "E E" | 1 E 

Save this to a file and you can play it using:

  • piano treble.txt

But it will sound better with the bass clef:

--key E-

-

4 "E G" "E G" "-C E" "-C E"  | [2 -D E] F A G B            |
 [-A. 8 -A] A B "A C" "A D"       | [2 E "E B"] +E B R R

4 "-D B" "-D B" "E B" "-D B" | "-C G" "-C A=" "-D B" "E B" |
 "F D" "F B" "F. A=." 8 "-B B"    | 2 [1 -B] B A-

4 "E G" "E G" "-C E" "-C E"  | [2 -B E] F A G B            |
 [- A. 8 A] A B "A C" "A D"       | [2 E "E G"] +E B R R

4 [2 -C] G A "-G B" "-G D="  | 2 "-A C" "E B"              |
 4 "-A A" "-A A" "-B. A." 8 "E G" | 1 "E G"

# Bringing the octave back up
+

I played this on the command line using:

  • piano [ bass.txt bass.txt bass.txt bass.txt ] treble.txt treble.txt treble.txt treble.txt amen.txt --save holyholy

Which initially resulted in the bass line going an octave lower at each of its iterations. This was due to the dash at the top of the file dropping it down an octave. I added a + at the end of the file to bring it back up to normal. This normally isn’t an issue because I would normally use --repeat 3 on the command line to have four verses. But I didn’t want the Amen to be repeated four times, it only belongs at the end. That’s why there’s a “+” at the end of the bass clef.

The photos in the slide show are from various churches and cathedrals I’ve managed to photograph over the years.

  1. <- Merry Command Line
  2. America the hymn ->