Difference between revisions of "Humdrum homework"
(25 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Music 253 Humdrum Homework == | == Music 253 Humdrum Homework == | ||
− | Examine | + | Examine melodic and harmonic properties of the Bach chorale data set. Refer to [[Humdrum Lab 1]] for how to download the chorales (and install the tools useful for the homework). |
=== Melodic intervals === | === Melodic intervals === | ||
Line 7: | Line 7: | ||
Here is a template for extracting the melodic intervals for the tenor part in the chorales and plotting them in a histogram by percentages: | Here is a template for extracting the melodic intervals for the tenor part in the chorales and plotting them in a histogram by percentages: | ||
− | extractx -s 2 *.krn | mint | ridx -H | grep -v [r[] | \ | + | extractx -s 2 *.krn | mint | ridx -H | grep -v "[r[]" | \ |
− | sortcount -vp --sort interval -T "Tenor melodic intervals" > melodic-tenor.html | + | sortcount -vp --sort interval \ |
+ | -T "Tenor melodic intervals" > melodic-tenor.html | ||
The following plot should be displayed when opening up the generated HTML file: | The following plot should be displayed when opening up the generated HTML file: | ||
Line 97: | Line 98: | ||
Also make plots for bass (spine 1), alto (spine 3), and soprano (spine 4) and visually compare the plots to each other. | Also make plots for bass (spine 1), alto (spine 3), and soprano (spine 4) and visually compare the plots to each other. | ||
− | Questions | + | ==== Questions ==== |
1. Which part has the most repetitions (P1 interval)? And which has the least repetitions? | 1. Which part has the most repetitions (P1 interval)? And which has the least repetitions? | ||
− | 2. Which part has the most leaps (intervals greater than 2 or less than -2)? | + | 2. Which part has the most leaps (intervals greater than +2 or less than -2)? |
3. Which stepwise direction is more common in each voice, going up a step or down a step? A "step" should be considered the sum of the "m2" and "M2" categories. | 3. Which stepwise direction is more common in each voice, going up a step or down a step? A "step" should be considered the sum of the "m2" and "M2" categories. | ||
Line 107: | Line 108: | ||
4. Is it more common to leap up or down in each voice (sum all of the [most common] intervals above +2/below -2)? | 4. Is it more common to leap up or down in each voice (sum all of the [most common] intervals above +2/below -2)? | ||
− | === | + | === Melodic sequences === |
+ | |||
+ | This section uses the Humdrum Tools' "context" command to examine successive pairs of melodic intervals. Here is an example of extracting the two-interval melodic sequences (representing three notes) in the tenor part: | ||
+ | |||
+ | extractx -s 2 *.krn | mint | grep -v "[r=[]" | context -n 2 | ridx -H | \ | ||
+ | sortcount -pv --min 0.5 \ | ||
+ | -T "3-note melodic sequences in the tenor part" > analysis.html | ||
+ | |||
+ | This should be the resulting plot: | ||
+ | |||
+ | <html> | ||
+ | |||
+ | <div id="plotarea3"></div> | ||
+ | <script type="text/javascript"> | ||
+ | var mydata3 = | ||
+ | { | ||
+ | "$schema": 'https://vega.github.io/schema/vega-lite/v3.json', | ||
+ | "width": 600, | ||
+ | "title": '3-note melodic sequences in the tenor part', | ||
+ | "data": { | ||
+ | "values": | ||
+ | [ | ||
+ | {"category": '-M2 -m2', "percent": 5.61}, | ||
+ | {"category": 'P1 P1', "percent": 5.25}, | ||
+ | {"category": '-M2 -M2', "percent": 4.92}, | ||
+ | {"category": 'P1 -M2', "percent": 4.45}, | ||
+ | {"category": '+M2 +M2', "percent": 4.34}, | ||
+ | {"category": '-m2 -M2', "percent": 4.09}, | ||
+ | {"category": '-M2 +M2', "percent": 3.89}, | ||
+ | {"category": '+M2 +m2', "percent": 3.68}, | ||
+ | {"category": '-M2 P1', "percent": 3.66}, | ||
+ | {"category": '+M2 -M2', "percent": 3.65}, | ||
+ | {"category": '+m2 +M2', "percent": 3.42}, | ||
+ | {"category": '-m2 +m2', "percent": 3.24}, | ||
+ | {"category": 'P1 -m2', "percent": 2.92}, | ||
+ | {"category": 'P1 +M2', "percent": 2.66}, | ||
+ | {"category": '+m2 -m2', "percent": 2.63}, | ||
+ | {"category": '+M2 P1', "percent": 2.4}, | ||
+ | {"category": '-m2 P1', "percent": 1.7}, | ||
+ | {"category": '+m2 P1', "percent": 1.66}, | ||
+ | {"category": '+P4 P1', "percent": 1.5}, | ||
+ | {"category": '+P4 -M2', "percent": 1.37}, | ||
+ | {"category": 'P1 +m2', "percent": 1.16}, | ||
+ | {"category": '+M2 -P5', "percent": 1.05}, | ||
+ | {"category": '-m2 -M3', "percent": 0.95}, | ||
+ | {"category": '-m2 +P4', "percent": 0.84}, | ||
+ | {"category": '-M2 +P4', "percent": 0.75}, | ||
+ | {"category": '+P4 -m2', "percent": 0.66}, | ||
+ | {"category": 'P1 +P4', "percent": 0.64}, | ||
+ | {"category": '-P5 +M2', "percent": 0.64}, | ||
+ | {"category": '-m3 +m2', "percent": 0.63}, | ||
+ | {"category": '+M2 -M3', "percent": 0.58}, | ||
+ | {"category": 'P1 -m3', "percent": 0.57}, | ||
+ | {"category": '-m2 +m3', "percent": 0.52}, | ||
+ | {"category": '-m3 +P4', "percent": 0.52}, | ||
+ | {"category": '+m3 P1', "percent": 0.51}, | ||
+ | {"category": '-M2 +P5', "percent": 0.5} | ||
+ | ] | ||
+ | }, | ||
+ | "mark": 'bar', | ||
+ | "encoding": { | ||
+ | "x": { | ||
+ | "field": 'category', | ||
+ | "title": 'x-axis label', | ||
+ | "type": 'ordinal', | ||
+ | "axis": {"labelAngle": -90 }, | ||
+ | "sort": 'percent' | ||
+ | |||
+ | }, | ||
+ | "y": { | ||
+ | "field": 'percent', | ||
+ | "title": 'percent', | ||
+ | "type": 'quantitative' | ||
+ | }, | ||
+ | "tooltip": { | ||
+ | "field": 'percent', | ||
+ | "type": 'quantitative' | ||
+ | }, | ||
+ | "color": { | ||
+ | "field": 'category', | ||
+ | "type": 'nominal', | ||
+ | "legend": null | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ; | ||
+ | |||
+ | vegaEmbed('#plotarea3', mydata3); | ||
+ | </script> | ||
+ | |||
+ | </html> | ||
+ | |||
+ | Notice that the most common two-interval (three-note) sequence is "-M2 -m2", meaning down a major second and then down a minor second. | ||
+ | |||
+ | Create similar plots for the other voices. | ||
+ | |||
+ | ==== Questions ==== | ||
+ | |||
+ | 5. What is the most common two-interval melodic sequence for each voice? | ||
+ | |||
+ | 6. What is the most common two-interval melodic sequence for each voice that contains a leap (an interval of 3 or higher)? | ||
=== Harmonic intervals === | === Harmonic intervals === | ||
Line 114: | Line 215: | ||
Here is an example of how to extract the harmonic intervals between the soprano and bass parts: | Here is an example of how to extract the harmonic intervals between the soprano and bass parts: | ||
− | extractx -s 1,4 *.krn | hint | ridx -H | grep -v [r-] | sortcount -pv -T "Harmonic intervals between Soprano and Bass" --sort interval > analysis.html | + | extractx -s 1,4 *.krn | hint | ridx -H | grep -v "[r-]" | \ |
+ | sortcount -pv -T "Harmonic intervals between Soprano and Bass" \ | ||
+ | --sort interval > analysis.html | ||
This plot should be displayed when opening up the generated HTML file: | This plot should be displayed when opening up the generated HTML file: | ||
+ | <html> | ||
+ | |||
+ | <div id="plotarea2"></div> | ||
+ | <script type="text/javascript"> | ||
+ | var mydata2 = | ||
+ | { | ||
+ | "$schema": 'https://vega.github.io/schema/vega-lite/v3.json', | ||
+ | "width": 600, | ||
+ | "title": 'Harmonic intervals between Soprano and Bass', | ||
+ | "data": { | ||
+ | "values": | ||
+ | [ | ||
+ | {"category": 'P12', "percent": 16.37}, | ||
+ | {"category": 'P15', "percent": 13.42}, | ||
+ | {"category": 'M10', "percent": 12.76}, | ||
+ | {"category": 'm10', "percent": 12.32}, | ||
+ | {"category": 'm13', "percent": 9.72}, | ||
+ | {"category": 'M13', "percent": 8.27}, | ||
+ | {"category": 'm17', "percent": 5.83}, | ||
+ | {"category": 'M17', "percent": 4.77}, | ||
+ | {"category": 'P8', "percent": 4.58}, | ||
+ | {"category": 'P5', "percent": 1.53}, | ||
+ | {"category": 'd12', "percent": 1.29}, | ||
+ | {"category": 'P11', "percent": 1.28}, | ||
+ | {"category": 'm14', "percent": 1.26}, | ||
+ | {"category": 'P19', "percent": 1.14}, | ||
+ | {"category": 'M6', "percent": 0.84}, | ||
+ | {"category": 'M9', "percent": 0.75}, | ||
+ | {"category": 'M16', "percent": 0.58}, | ||
+ | {"category": 'A11', "percent": 0.5}, | ||
+ | {"category": 'M14', "percent": 0.45}, | ||
+ | {"category": 'm20', "percent": 0.42}, | ||
+ | {"category": 'm6', "percent": 0.38}, | ||
+ | {"category": 'P18', "percent": 0.25}, | ||
+ | {"category": 'd19', "percent": 0.25}, | ||
+ | {"category": 'M20', "percent": 0.16}, | ||
+ | {"category": 'm7', "percent": 0.15}, | ||
+ | {"category": 'P22', "percent": 0.15}, | ||
+ | {"category": 'd14', "percent": 0.14}, | ||
+ | {"category": 'M7', "percent": 0.12}, | ||
+ | {"category": 'm16', "percent": 0.07}, | ||
+ | {"category": 'm9', "percent": 0.06}, | ||
+ | {"category": 'd7', "percent": 0.04}, | ||
+ | {"category": 'A12', "percent": 0.04}, | ||
+ | {"category": 'm24', "percent": 0.02}, | ||
+ | {"category": 'm3', "percent": 0.02}, | ||
+ | {"category": 'm21', "percent": 0.02}, | ||
+ | {"category": 'A18', "percent": 0.02}, | ||
+ | {"category": 'M2', "percent": 0.01}, | ||
+ | {"category": 'A16', "percent": 0.01}, | ||
+ | {"category": 'A4', "percent": 0.01}, | ||
+ | {"category": 'A9', "percent": 0.01}, | ||
+ | {"category": 'M24', "percent": 0.01}, | ||
+ | {"category": 'M3', "percent": 0.01}, | ||
+ | {"category": 'd5', "percent": 0.01} | ||
+ | ] | ||
+ | }, | ||
+ | "mark": 'bar', | ||
+ | "encoding": { | ||
+ | "x": { | ||
+ | "field": 'category', | ||
+ | "title": 'x-axis label', | ||
+ | "type": 'ordinal', | ||
+ | "axis": {"labelAngle": -90 }, | ||
+ | "sort": ["M2","m3","M3","A4","d5","P5","m6","M6","d7","m7","M7","P8","m9","A9","M9","m10","M10","P11","A11","d12","P12","A12","m13","M13","d14","m14","M14","P15","m16","A16","M16","m17","M17","P18","A18","d19","P19","m20","M20","m21","P22","m24","M24"] | ||
− | + | }, | |
+ | "y": { | ||
+ | "field": 'percent', | ||
+ | "title": 'percent', | ||
+ | "type": 'quantitative' | ||
+ | }, | ||
+ | "tooltip": { | ||
+ | "field": 'percent', | ||
+ | "type": 'quantitative' | ||
+ | }, | ||
+ | "color": { | ||
+ | "field": 'category', | ||
+ | "type": 'nominal', | ||
+ | "legend": null | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ; | ||
+ | vegaEmbed('#plotarea2', mydata2); | ||
+ | </script> | ||
+ | |||
+ | |||
+ | |||
+ | </html> | ||
Make plots comparing each pair of parts bass (spine 1), tenor (spine 2), alto (spine 3), and soprano (spine 4), which is a total of 6 plots. | Make plots comparing each pair of parts bass (spine 1), tenor (spine 2), alto (spine 3), and soprano (spine 4), which is a total of 6 plots. | ||
− | Questions: | + | ==== Questions ==== |
+ | |||
+ | 7. What is the most common harmonic interval between each part pair? | ||
+ | |||
+ | === Scale Degrees === | ||
+ | |||
+ | Here is an example of how to calculate the most common diatonic scale degrees in all parts for the Bach chorale data set: | ||
+ | |||
+ | serialize *.krn | deg -a | ridx -H | grep -v r \ | ||
+ | | sed 's/[^1-7]//g' | sortcount -p | ||
+ | |||
+ | which should generate this data: | ||
+ | |||
+ | 18.85 5 | ||
+ | 18.24 1 | ||
+ | 14.53 3 | ||
+ | 13.08 2 | ||
+ | 12.46 4 | ||
+ | 12.32 7 | ||
+ | 10.51 6 | ||
+ | |||
+ | The most common scale degree is the 5th degree (G in the key of C), followed closely by the 1st scale degree (C in the key of C). | ||
+ | |||
+ | And here is an example of how to calculate the frequencies of scale degress in a particular part: | ||
+ | |||
+ | extractx -s 2 *.krn | deg -a | ridx -H | grep -v r | sed 's/[^1-7]//g' | sortcount -p | ||
+ | |||
+ | |||
+ | ==== Questions ==== | ||
+ | |||
+ | 8. What is the most common scale degree in each part? | ||
+ | |||
+ | 9. If each part were to sing their most common note in C major, what [chord] should we hear? | ||
− | + | 10. Use the context tool to calculate the most common three-interval (four-note) melodic sequence in all parts. |
Latest revision as of 04:34, 18 March 2021
Contents
Music 253 Humdrum Homework
Examine melodic and harmonic properties of the Bach chorale data set. Refer to Humdrum Lab 1 for how to download the chorales (and install the tools useful for the homework).
Melodic intervals
Here is a template for extracting the melodic intervals for the tenor part in the chorales and plotting them in a histogram by percentages:
extractx -s 2 *.krn | mint | ridx -H | grep -v "[r[]" | \ sortcount -vp --sort interval \ -T "Tenor melodic intervals" > melodic-tenor.html
The following plot should be displayed when opening up the generated HTML file:
[Move your mouse over the histogram bars to view the numeric values for the percentages.]
Also make plots for bass (spine 1), alto (spine 3), and soprano (spine 4) and visually compare the plots to each other.
Questions
1. Which part has the most repetitions (P1 interval)? And which has the least repetitions?
2. Which part has the most leaps (intervals greater than +2 or less than -2)?
3. Which stepwise direction is more common in each voice, going up a step or down a step? A "step" should be considered the sum of the "m2" and "M2" categories.
4. Is it more common to leap up or down in each voice (sum all of the [most common] intervals above +2/below -2)?
Melodic sequences
This section uses the Humdrum Tools' "context" command to examine successive pairs of melodic intervals. Here is an example of extracting the two-interval melodic sequences (representing three notes) in the tenor part:
extractx -s 2 *.krn | mint | grep -v "[r=[]" | context -n 2 | ridx -H | \ sortcount -pv --min 0.5 \ -T "3-note melodic sequences in the tenor part" > analysis.html
This should be the resulting plot:
Notice that the most common two-interval (three-note) sequence is "-M2 -m2", meaning down a major second and then down a minor second.
Create similar plots for the other voices.
Questions
5. What is the most common two-interval melodic sequence for each voice?
6. What is the most common two-interval melodic sequence for each voice that contains a leap (an interval of 3 or higher)?
Harmonic intervals
Here is an example of how to extract the harmonic intervals between the soprano and bass parts:
extractx -s 1,4 *.krn | hint | ridx -H | grep -v "[r-]" | \ sortcount -pv -T "Harmonic intervals between Soprano and Bass" \ --sort interval > analysis.html
This plot should be displayed when opening up the generated HTML file:
Make plots comparing each pair of parts bass (spine 1), tenor (spine 2), alto (spine 3), and soprano (spine 4), which is a total of 6 plots.
Questions
7. What is the most common harmonic interval between each part pair?
Scale Degrees
Here is an example of how to calculate the most common diatonic scale degrees in all parts for the Bach chorale data set:
serialize *.krn | deg -a | ridx -H | grep -v r \ | sed 's/[^1-7]//g' | sortcount -p
which should generate this data:
18.85 5 18.24 1 14.53 3 13.08 2 12.46 4 12.32 7 10.51 6
The most common scale degree is the 5th degree (G in the key of C), followed closely by the 1st scale degree (C in the key of C).
And here is an example of how to calculate the frequencies of scale degress in a particular part:
extractx -s 2 *.krn | deg -a | ridx -H | grep -v r | sed 's/[^1-7]//g' | sortcount -p
Questions
8. What is the most common scale degree in each part?
9. If each part were to sing their most common note in C major, what [chord] should we hear?
10. Use the context tool to calculate the most common three-interval (four-note) melodic sequence in all parts.