Humdrum lab 5

From CCARH Wiki
Jump to navigation Jump to search

This lab is about the wikifonia data.

Basic information

How many files

   ls *.krn | wc -l

How many have lyrics:

    grep -l "\*\*text" *.krn | wc -l

How many have chords:

    grep -l "\*\*text" *.krn | wc -l

How many have two or more verses:

    grep -l "\*\*text.*\*\*text" *.krn | wc -l

Bibliographic information

Who are the top 10 represented composer in the data:

  grep -h COM *.krn | sortcount | head -n 10
  132	!!!COM:	Unknown
  121	!!!COM:	Hungarian folk song
  119	!!!COM:	Traditional
  91	!!!COM:	Richard Rodgers
  75	!!!COM:	Irving Berlin
  67	!!!COM:	Hungarian song
  65	!!!COM:	Cole Porter
  46	!!!COM:	Harry Warren
  45	!!!COM:	George Gershwin
  40	!!!COM:	Harold Arlen

List the titles of all pieces where George Gershwin is the composer:

  grep OTL  $(grep -li  COM.*Gershwin *.krn) | sort -k2
  WF2190.krn:!!!OTL:	'S Wonderful!
  WF2191.krn:!!!OTL:	A FOGGY DAY
  WF2267.krn:!!!OTL:	A Foggy Day
  WF2186.krn:!!!OTL:	A Woman Is A Sometime Thing
  WF2192.krn:!!!OTL:	Bidin' My Time
  WF2178.krn:!!!OTL:	Blues
  WF2193.krn:!!!OTL:	But Not For Me
  WF2194.krn:!!!OTL:	By Strauss
  WF2195.krn:!!!OTL:	Clap yo' hands
  WF2185.krn:!!!OTL:	Do It Again!
  WF2196.krn:!!!OTL:	Embraceable You
  WF2197.krn:!!!OTL:	Fascinating Rhythm
  WF2268.krn:!!!OTL:	For You, For Me, For Evermore
  WF2198.krn:!!!OTL:	How Long Has This Been Going On
  WF2199.krn:!!!OTL:	I Got Plenty o' Nuttin'
  WF2103.krn:!!!OTL:	I Got Rhythm
  WF2200.krn:!!!OTL:	I Got Rhythm
  WF2222.krn:!!!OTL:	I Loves You Porgy
  WF2201.krn:!!!OTL:	I Was Doing All Right
  WF2202.krn:!!!OTL:	I Was Doing All Right
  WF2179.krn:!!!OTL:	I loves you Porgy
  WF2184.krn:!!!OTL:	I'll Build A Stairway To Paradise
  WF2203.krn:!!!OTL:	I've Got A Crush On You
  WF2204.krn:!!!OTL:	Isn't It A Pity
  WF2221.krn:!!!OTL:	It Ain't Necessarily So
  WF2205.krn:!!!OTL:	Let's Call the Whole Thing Off
  WF2220.krn:!!!OTL:	Liza
  WF2219.krn:!!!OTL:	Liza (All the clouds'll roll away)
  WF2269.krn:!!!OTL:	Love Is Here To Stay
  WF2206.krn:!!!OTL:	Love Walked In
  WF2223.krn:!!!OTL:	My Man's Gone Now
  WF2207.krn:!!!OTL:	Nice Work If You Can Get It
  WF2208.krn:!!!OTL:	Oh Lady Be Good
  WF2189.krn:!!!OTL:	SUMMERTIME
  WF2995.krn:!!!OTL:	Shoes With Wings On
  WF2183.krn:!!!OTL:	Somebody Loves Me
  WF2209.krn:!!!OTL:	Someone To Watch Over Me
  WF2210.krn:!!!OTL:	Soon
  WF2211.krn:!!!OTL:	Strike Up The Band
  WF2180.krn:!!!OTL:	Summertime
  WF2181.krn:!!!OTL:	Summertime
  WF2187.krn:!!!OTL:	Summertime
  WF2212.krn:!!!OTL:	Summertime
  WF2224.krn:!!!OTL:	Swanee
  WF2213.krn:!!!OTL:	That Certain Feeling
  WF2214.krn:!!!OTL:	The Man I Love
  WF2225.krn:!!!OTL:	The Simple Life
  WF2188.krn:!!!OTL:	There's A Boat Dat's Leaving Soon For New York
  WF2215.krn:!!!OTL:	They All Laughed
  WF2216.krn:!!!OTL:	They Can't Take That Away From Me
  WF2217.krn:!!!OTL:	They Can't Take That Away From Me
  WF2218.krn:!!!OTL:	Who Cares


How many contain more than one **kern spine (i.e., are polyphonic, probably piano):

   grep -l "\*\*kern.*\*\*kern" *.krn | wc -l

WF5118.krn is an example:


This one is interesting because it has invisible chords in the top staff which are realizing the harmonic chords above the staff.

How many songs have chords:

  for i in *.krn 
     extractx -i kern $i | serialize | ridx -H | grep " " | wc -l
  done | grep -v " ^0$" | wc -l

There are


What is the duration of all songs if played back-to-back and at the specified tempo without repeats?

   gettime -T *.krn | tail -n 1
   286:50:23.1354 hours

What are the longest songs:

    gettime --simple -T *.krn | sort -k2 -nr | head -n 10
    WF6618.krn:	3120
    WF0181.krn:	3120
    WF0182.krn:	1864
    WF3616.krn:	1420
    WF6336.krn:	1134
    WF5131.krn:	909
    WF6068.krn:	785
    WF5004.krn:	696
    WF3226.krn:	671
    WF1249.krn:	664

The -k2 option means to sort by the second column of data. -n means to sort numerically rather than alphabetically, and -r means to sort by highest first.

What are the shortest songs:

    gettime --simple -T *.krn | sort -k2 -nr | tail -n 10
    WF2814.krn:	16
    WF2806.krn:	16
    WF2795.krn:	16
    WF2785.krn:	16
    WF2856.krn:	14
    WF2852.krn:	12
    WF2799.krn:	12
    WF6338.krn:	8
    WF5609.krn:	8
 The shortest song in VHV:
    cat WF5609.krn | pbcopy


What sort of meters are in the database and how much of each type?

    beat -Ca *.krn | beat -Ua  | extractx -s '$1-$'  | ridx -H | sortcount -p
    65.89	4	4
    15.44	3	4
    11.67	2	2
    3.24	2	4
    2.78	6	8
    0.52	12	8
    0.16	5	4
    0.14	9	8
    0.09	6	4
    0.06	3	8
    0.01	3	2
    0.01	7	4
    0     	2	8
    0     	7	8
    0     	9	4
    0     	10	8
    0     	17	16
    0     	1	2
    0     	5	8
    0     	1	4
    0     	4	8

The most common meter is 4/4, where 65% of the music is in that meter.

-C means extract the count of the meter (the top number).

-U means extract the duration unit from the meter (the bottom number).

-C and -U are output once for each measure, so using these are a simple way of counting the number of measures in the scores. If you add -F option with these two options, every data line will display the metrical information.

-a means to append the analysis to the end of the lines (keeping the original input score).

The extract option:

    -s '$1-$'

means to extract from one before the last spine to the last spine. $1 is one before the last spine, $2 is two before the last spine, and so on.

Chord labels

How many unique chord labels are there?

   extractx -i mxhm  * | ridx -H | sortcount | wc -l

What are the most common ones:

   extractx -i mxhm  * | ridx -H | sortcount -p | head -n 10
   7.21	C major
   6.14	F major
   4.94	G major
   4.83	G dominant
   4.07	C dominant
   3.55	D dominant
   3.28	B- major
   2.81	E- major
   2.3	D major
   2.25	F dominant