42 Astoundingly Useful Scripts and Automations for the Macintosh

Amazing Grace (Common Melody)

Amazing Grace, by John Newton, with melody by Edwin O. Excell, 1900. This is the commonly-known melody for Amazing Grace.

Jerry Stratton, August 28, 2019

Amazing Grace (Excell) (563.1 KB MP3 file)

There are many inspirational hymns in the Christian world, but there is only one Amazing Grace. It is by far one of my favorite hymns. The story of how and why John Newton wrote the lyrics is itself amazing.

So of course I had to make a file to play it using the piano script. I highlighted it in 42 Astoundingly Useful Scripts and Automations for the Macintosh, but I wanted to go over it a little further here, and also talk about using it (and other MIDI files) in GarageBand.

[toggle code]

  • # Excell, Edwin O., 1900
  • # Rev. John Newton
  • --key F
  • # line 1 bass
    • [-- "F +F" | 2 "F C" [8 F A] 4 +F | 2 "C +F" 4 "C +E" | 2 "+D +F" 4 "B +F" | 2 "A +F" 4 "A +F"]
  • # line 1 treble
    • - "A C" | 2 "A +F" [8 + A F] 4 C | 2 "C +A" 4 "B +G" | 2 "A +F" 4 "B D" | 2 "A C" 4 "A C"
  • # line 2 bass
    • [-- 2 "F C" [8 F A] 4 +F | 2 "C +F" 4 "B +E" | 2 "A. +F." 4 "F +F" | [4 + A. 8 F A F] 2 F 4 F | 2 "A +F" 4 "A F"]
  • # line 2 treble
    • 2 "A +F" [8 + A F] 4 C | 2 "C +A" 4 "C +G" | 2 "C. +C." 4 "C +A" | [+ C. 8 A C A] 2 C 4 C | 2 "C +F" 4 "C C"
  • # line 3 bass
    • [-- [B. 8 A B] 2 F 8 D +F | 2 "F +F" 4 "A +F" | 2 + "D F" [8 F A] 4 -C | 2 "-C F" 4 "-C E" | 2 "-F F"]
  • # line 3 treble
    • "B. D." 8 "C +F" [+F D] 4 B | 2 "A C" 4 "C C" | 2 "A +F" 4 [8 + A F] C | 2 "C +A" 4 "B +G" | 2 "A +F"

You can just copy and paste this into your text editor and save it as a text file, say “grace.txt”, and then run piano on it:

  • ~/bin/piano grace.txt

Some of the special features of piano that this melody uses is the ability to play simultaneous lines of notes. Each bass line here is surrounded in square brackets so as to play at the same time as the treble line that follows it. Within each line, you’ll see other square brackets. For example, “[8 F A] 4 +F” means that the F and A in square brackets are played as eighth notes; the “4 +F” that follows it is a quarter note F an octave higher played at the same time.

  1. The square brackets mean the F eight note starts at the same moment as the F quarter note.
  2. The 8 means the following two notes are an eighth note.
  3. The 4 means the following notes are quarter notes.1
  4. The + before the F raises that F an octave higher.

You’ll also see extensive use of dotted notes throughout the piece. See 42 Astoundingly Useful Scripts for more about the piano script.

One of the useful reasons for putting your music in a file a line at a time like this is that it makes it easy to separate out the bass and treble clefs. This in turn makes it easy to assign them different instruments in GarageBand. Remember, when copying out the bass lines, to (a) remove the square brackets (or all lines will play at the same time) and to remove the double dashes in front of each line after the first (otherwise, it will drop the melody two octaves extra in the second line, and another two octaves in the third).

For this mp3 file, I’ve used a Steinway Grand for the treble clef, and a bass organ for the bass clef.

And for your listening pleasure, one of my favorite renditions of Amazing Grace:

  1. The 4 isn’t needed because of the 8. Note durations inside of brackets do not propagate outside of the brackets. The 4 is needed because the notes preceding these two sets were half-notes.

  1. <- Piano reference