Difference between revisions of "Humdrum homework"
Line 12: | Line 12: | ||
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> | ||
+ | |||
+ | <script src="https://cdn.jsdelivr.net/npm/vega@4.4.0"></script> | ||
+ | <script src="https://cdn.jsdelivr.net/npm/vega-lite@3.0.0-rc12"></script> | ||
+ | <script src="https://cdn.jsdelivr.net/npm/vega-embed@3.29.1"></script> | ||
+ | |||
+ | <div id="plotarea"></div> | ||
+ | <script type="text/javascript"> | ||
+ | var mydata = | ||
+ | { | ||
+ | "$schema": 'https://vega.github.io/schema/vega-lite/v3.json', | ||
+ | "width": 600, | ||
+ | "title": 'Tenor melodic intervals', | ||
+ | "data": { | ||
+ | "values": | ||
+ | [ | ||
+ | {"category": '-M2', "percent": 20.75}, | ||
+ | {"category": 'P1', "percent": 19.41}, | ||
+ | {"category": '+M2', "percent": 17.43}, | ||
+ | {"category": '-m2', "percent": 12.93}, | ||
+ | {"category": '+m2', "percent": 10.04}, | ||
+ | {"category": '+P4', "percent": 4.85}, | ||
+ | {"category": '-m3', "percent": 2.45}, | ||
+ | {"category": '-M3', "percent": 2.19}, | ||
+ | {"category": '-P5', "percent": 2.03}, | ||
+ | {"category": '+m3', "percent": 1.61}, | ||
+ | {"category": '-P4', "percent": 1.61}, | ||
+ | {"category": '+P5', "percent": 1.19}, | ||
+ | {"category": '+M3', "percent": 1.06}, | ||
+ | {"category": '-d5', "percent": 0.49}, | ||
+ | {"category": '+m6', "percent": 0.36}, | ||
+ | {"category": '+M6', "percent": 0.32}, | ||
+ | {"category": 'A1', "percent": 0.27}, | ||
+ | {"category": '+P8', "percent": 0.24}, | ||
+ | {"category": 'd1', "percent": 0.18}, | ||
+ | {"category": '-P8', "percent": 0.14}, | ||
+ | {"category": '-M6', "percent": 0.11}, | ||
+ | {"category": '+d4', "percent": 0.1}, | ||
+ | {"category": '-m6', "percent": 0.09}, | ||
+ | {"category": '+d5', "percent": 0.07}, | ||
+ | {"category": '-d4', "percent": 0.05}, | ||
+ | {"category": '+m7', "percent": 0.02}, | ||
+ | {"category": '+d7', "percent": 0}, | ||
+ | {"category": '-d7', "percent": 0}, | ||
+ | {"category": '-A4', "percent": 0} | ||
+ | ] | ||
+ | }, | ||
+ | "mark": 'bar', | ||
+ | "encoding": { | ||
+ | "x": { | ||
+ | "field": 'category', | ||
+ | "title": 'x-axis label', | ||
+ | "type": 'ordinal', | ||
+ | "axis": {"labelAngle": -90 }, | ||
+ | "sort": ["-P8","-d7","-M6","-m6","-P5","-d5","-A4","-P4","-d4","-M3","-m3","-M2","-m2","d1","P1","A1","+m2","+M2","+m3","+M3","+d4","+P4","+d5","+P5","+m6","+M6","+d7","+m7","+P8"] | ||
+ | |||
+ | }, | ||
+ | "y": { | ||
+ | "field": 'percent', | ||
+ | "title": 'percent', | ||
+ | "type": 'quantitative' | ||
+ | }, | ||
+ | "tooltip": { | ||
+ | "field": 'percent', | ||
+ | "type": 'quantitative' | ||
+ | }, | ||
+ | "color": { | ||
+ | "field": 'category', | ||
+ | "type": 'nominal', | ||
+ | "legend": null | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ; | ||
+ | |||
+ | vegaEmbed('#plotarea', mydata); | ||
+ | </script> | ||
+ | |||
+ | </html> | ||
Revision as of 18:33, 7 March 2019
Contents
Music 253 Humdrum Homework
Examine the 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 | grep -v r | ridx -H | grep -v [[] | \ sortcount -vp --sort interval -T "Tenor melodic intervals" > melodic-tenor.html
This plot should be displayed when opening up the generated HTML file:
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)?
2. Which part has the most leaps (intervals greater than 2 or less than -2)?
Scale Degrees
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:
3. What is the most common harmonic interval between each part pair?