Scarlet & Grey
Ohio State University
School of Music





Music 824: Assignment #3 - Answers


All of the following commands assume that you are located in the appropriate score directory.

  1. Does Corelli prefer major keys or minor keys? Which key does Corelli use most often?
    COMMAND:     cat *.krn | grep '^\*[A-G][-#]*:'
                                cat *.krn | grep '^\*[a-g][-#]*:'
    ANSWER:         prefers minor keys
    COMMAND:     cat *.krn | grep '^\*[A-Ga-g][-#]*:' | sort | uniq -c | sort -n
    OR:         grep -h '^\*[A-Ga-g][-#]*:' *.krn | sort | uniq -c | sort -n
    ANSWER:         G minor and B minor
  2. In the Polish folksong collection, how frequently does the first scale degree appear? How frequently does the fifth scale degree appear?
    COMMAND:     solfa polska*.krn | rid -GLId | grep -c do
                                solfa polska*.krn | rid -GLId | grep -c so
    ANSWER:         tonic: 197 dominant: 216
  3. How many notes are there in the second phrase of the German folksong "Die Rabenmutter ..."?
    COMMAND:     grep -i 'OTL:.*Beim Herumtrinken' *.krn [file:deut4048.krn]
    COMMAND:     yank -o { -r 2 deut4048.krn | census -k
    ANSWER:         6 notes
  4. How many notes are there in measures 5 to 8 (inclusive) in the Romanian "romani24.krn" folksong?
    COMMAND:     yank -n ^= -r 5-8 romani24.krn | census -k
    ANSWER:         19 notes
  5. How many phrases are there in "romani08.krn"?
    COMMAND:     grep -c { romani08.krn
    ANSWER:         6 phrases
    What is the highest pitch in the fourth phrase?
    COMMAND:     yank -o { -r 4 romani08.krn | census -k
    ANSWER:         cc# (or C#5)
  6. What is the lowest pitch in the Bach chorale harmonizations?
    COMMAND:     census -k bwv*.krn
    ANSWER:         CC (or C2)
    In how many chorales does this lowest pitch occur?
    COMMAND:     grep -l CC bwv*.krn | wc
            Better yet, also check to ensure there are no CC# pitches that are being caught:
                                grep -l CC# bwv*.krn | wc
            Another possibility:
                                grep -l CC bwv*.krn | grep -c .

    ANSWER:         20
    Which chorales contain more than one occurrence of this low pitch?
    COMMAND:     grep -c CC bwv*.krn | grep -v ':[01]$'
    ANSWER:         bwv0292.krn, bwv0346.krn, bwv0365.krn
  7. How many notes are there in the harpsichord (cembalo) part between measures 202 and 211 (inclusive) in the first movement of Brandenburg Concerto No. 5?
    COMMAND:     extract -i '*Icemba' bwv1050a.krn | yank -n ^= -r 202-211 | census -k
    ANSWER:         372
  8. How many perfect fourth intervals occur between measures 8 and 20 (inclusive) in the vocal part of Franz Schubert's "Das Wandern"?
    COMMAND:     grep -i 'Das Wandern' *.krn [schub18.krn]
                                mint schub18.krn | yank -n ^= -r 8-20 | rid -GLId | grep -c 'P4'
    ANSWER:         4