Music 824: Computer Applications in Music Research
Ohio State University
School of Music


Humdrum Practice Exercise #2


For this exercise you will need to know how to use a text editor like pico, vi or emacs. In addition, you will need to know the following commands:

UNIX Commands Humdrum Commands
grep ls
grep -h wc
   

Change directories /var/share/Humdrum/Music824/Scores and find the directory containing Ojibway songs. These songs were collected by Frances Densmore between 1907 and 1909. Answer the following questions.

  1. How many Ojibway songs are present in this directory?
    COMMAND:     ls ojib*.krn | wc
    ANSWER:         370 songs files
    Note that the "ls" command behaves differently depending on whether or not its output is "piped" to another process. When "ls" is not piped, it formats the list of files with several files on each output line -- so it is easier to see all of the files in a directory on the computer display. However, when piped, "ls" generates a single column list of files (in alphabetical order) so each line of output contains a single filename. This allows commands like "wc" to be able to count the files as "the number of lines". In order to see the difference, compare the command "ls" with the command "ls | more".

  2. What proportion of the Ojibway songs are sung by women?
    COMMAND:     grep '\*Ifeme' ojib*.krn | wc
    COMMAND:     grep '\*Imale' ojib*.krn | wc
    ANSWER:        
  3. The names of the singers are coded in the "MPN" reference record. Who sang the most number of songs for Densmore?
    COMMAND:     grep -h '!!MPN:' ojib*.krn | sort | uniq -c | sort -n
    ANSWER:         E'niwub'e
  4. In this encoded collection, drum patterns have been encoded using a simple comment "!! Drum-pattern". How many different drum patterns are present in Densmore's collection?
    COMMAND:     grep -h '!! Drum-rhythm:' ojib*.krn | sort | uniq
    ANSWER:         Eleven drum patterns are present.
  5. Which drum pattern is the most frequently used?
    COMMAND:     grep -h '!! Drum-rhythm:' ojib*.krn | sort | uniq -c
    ANSWER:         Two patterns are tied for first place.
                        (12^ 12r 12 12^ 12r 12)
                        (8 8 8 8 8 8)
  6. Most of the songs Densmore collected in Minnesota. What other state(s) did Densmore collect Ojibway songs?

    Return to Exercises and Assignments Index
    Return to Music 824 Index