Overview#
This notebook gives a general overview of the features included in the dataset.
Show imports
%load_ext autoreload
%autoreload 2
import os
import dimcat as dc
import pandas as pd
import plotly.express as px
from dimcat import filters, plotting
from IPython.display import display
import utils
RESULTS_PATH = os.path.abspath(os.path.join(utils.OUTPUT_FOLDER, "overview"))
os.makedirs(RESULTS_PATH, exist_ok=True)
def make_output_path(
filename: str,
extension=None,
path=RESULTS_PATH,
) -> str:
return utils.make_output_path(filename=filename, extension=extension, path=path)
def save_figure_as(
fig, filename, formats=("png", "pdf"), directory=RESULTS_PATH, **kwargs
):
if formats is not None:
for fmt in formats:
plotting.write_image(fig, filename, directory, format=fmt, **kwargs)
else:
plotting.write_image(fig, filename, directory, **kwargs)
Loading data
D = utils.get_dataset("mozart_piano_sonatas", corpus_release="v2.3")
package = D.inputs.get_package()
package_info = package._package.custom
git_tag = package_info.get("git_tag")
utils.print_heading("Data and software versions")
print("The Annotated Mozart Sonatas: Score, Harmony, and Cadence version v2.3")
print(f"Datapackage '{package.package_name}' @ {git_tag}")
print(f"dimcat version {dc.__version__}\n")
D
Data and software versions
--------------------------
The Annotated Mozart Sonatas: Score, Harmony, and Cadence version v2.3
Datapackage 'mozart_piano_sonatas' @ v2.3
dimcat version 3.4.0
Dataset
=======
{'inputs': {'basepath': None,
'packages': {'mozart_piano_sonatas': ["'mozart_piano_sonatas.measures' "
'(MuseScoreFacetName.MuseScoreMeasures)',
"'mozart_piano_sonatas.notes' (MuseScoreFacetName.MuseScoreNotes)",
"'mozart_piano_sonatas.expanded' "
'(MuseScoreFacetName.MuseScoreHarmonies)',
"'mozart_piano_sonatas.chords' (MuseScoreFacetName.MuseScoreChords)",
"'mozart_piano_sonatas.metadata' (FeatureName.Metadata)"]}},
'outputs': {'basepath': None, 'packages': {}},
'pipeline': []}
filtered_D = filters.HasHarmonyLabelsFilter(keep_values=[True]).process(D)
all_metadata = filtered_D.get_metadata()
assert len(all_metadata) > 0, "No pieces selected for analysis."
all_metadata
TimeSig | KeySig | last_mc | last_mn | length_qb | last_mc_unfolded | last_mn_unfolded | length_qb_unfolded | volta_mcs | all_notes_qb | ... | imslp | musicbrainz | originalFormat | typesetter | viaf | wikidata | staff_1_ambitus | staff_1_instrument | staff_2_ambitus | staff_2_instrument | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
corpus | piece | |||||||||||||||||||||
mozart_piano_sonatas | K279-1 | {1: '4/4'} | {1: 0} | 100 | 100 | 400.00 | 200 | 200 | 800.00 | () | 767.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.1_in_C_... | https://musicbrainz.org/work/62c0bdd8-46ca-4e1... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2194957 | 48-88 (C3-E6) | Klavier linke Hand | 31-74 (G1-D5) | Klavier linke Hand |
K279-2 | {1: '3/4'} | {1: -1} | 76 | 74 | 222.00 | 152 | 148 | 444.00 | () | 560.83 | ... | https://imslp.org/wiki/Piano_Sonata_No.1_in_C_... | https://musicbrainz.org/work/62c0bdd8-46ca-4e1... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2194958 | 57-86 (A3-D6) | Klavier linke Hand | 35-79 (B1-G5) | Klavier linke Hand | |
K279-3 | {1: '2/4'} | {1: 0} | 160 | 158 | 316.00 | 320 | 316 | 632.00 | () | 699.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.1_in_C_... | https://musicbrainz.org/work/62c0bdd8-46ca-4e1... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2194959 | 54-88 (F#3-E6) | Klavier linke Hand | 35-79 (B1-G5) | Klavier linke Hand | |
K280-1 | {1: '3/4'} | {1: -1} | 144 | 144 | 432.00 | 288 | 288 | 864.00 | () | 911.33 | ... | https://imslp.org/wiki/Piano_Sonata_No.2_in_F_... | https://musicbrainz.org/work/52912ca4-855d-451... | cap | Tobias Schölkopf | https://viaf.org/viaf/185925450 | http://www.wikidata.org/entity/Q954538 | 55-86 (G3-D6) | Klavier linke Hand | 29-86 (F1-D6) | Klavier linke Hand | |
K280-2 | {1: '6/8'} | {1: -4} | 60 | 60 | 180.00 | 120 | 120 | 360.00 | () | 434.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.2_in_F_... | https://musicbrainz.org/work/52912ca4-855d-451... | cap | Tobias Schölkopf | https://viaf.org/viaf/185925451 | http://www.wikidata.org/entity/Q954539 | 48-87 (C3-Eb6) | Klavier linke Hand | 32-73 (Ab1-Db5) | Klavier linke Hand | |
K280-3 | {1: '3/8'} | {1: -1} | 192 | 190 | 285.00 | 384 | 380 | 570.00 | () | 518.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.2_in_F_... | https://musicbrainz.org/work/52912ca4-855d-451... | cap | Tobias Schölkopf | https://viaf.org/viaf/185925452 | http://www.wikidata.org/entity/Q954540 | 52-89 (E3-F6) | Klavier linke Hand | 33-79 (A1-G5) | Klavier linke Hand | |
K281-1 | {1: '2/4'} | {1: -2} | 109 | 109 | 218.00 | 218 | 218 | 436.00 | () | 487.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.3_in_B-... | https://musicbrainz.org/work/4495fb34-25b6-48f... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2061529 | 53-89 (F3-F6) | Klavier linke Hand | 34-75 (Bb1-Eb5) | Klavier linke Hand | |
K281-2 | {1: '3/8'} | {1: -3} | 106 | 106 | 159.00 | 212 | 212 | 318.00 | () | 334.83 | ... | https://imslp.org/wiki/Piano_Sonata_No.3_in_B-... | https://musicbrainz.org/work/4495fb34-25b6-48f... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2061530 | 53-87 (F3-Eb6) | Klavier linke Hand | 34-70 (Bb1-Bb4) | Klavier linke Hand | |
K281-3 | {1: '2/2'} | {1: -2} | 163 | 162 | 648.00 | 179 | 178 | 712.00 | () | 1443.67 | ... | https://imslp.org/wiki/Piano_Sonata_No.3_in_B-... | https://musicbrainz.org/work/4495fb34-25b6-48f... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2061531 | 62-89 (D4-F6) | Klavier linke Hand | 38-77 (D2-F5) | Klavier linke Hand | |
K282-1 | {1: '4/4'} | {1: -3} | 36 | 36 | 144.00 | 69 | 69 | 276.00 | () | 346.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.4_in_E-... | https://musicbrainz.org/work/97cc4159-c124-48a... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q3964687 | 58-84 (Bb3-C6) | Klavier linke Hand | 43-75 (G2-Eb5) | Klavier linke Hand | |
K282-2 | {1: '3/4'} | {1: -2, 35: -3} | 76 | 72 | 216.00 | 186 | 176 | 528.00 | () | 488.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.4_in_E-... | https://musicbrainz.org/work/97cc4159-c124-48a... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q3964688 | 57-89 (A3-F6) | Klavier linke Hand | 41-70 (F2-Bb4) | Klavier linke Hand | |
K282-3 | {1: '2/4'} | {1: -3} | 104 | 102 | 204.00 | 208 | 204 | 408.00 | () | 468.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.4_in_E-... | https://musicbrainz.org/work/97cc4159-c124-48a... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q3964689 | 60-87 (C4-Eb6) | Klavier linke Hand | 39-75 (Eb2-Eb5) | Klavier linke Hand | |
K283-1 | {1: '3/4'} | {1: 1} | 122 | 120 | 360.00 | 244 | 240 | 720.00 | () | 837.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.5_in_G_... | https://musicbrainz.org/work/cb47a22e-9fc6-4ab... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2738174 | 55-88 (G3-E6) | Klavier linke Hand | 31-74 (G1-D5) | Klavier linke Hand | |
K283-2 | {1: '4/4'} | {1: 0} | 41 | 39 | 164.00 | 76 | 76 | 304.00 | (14], [15]], [[38], [39) | 351.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.5_in_G_... | https://musicbrainz.org/work/cb47a22e-9fc6-4ab... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2738175 | 59-88 (B3-E6) | Klavier linke Hand | 43-76 (G2-E5) | Klavier linke Hand | |
K283-3 | {1: '3/8'} | {1: 1} | 277 | 277 | 415.50 | 550 | 550 | 825.00 | () | 925.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.5_in_G_... | https://musicbrainz.org/work/cb47a22e-9fc6-4ab... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2738176 | 56-89 (G#3-F6) | Klavier linke Hand | 31-74 (G1-D5) | Klavier linke Hand | |
K284-1 | {1: '4/4'} | {1: 2} | 127 | 127 | 508.00 | 254 | 254 | 1016.00 | () | 1238.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.6_in_D_... | https://musicbrainz.org/work/28017093-d48e-43b... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2564721 | 56-89 (G#3-F6) | unbenannt2 | 33-86 (A1-D6) | unbenannt2 | |
K284-2 | {1: '3/4'} | {1: 3} | 92 | 92 | 276.00 | 92 | 92 | 276.00 | () | 659.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.6_in_D_... | https://musicbrainz.org/work/28017093-d48e-43b... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2564722 | 56-88 (G#3-E6) | unbenannt2 | 37-71 (C#2-B4) | unbenannt2 | |
K284-3 | {1: '2/2', 248: '3/4'} | {1: 2, 134: -1, 153: 2} | 287 | 260 | 1001.00 | 496 | 447 | 1749.00 | () | 2342.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.6_in_D_... | https://musicbrainz.org/work/28017093-d48e-43b... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2564723 | 44-88 (G#2-E6) | unbenannt2 | 32-88 (G#1-E6) | unbenannt2 | |
K309-1 | {1: '4/4'} | {1: 0} | 155 | 155 | 620.00 | 310 | 310 | 1240.00 | () | 1395.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.7_in_C_... | https://musicbrainz.org/work/645a1b04-b378-488... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2134785 | 50-89 (D3-F6) | Klavier linke Hand | 31-79 (G1-G5) | Klavier linke Hand | |
K309-2 | {1: '3/4'} | {1: -1} | 79 | 79 | 237.00 | 79 | 79 | 237.00 | () | 569.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.7_in_C_... | https://musicbrainz.org/work/645a1b04-b378-488... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2134786 | 52-89 (E3-F6) | Klavier linke Hand | 33-72 (A1-C5) | Klavier linke Hand | |
K309-3 | {1: '2/4'} | {1: 0} | 253 | 252 | 504.00 | 253 | 252 | 504.00 | () | 1190.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.7_in_C_... | https://musicbrainz.org/work/645a1b04-b378-488... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2134787 | 52-89 (E3-F6) | Klavier linke Hand | 31-76 (G1-E5) | Klavier linke Hand | |
K310-1 | {1: '4/4'} | {1: 0} | 133 | 133 | 532.00 | 266 | 266 | 1064.00 | () | 1603.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.8_in_A_... | https://musicbrainz.org/work/53b2287b-e013-4c5... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q1746050 | 57-89 (A3-F6) | Piano | 31-72 (G1-C5) | Piano | |
K310-2 | {1: '3/4'} | {1: -1} | 88 | 86 | 259.00 | 120 | 117 | 352.00 | () | 717.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.8_in_A_... | https://musicbrainz.org/work/53b2287b-e013-4c5... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q1746051 | 48-89 (C3-F6) | Piano | 29-75 (F1-Eb5) | Piano | |
K310-3 | {1: '2/4'} | {1: 0, 143: 3, 176: 0} | 253 | 252 | 506.00 | 284 | 284 | 568.00 | (174], [175) | 1441.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.8_in_A_... | https://musicbrainz.org/work/53b2287b-e013-4c5... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q1746052 | 53-88 (F3-E6) | Piano | 33-72 (A1-C5) | Piano | |
K311-1 | {1: '4/4'} | {1: 2} | 112 | 112 | 448.00 | 224 | 224 | 896.00 | () | 1013.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.9_in_D_... | https://musicbrainz.org/work/bd91e456-789c-459... | mid | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q4384367 | 40-88 (E2-E6) | Piano | 35-76 (B1-E5) | Piano | |
K311-2 | {1: '2/4'} | {1: 1} | 94 | 93 | 188.00 | 104 | 104 | 208.00 | (12], [13) | 551.38 | ... | https://imslp.org/wiki/Piano_Sonata_No.9_in_D_... | https://musicbrainz.org/work/bd91e456-789c-459... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q4384368 | 57-88 (A3-E6) | Klavier linke Hand | 35-76 (B1-E5) | Klavier linke Hand | |
K311-3 | {1: '6/8'} | {1: 2} | 272 | 269 | 827.75 | 272 | 269 | 827.75 | () | 1852.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.9_in_D_... | https://musicbrainz.org/work/bd91e456-789c-459... | mid | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q4384369 | 54-88 (F#3-E6) | Piano | 30-74 (F#1-D5) | Piano | |
K330-1 | {1: '2/4'} | {1: 0} | 150 | 150 | 300.00 | 300 | 300 | 600.00 | () | 638.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.10_in_C... | https://musicbrainz.org/work/70d1fa96-da75-4ec... | mid | Craig Stuart Sapp | https://viaf.org/viaf/186306915 | http://www.wikidata.org/entity/Q2706156 | 57-89 (A3-F6) | Piano | 43-72 (G2-C5) | Piano | |
K330-2 | {1: '3/4'} | {1: -1, 23: -4, 46: -1} | 70 | 64 | 192.00 | 110 | 100 | 300.00 | () | 601.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.10_in_C... | https://musicbrainz.org/work/70d1fa96-da75-4ec... | mid | Craig Stuart Sapp | https://viaf.org/viaf/186306916 | http://www.wikidata.org/entity/Q2706157 | 55-84 (G3-C6) | Piano | 35-65 (B1-F4) | Piano | |
K330-3 | {1: '2/4'} | {1: 0} | 171 | 171 | 342.00 | 342 | 342 | 684.00 | () | 726.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.10_in_C... | https://musicbrainz.org/work/70d1fa96-da75-4ec... | mid | Craig Stuart Sapp | https://viaf.org/viaf/186306917 | http://www.wikidata.org/entity/Q2706158 | 59-89 (B3-F6) | Piano | 36-72 (C2-C5) | Piano | |
K331-1 | {1: '6/8', 111: '4/4'} | {1: 3, 55: 0, 73: 3} | 137 | 134 | 438.00 | 260 | 260 | 824.00 | (98], [99]], [[109], [110]], [[128], [129) | 1138.06 | ... | https://imslp.org/wiki/Piano_Sonata_No.11_in_A... | https://musicbrainz.org/work/a488a020-884d-334... | <NA> | https://musescore.com/user/14709081 | https://viaf.org/viaf/201853721 | http://www.wikidata.org/entity/Q908534 | 57-89 (A3-F6) | Piano | 33-69 (A1-A4) | Piano | |
K331-2 | {1: '3/4'} | {1: 3, 49: 2} | 101 | 100 | 303.00 | 248 | 248 | 744.00 | (100], [101) | 715.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.11_in_A... | https://musicbrainz.org/work/a488a020-884d-334... | mid | Craig Stuart Sapp | https://viaf.org/viaf/201853722 | http://www.wikidata.org/entity/Q908535 | 57-88 (A3-E6) | Piano | 35-88 (B1-E6) | Piano | |
K331-3 | {1: '2/4'} | {1: 0, 27: 3, 71: 0, 97: 3} | 137 | 127 | 256.00 | 241 | 223 | 447.00 | (105], [106) | 696.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.11_in_A... | https://musicbrainz.org/work/a488a020-884d-334... | mid | Craig Stuart Sapp | https://viaf.org/viaf/201853723 | http://www.wikidata.org/entity/Q908536 | 64-88 (E4-E6) | Piano | 38-66 (D2-F#4) | Piano | |
K332-1 | {1: '3/4'} | {1: -1} | 229 | 229 | 687.00 | 458 | 458 | 1374.00 | () | 1731.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.12_in_F... | https://musicbrainz.org/work/5b587196-bd21-410... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176604361 | http://www.wikidata.org/entity/Q1141187 | 55-89 (G3-F6) | Piano | 30-72 (F#1-C5) | Piano | |
K332-2 | {1: '4/4'} | {1: -2} | 40 | 40 | 160.00 | 40 | 40 | 160.00 | () | 397.19 | ... | https://imslp.org/wiki/Piano_Sonata_No.12_in_F... | https://musicbrainz.org/work/5b587196-bd21-410... | xml | Craig Stuart Sapp | https://viaf.org/viaf/176604362 | http://www.wikidata.org/entity/Q1141188 | 60-86 (C4-D6) | <NA> | 46-74 (Bb2-D5) | <NA> | |
K332-3 | {1: '6/8'} | {1: -1} | 245 | 245 | 735.00 | 490 | 490 | 1470.00 | () | 1619.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.12_in_F... | https://musicbrainz.org/work/5b587196-bd21-410... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176604363 | http://www.wikidata.org/entity/Q1141189 | 48-89 (C3-F6) | Piano | 34-72 (Bb1-C5) | Piano | |
K333-1 | {1: '4/4'} | {1: -2} | 167 | 165 | 660.00 | 334 | 330 | 1320.00 | () | 1392.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.13_in_B... | https://musicbrainz.org/work/5057d730-7733-475... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q2181404 | 53-89 (F3-F6) | Piano | 29-77 (F1-F5) | Piano | |
K333-2 | {1: '3/4'} | {1: -3} | 83 | 82 | 249.00 | 163 | 163 | 489.00 | (81], [82) | 680.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.13_in_B... | https://musicbrainz.org/work/5057d730-7733-475... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q2181405 | 53-89 (F3-F6) | Piano | 39-72 (Eb2-C5) | Piano | |
K333-3 | {1: '2/2'} | {1: -2} | 227 | 224 | 925.00 | 227 | 224 | 925.00 | () | 2058.54 | ... | https://imslp.org/wiki/Piano_Sonata_No.13_in_B... | https://musicbrainz.org/work/5057d730-7733-475... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q2181406 | 53-89 (F3-F6) | Piano | 29-71 (F1-B4) | Piano | |
K457-1 | {1: '4/4'} | {1: -3} | 185 | 185 | 740.00 | 352 | 352 | 1408.00 | () | 1601.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.14_in_C... | https://musicbrainz.org/work/c4762043-b408-499... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q2737945 | 43-89 (G2-F6) | Piano | 29-75 (F1-Eb5) | Piano | |
K457-2 | {1: '4/4'} | {1: -3} | 57 | 57 | 228.00 | 57 | 57 | 228.00 | () | 513.79 | ... | https://imslp.org/wiki/Piano_Sonata_No.14_in_C... | https://musicbrainz.org/work/c4762043-b408-499... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q2737946 | 49-89 (Db3-F6) | Piano | 32-89 (Ab1-F6) | Piano | |
K457-3 | {1: '3/4'} | {1: -3} | 320 | 319 | 958.00 | 320 | 319 | 958.00 | () | 2089.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.14_in_C... | https://musicbrainz.org/work/c4762043-b408-499... | musicxml | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q2737947 | 29-89 (F1-F6) | Piano | 31-84 (G1-C6) | Piano | |
K533-1 | {1: '2/2'} | {1: -1} | 241 | 239 | 956.00 | 482 | 478 | 1912.00 | () | 2200.67 | ... | https://imslp.org/wiki/Piano_Sonata_No.15_in_F... | https://musicbrainz.org/work/11364bbd-1258-4d0... | cap | Tom Schreyer | <NA> | http://www.wikidata.org/entity/Q2684266 | 45-89 (A2-F6) | unbenannt2 | 31-77 (G1-F5) | unbenannt2 | |
K533-2 | {1: '3/4'} | {1: -2} | 122 | 122 | 366.00 | 244 | 244 | 732.00 | () | 1104.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.15_in_F... | https://musicbrainz.org/work/11364bbd-1258-4d0... | cap | Tom Schreyer | <NA> | http://www.wikidata.org/entity/Q2684267 | 50-89 (D3-F6) | unbenannt2 | 29-72 (F1-C5) | unbenannt2 | |
K533-3 | {1: '2/2'} | {1: -1, 95: -4, 118: -1} | 188 | 187 | 752.00 | 209 | 209 | 836.00 | (116], [117) | 1859.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.15_in_F... | https://musicbrainz.org/work/11364bbd-1258-4d0... | cap | Tom Schreyer | <NA> | http://www.wikidata.org/entity/Q2684268 | 45-89 (A2-F6) | unbenannt2 | 29-79 (F1-G5) | unbenannt2 | |
K545-1 | {1: '4/4'} | {1: 0} | 73 | 73 | 292.00 | 146 | 146 | 584.00 | () | 574.25 | ... | https://imslp.org/wiki/Piano_Sonata_No.16_in_C... | https://musicbrainz.org/work/a2ad223d-d73b-377... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176607427 | http://www.wikidata.org/entity/Q991701 | 55-89 (G3-F6) | Piano | 36-74 (C2-D5) | Piano | |
K545-2 | {1: '3/4'} | {1: 1} | 74 | 74 | 222.00 | 106 | 106 | 318.00 | () | 447.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.16_in_C... | https://musicbrainz.org/work/a2ad223d-d73b-377... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176607428 | http://www.wikidata.org/entity/Q991702 | 59-87 (B3-Eb6) | Piano | 43-69 (G2-A4) | Piano | |
K545-3 | {1: '2/4'} | {1: 0} | 74 | 73 | 147.00 | 74 | 73 | 147.00 | () | 328.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.16_in_C... | https://musicbrainz.org/work/a2ad223d-d73b-377... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176607429 | http://www.wikidata.org/entity/Q991703 | 60-89 (C4-F6) | Piano | 36-69 (C2-A4) | Piano | |
K570-1 | {1: '3/4'} | {1: -2} | 209 | 209 | 627.00 | 418 | 418 | 1254.00 | () | 1326.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.17_in_B... | https://musicbrainz.org/work/a484f227-9918-4c5... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q3266821 | 57-89 (A3-F6) | Piano | 34-75 (Bb1-Eb5) | Piano | |
K570-2 | {1: '4/4'} | {1: -3} | 56 | 55 | 224.00 | 87 | 87 | 348.00 | (24], [25) | 557.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.17_in_B... | https://musicbrainz.org/work/a484f227-9918-4c5... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q3266822 | 55-87 (G3-Eb6) | Piano | 34-75 (Bb1-Eb5) | Piano | |
K570-3 | {1: '4/4'} | {1: -2} | 91 | 89 | 356.50 | 146 | 143 | 572.50 | () | 768.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.17_in_B... | https://musicbrainz.org/work/a484f227-9918-4c5... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q3266823 | 62-89 (D4-F6) | Piano | 36-74 (C2-D5) | Piano | |
K576-1 | {1: '6/8'} | {1: 2} | 162 | 160 | 480.50 | 221 | 218 | 654.50 | () | 1048.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.18_in_D... | https://musicbrainz.org/work/99538f90-2ca3-4b3... | mid | Craig Stuart Sapp | https://viaf.org/viaf/218082488 | http://www.wikidata.org/entity/Q1977772 | 57-89 (A3-F6) | Piano | 38-78 (D2-F#5) | Piano | |
K576-2 | {1: '3/4'} | {1: 3} | 67 | 67 | 201.00 | 67 | 67 | 201.00 | () | 506.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.18_in_D... | https://musicbrainz.org/work/99538f90-2ca3-4b3... | mid | Craig Stuart Sapp | https://viaf.org/viaf/218082489 | http://www.wikidata.org/entity/Q1977773 | 56-88 (G#3-E6) | Piano | 40-74 (E2-D5) | Piano | |
K576-3 | {1: '2/4'} | {1: 2} | 189 | 189 | 378.00 | 189 | 189 | 378.00 | () | 848.17 | ... | https://imslp.org/wiki/Piano_Sonata_No.18_in_D... | https://musicbrainz.org/work/99538f90-2ca3-4b3... | mid | Craig Stuart Sapp | https://viaf.org/viaf/218082490 | http://www.wikidata.org/entity/Q1977774 | 57-89 (A3-F6) | Piano | 33-78 (A1-F#5) | Piano |
54 rows × 53 columns
mean_composition_years = utils.corpus_mean_composition_years(all_metadata)
chronological_order = mean_composition_years.index.to_list()
corpus_colors = dict(zip(chronological_order, utils.CORPUS_COLOR_SCALE))
corpus_names = {
corp: utils.get_corpus_display_name(corp) for corp in chronological_order
}
chronological_corpus_names = list(corpus_names.values())
corpus_name_colors = {
corpus_names[corp]: color for corp, color in corpus_colors.items()
}
mean_composition_years
corpus
mozart_piano_sonatas 1780.666667
Name: mean_composition_year, dtype: float64
Composition dates#
This section relies on the dataset’s metadata.
valid_composed_start = pd.to_numeric(all_metadata.composed_start, errors="coerce")
valid_composed_end = pd.to_numeric(all_metadata.composed_end, errors="coerce")
print(
f"Composition dates range from {int(valid_composed_start.min())} {valid_composed_start.idxmin()} "
f"to {int(valid_composed_end.max())} {valid_composed_end.idxmax()}."
)
Composition dates range from 1775 ('mozart_piano_sonatas', 'K279-1') to 1789 ('mozart_piano_sonatas', 'K570-1').
Mean composition years per corpus#
def make_summary(metadata_df):
piece_is_annotated = metadata_df.label_count > 0
return metadata_df[piece_is_annotated].copy()
Show source
summary = make_summary(all_metadata)
bar_data = pd.concat(
[
mean_composition_years.rename("year"),
summary.groupby(level="corpus").size().rename("pieces"),
],
axis=1,
).reset_index()
N = len(summary)
fig = px.bar(
bar_data,
x="year",
y="pieces",
color="corpus",
color_discrete_map=corpus_colors,
title=f"Temporal coverage of the {N} annotated pieces in the Distant Listening Corpus",
)
fig.update_traces(width=5)
fig.update_layout(**utils.STD_LAYOUT)
fig.update_traces(width=5)
save_figure_as(fig, "pieces_timeline_bars")
fig.show()
summary
TimeSig | KeySig | last_mc | last_mn | length_qb | last_mc_unfolded | last_mn_unfolded | length_qb_unfolded | volta_mcs | all_notes_qb | ... | imslp | musicbrainz | originalFormat | typesetter | viaf | wikidata | staff_1_ambitus | staff_1_instrument | staff_2_ambitus | staff_2_instrument | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
corpus | piece | |||||||||||||||||||||
mozart_piano_sonatas | K279-1 | {1: '4/4'} | {1: 0} | 100 | 100 | 400.00 | 200 | 200 | 800.00 | () | 767.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.1_in_C_... | https://musicbrainz.org/work/62c0bdd8-46ca-4e1... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2194957 | 48-88 (C3-E6) | Klavier linke Hand | 31-74 (G1-D5) | Klavier linke Hand |
K279-2 | {1: '3/4'} | {1: -1} | 76 | 74 | 222.00 | 152 | 148 | 444.00 | () | 560.83 | ... | https://imslp.org/wiki/Piano_Sonata_No.1_in_C_... | https://musicbrainz.org/work/62c0bdd8-46ca-4e1... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2194958 | 57-86 (A3-D6) | Klavier linke Hand | 35-79 (B1-G5) | Klavier linke Hand | |
K279-3 | {1: '2/4'} | {1: 0} | 160 | 158 | 316.00 | 320 | 316 | 632.00 | () | 699.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.1_in_C_... | https://musicbrainz.org/work/62c0bdd8-46ca-4e1... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2194959 | 54-88 (F#3-E6) | Klavier linke Hand | 35-79 (B1-G5) | Klavier linke Hand | |
K280-1 | {1: '3/4'} | {1: -1} | 144 | 144 | 432.00 | 288 | 288 | 864.00 | () | 911.33 | ... | https://imslp.org/wiki/Piano_Sonata_No.2_in_F_... | https://musicbrainz.org/work/52912ca4-855d-451... | cap | Tobias Schölkopf | https://viaf.org/viaf/185925450 | http://www.wikidata.org/entity/Q954538 | 55-86 (G3-D6) | Klavier linke Hand | 29-86 (F1-D6) | Klavier linke Hand | |
K280-2 | {1: '6/8'} | {1: -4} | 60 | 60 | 180.00 | 120 | 120 | 360.00 | () | 434.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.2_in_F_... | https://musicbrainz.org/work/52912ca4-855d-451... | cap | Tobias Schölkopf | https://viaf.org/viaf/185925451 | http://www.wikidata.org/entity/Q954539 | 48-87 (C3-Eb6) | Klavier linke Hand | 32-73 (Ab1-Db5) | Klavier linke Hand | |
K280-3 | {1: '3/8'} | {1: -1} | 192 | 190 | 285.00 | 384 | 380 | 570.00 | () | 518.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.2_in_F_... | https://musicbrainz.org/work/52912ca4-855d-451... | cap | Tobias Schölkopf | https://viaf.org/viaf/185925452 | http://www.wikidata.org/entity/Q954540 | 52-89 (E3-F6) | Klavier linke Hand | 33-79 (A1-G5) | Klavier linke Hand | |
K281-1 | {1: '2/4'} | {1: -2} | 109 | 109 | 218.00 | 218 | 218 | 436.00 | () | 487.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.3_in_B-... | https://musicbrainz.org/work/4495fb34-25b6-48f... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2061529 | 53-89 (F3-F6) | Klavier linke Hand | 34-75 (Bb1-Eb5) | Klavier linke Hand | |
K281-2 | {1: '3/8'} | {1: -3} | 106 | 106 | 159.00 | 212 | 212 | 318.00 | () | 334.83 | ... | https://imslp.org/wiki/Piano_Sonata_No.3_in_B-... | https://musicbrainz.org/work/4495fb34-25b6-48f... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2061530 | 53-87 (F3-Eb6) | Klavier linke Hand | 34-70 (Bb1-Bb4) | Klavier linke Hand | |
K281-3 | {1: '2/2'} | {1: -2} | 163 | 162 | 648.00 | 179 | 178 | 712.00 | () | 1443.67 | ... | https://imslp.org/wiki/Piano_Sonata_No.3_in_B-... | https://musicbrainz.org/work/4495fb34-25b6-48f... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2061531 | 62-89 (D4-F6) | Klavier linke Hand | 38-77 (D2-F5) | Klavier linke Hand | |
K282-1 | {1: '4/4'} | {1: -3} | 36 | 36 | 144.00 | 69 | 69 | 276.00 | () | 346.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.4_in_E-... | https://musicbrainz.org/work/97cc4159-c124-48a... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q3964687 | 58-84 (Bb3-C6) | Klavier linke Hand | 43-75 (G2-Eb5) | Klavier linke Hand | |
K282-2 | {1: '3/4'} | {1: -2, 35: -3} | 76 | 72 | 216.00 | 186 | 176 | 528.00 | () | 488.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.4_in_E-... | https://musicbrainz.org/work/97cc4159-c124-48a... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q3964688 | 57-89 (A3-F6) | Klavier linke Hand | 41-70 (F2-Bb4) | Klavier linke Hand | |
K282-3 | {1: '2/4'} | {1: -3} | 104 | 102 | 204.00 | 208 | 204 | 408.00 | () | 468.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.4_in_E-... | https://musicbrainz.org/work/97cc4159-c124-48a... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q3964689 | 60-87 (C4-Eb6) | Klavier linke Hand | 39-75 (Eb2-Eb5) | Klavier linke Hand | |
K283-1 | {1: '3/4'} | {1: 1} | 122 | 120 | 360.00 | 244 | 240 | 720.00 | () | 837.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.5_in_G_... | https://musicbrainz.org/work/cb47a22e-9fc6-4ab... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2738174 | 55-88 (G3-E6) | Klavier linke Hand | 31-74 (G1-D5) | Klavier linke Hand | |
K283-2 | {1: '4/4'} | {1: 0} | 41 | 39 | 164.00 | 76 | 76 | 304.00 | (14], [15]], [[38], [39) | 351.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.5_in_G_... | https://musicbrainz.org/work/cb47a22e-9fc6-4ab... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2738175 | 59-88 (B3-E6) | Klavier linke Hand | 43-76 (G2-E5) | Klavier linke Hand | |
K283-3 | {1: '3/8'} | {1: 1} | 277 | 277 | 415.50 | 550 | 550 | 825.00 | () | 925.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.5_in_G_... | https://musicbrainz.org/work/cb47a22e-9fc6-4ab... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2738176 | 56-89 (G#3-F6) | Klavier linke Hand | 31-74 (G1-D5) | Klavier linke Hand | |
K284-1 | {1: '4/4'} | {1: 2} | 127 | 127 | 508.00 | 254 | 254 | 1016.00 | () | 1238.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.6_in_D_... | https://musicbrainz.org/work/28017093-d48e-43b... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2564721 | 56-89 (G#3-F6) | unbenannt2 | 33-86 (A1-D6) | unbenannt2 | |
K284-2 | {1: '3/4'} | {1: 3} | 92 | 92 | 276.00 | 92 | 92 | 276.00 | () | 659.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.6_in_D_... | https://musicbrainz.org/work/28017093-d48e-43b... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2564722 | 56-88 (G#3-E6) | unbenannt2 | 37-71 (C#2-B4) | unbenannt2 | |
K284-3 | {1: '2/2', 248: '3/4'} | {1: 2, 134: -1, 153: 2} | 287 | 260 | 1001.00 | 496 | 447 | 1749.00 | () | 2342.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.6_in_D_... | https://musicbrainz.org/work/28017093-d48e-43b... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2564723 | 44-88 (G#2-E6) | unbenannt2 | 32-88 (G#1-E6) | unbenannt2 | |
K309-1 | {1: '4/4'} | {1: 0} | 155 | 155 | 620.00 | 310 | 310 | 1240.00 | () | 1395.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.7_in_C_... | https://musicbrainz.org/work/645a1b04-b378-488... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2134785 | 50-89 (D3-F6) | Klavier linke Hand | 31-79 (G1-G5) | Klavier linke Hand | |
K309-2 | {1: '3/4'} | {1: -1} | 79 | 79 | 237.00 | 79 | 79 | 237.00 | () | 569.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.7_in_C_... | https://musicbrainz.org/work/645a1b04-b378-488... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2134786 | 52-89 (E3-F6) | Klavier linke Hand | 33-72 (A1-C5) | Klavier linke Hand | |
K309-3 | {1: '2/4'} | {1: 0} | 253 | 252 | 504.00 | 253 | 252 | 504.00 | () | 1190.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.7_in_C_... | https://musicbrainz.org/work/645a1b04-b378-488... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q2134787 | 52-89 (E3-F6) | Klavier linke Hand | 31-76 (G1-E5) | Klavier linke Hand | |
K310-1 | {1: '4/4'} | {1: 0} | 133 | 133 | 532.00 | 266 | 266 | 1064.00 | () | 1603.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.8_in_A_... | https://musicbrainz.org/work/53b2287b-e013-4c5... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q1746050 | 57-89 (A3-F6) | Piano | 31-72 (G1-C5) | Piano | |
K310-2 | {1: '3/4'} | {1: -1} | 88 | 86 | 259.00 | 120 | 117 | 352.00 | () | 717.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.8_in_A_... | https://musicbrainz.org/work/53b2287b-e013-4c5... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q1746051 | 48-89 (C3-F6) | Piano | 29-75 (F1-Eb5) | Piano | |
K310-3 | {1: '2/4'} | {1: 0, 143: 3, 176: 0} | 253 | 252 | 506.00 | 284 | 284 | 568.00 | (174], [175) | 1441.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.8_in_A_... | https://musicbrainz.org/work/53b2287b-e013-4c5... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q1746052 | 53-88 (F3-E6) | Piano | 33-72 (A1-C5) | Piano | |
K311-1 | {1: '4/4'} | {1: 2} | 112 | 112 | 448.00 | 224 | 224 | 896.00 | () | 1013.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.9_in_D_... | https://musicbrainz.org/work/bd91e456-789c-459... | mid | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q4384367 | 40-88 (E2-E6) | Piano | 35-76 (B1-E5) | Piano | |
K311-2 | {1: '2/4'} | {1: 1} | 94 | 93 | 188.00 | 104 | 104 | 208.00 | (12], [13) | 551.38 | ... | https://imslp.org/wiki/Piano_Sonata_No.9_in_D_... | https://musicbrainz.org/work/bd91e456-789c-459... | cap | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q4384368 | 57-88 (A3-E6) | Klavier linke Hand | 35-76 (B1-E5) | Klavier linke Hand | |
K311-3 | {1: '6/8'} | {1: 2} | 272 | 269 | 827.75 | 272 | 269 | 827.75 | () | 1852.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.9_in_D_... | https://musicbrainz.org/work/bd91e456-789c-459... | mid | Tobias Schölkopf | <NA> | http://www.wikidata.org/entity/Q4384369 | 54-88 (F#3-E6) | Piano | 30-74 (F#1-D5) | Piano | |
K330-1 | {1: '2/4'} | {1: 0} | 150 | 150 | 300.00 | 300 | 300 | 600.00 | () | 638.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.10_in_C... | https://musicbrainz.org/work/70d1fa96-da75-4ec... | mid | Craig Stuart Sapp | https://viaf.org/viaf/186306915 | http://www.wikidata.org/entity/Q2706156 | 57-89 (A3-F6) | Piano | 43-72 (G2-C5) | Piano | |
K330-2 | {1: '3/4'} | {1: -1, 23: -4, 46: -1} | 70 | 64 | 192.00 | 110 | 100 | 300.00 | () | 601.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.10_in_C... | https://musicbrainz.org/work/70d1fa96-da75-4ec... | mid | Craig Stuart Sapp | https://viaf.org/viaf/186306916 | http://www.wikidata.org/entity/Q2706157 | 55-84 (G3-C6) | Piano | 35-65 (B1-F4) | Piano | |
K330-3 | {1: '2/4'} | {1: 0} | 171 | 171 | 342.00 | 342 | 342 | 684.00 | () | 726.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.10_in_C... | https://musicbrainz.org/work/70d1fa96-da75-4ec... | mid | Craig Stuart Sapp | https://viaf.org/viaf/186306917 | http://www.wikidata.org/entity/Q2706158 | 59-89 (B3-F6) | Piano | 36-72 (C2-C5) | Piano | |
K331-1 | {1: '6/8', 111: '4/4'} | {1: 3, 55: 0, 73: 3} | 137 | 134 | 438.00 | 260 | 260 | 824.00 | (98], [99]], [[109], [110]], [[128], [129) | 1138.06 | ... | https://imslp.org/wiki/Piano_Sonata_No.11_in_A... | https://musicbrainz.org/work/a488a020-884d-334... | <NA> | https://musescore.com/user/14709081 | https://viaf.org/viaf/201853721 | http://www.wikidata.org/entity/Q908534 | 57-89 (A3-F6) | Piano | 33-69 (A1-A4) | Piano | |
K331-2 | {1: '3/4'} | {1: 3, 49: 2} | 101 | 100 | 303.00 | 248 | 248 | 744.00 | (100], [101) | 715.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.11_in_A... | https://musicbrainz.org/work/a488a020-884d-334... | mid | Craig Stuart Sapp | https://viaf.org/viaf/201853722 | http://www.wikidata.org/entity/Q908535 | 57-88 (A3-E6) | Piano | 35-88 (B1-E6) | Piano | |
K331-3 | {1: '2/4'} | {1: 0, 27: 3, 71: 0, 97: 3} | 137 | 127 | 256.00 | 241 | 223 | 447.00 | (105], [106) | 696.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.11_in_A... | https://musicbrainz.org/work/a488a020-884d-334... | mid | Craig Stuart Sapp | https://viaf.org/viaf/201853723 | http://www.wikidata.org/entity/Q908536 | 64-88 (E4-E6) | Piano | 38-66 (D2-F#4) | Piano | |
K332-1 | {1: '3/4'} | {1: -1} | 229 | 229 | 687.00 | 458 | 458 | 1374.00 | () | 1731.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.12_in_F... | https://musicbrainz.org/work/5b587196-bd21-410... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176604361 | http://www.wikidata.org/entity/Q1141187 | 55-89 (G3-F6) | Piano | 30-72 (F#1-C5) | Piano | |
K332-2 | {1: '4/4'} | {1: -2} | 40 | 40 | 160.00 | 40 | 40 | 160.00 | () | 397.19 | ... | https://imslp.org/wiki/Piano_Sonata_No.12_in_F... | https://musicbrainz.org/work/5b587196-bd21-410... | xml | Craig Stuart Sapp | https://viaf.org/viaf/176604362 | http://www.wikidata.org/entity/Q1141188 | 60-86 (C4-D6) | <NA> | 46-74 (Bb2-D5) | <NA> | |
K332-3 | {1: '6/8'} | {1: -1} | 245 | 245 | 735.00 | 490 | 490 | 1470.00 | () | 1619.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.12_in_F... | https://musicbrainz.org/work/5b587196-bd21-410... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176604363 | http://www.wikidata.org/entity/Q1141189 | 48-89 (C3-F6) | Piano | 34-72 (Bb1-C5) | Piano | |
K333-1 | {1: '4/4'} | {1: -2} | 167 | 165 | 660.00 | 334 | 330 | 1320.00 | () | 1392.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.13_in_B... | https://musicbrainz.org/work/5057d730-7733-475... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q2181404 | 53-89 (F3-F6) | Piano | 29-77 (F1-F5) | Piano | |
K333-2 | {1: '3/4'} | {1: -3} | 83 | 82 | 249.00 | 163 | 163 | 489.00 | (81], [82) | 680.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.13_in_B... | https://musicbrainz.org/work/5057d730-7733-475... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q2181405 | 53-89 (F3-F6) | Piano | 39-72 (Eb2-C5) | Piano | |
K333-3 | {1: '2/2'} | {1: -2} | 227 | 224 | 925.00 | 227 | 224 | 925.00 | () | 2058.54 | ... | https://imslp.org/wiki/Piano_Sonata_No.13_in_B... | https://musicbrainz.org/work/5057d730-7733-475... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q2181406 | 53-89 (F3-F6) | Piano | 29-71 (F1-B4) | Piano | |
K457-1 | {1: '4/4'} | {1: -3} | 185 | 185 | 740.00 | 352 | 352 | 1408.00 | () | 1601.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.14_in_C... | https://musicbrainz.org/work/c4762043-b408-499... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q2737945 | 43-89 (G2-F6) | Piano | 29-75 (F1-Eb5) | Piano | |
K457-2 | {1: '4/4'} | {1: -3} | 57 | 57 | 228.00 | 57 | 57 | 228.00 | () | 513.79 | ... | https://imslp.org/wiki/Piano_Sonata_No.14_in_C... | https://musicbrainz.org/work/c4762043-b408-499... | <NA> | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q2737946 | 49-89 (Db3-F6) | Piano | 32-89 (Ab1-F6) | Piano | |
K457-3 | {1: '3/4'} | {1: -3} | 320 | 319 | 958.00 | 320 | 319 | 958.00 | () | 2089.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.14_in_C... | https://musicbrainz.org/work/c4762043-b408-499... | musicxml | https://musescore.com/lukemossman | <NA> | http://www.wikidata.org/entity/Q2737947 | 29-89 (F1-F6) | Piano | 31-84 (G1-C6) | Piano | |
K533-1 | {1: '2/2'} | {1: -1} | 241 | 239 | 956.00 | 482 | 478 | 1912.00 | () | 2200.67 | ... | https://imslp.org/wiki/Piano_Sonata_No.15_in_F... | https://musicbrainz.org/work/11364bbd-1258-4d0... | cap | Tom Schreyer | <NA> | http://www.wikidata.org/entity/Q2684266 | 45-89 (A2-F6) | unbenannt2 | 31-77 (G1-F5) | unbenannt2 | |
K533-2 | {1: '3/4'} | {1: -2} | 122 | 122 | 366.00 | 244 | 244 | 732.00 | () | 1104.58 | ... | https://imslp.org/wiki/Piano_Sonata_No.15_in_F... | https://musicbrainz.org/work/11364bbd-1258-4d0... | cap | Tom Schreyer | <NA> | http://www.wikidata.org/entity/Q2684267 | 50-89 (D3-F6) | unbenannt2 | 29-72 (F1-C5) | unbenannt2 | |
K533-3 | {1: '2/2'} | {1: -1, 95: -4, 118: -1} | 188 | 187 | 752.00 | 209 | 209 | 836.00 | (116], [117) | 1859.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.15_in_F... | https://musicbrainz.org/work/11364bbd-1258-4d0... | cap | Tom Schreyer | <NA> | http://www.wikidata.org/entity/Q2684268 | 45-89 (A2-F6) | unbenannt2 | 29-79 (F1-G5) | unbenannt2 | |
K545-1 | {1: '4/4'} | {1: 0} | 73 | 73 | 292.00 | 146 | 146 | 584.00 | () | 574.25 | ... | https://imslp.org/wiki/Piano_Sonata_No.16_in_C... | https://musicbrainz.org/work/a2ad223d-d73b-377... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176607427 | http://www.wikidata.org/entity/Q991701 | 55-89 (G3-F6) | Piano | 36-74 (C2-D5) | Piano | |
K545-2 | {1: '3/4'} | {1: 1} | 74 | 74 | 222.00 | 106 | 106 | 318.00 | () | 447.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.16_in_C... | https://musicbrainz.org/work/a2ad223d-d73b-377... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176607428 | http://www.wikidata.org/entity/Q991702 | 59-87 (B3-Eb6) | Piano | 43-69 (G2-A4) | Piano | |
K545-3 | {1: '2/4'} | {1: 0} | 74 | 73 | 147.00 | 74 | 73 | 147.00 | () | 328.00 | ... | https://imslp.org/wiki/Piano_Sonata_No.16_in_C... | https://musicbrainz.org/work/a2ad223d-d73b-377... | mid | Craig Stuart Sapp | https://viaf.org/viaf/176607429 | http://www.wikidata.org/entity/Q991703 | 60-89 (C4-F6) | Piano | 36-69 (C2-A4) | Piano | |
K570-1 | {1: '3/4'} | {1: -2} | 209 | 209 | 627.00 | 418 | 418 | 1254.00 | () | 1326.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.17_in_B... | https://musicbrainz.org/work/a484f227-9918-4c5... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q3266821 | 57-89 (A3-F6) | Piano | 34-75 (Bb1-Eb5) | Piano | |
K570-2 | {1: '4/4'} | {1: -3} | 56 | 55 | 224.00 | 87 | 87 | 348.00 | (24], [25) | 557.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.17_in_B... | https://musicbrainz.org/work/a484f227-9918-4c5... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q3266822 | 55-87 (G3-Eb6) | Piano | 34-75 (Bb1-Eb5) | Piano | |
K570-3 | {1: '4/4'} | {1: -2} | 91 | 89 | 356.50 | 146 | 143 | 572.50 | () | 768.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.17_in_B... | https://musicbrainz.org/work/a484f227-9918-4c5... | mid | Craig Stuart Sapp | <NA> | http://www.wikidata.org/entity/Q3266823 | 62-89 (D4-F6) | Piano | 36-74 (C2-D5) | Piano | |
K576-1 | {1: '6/8'} | {1: 2} | 162 | 160 | 480.50 | 221 | 218 | 654.50 | () | 1048.75 | ... | https://imslp.org/wiki/Piano_Sonata_No.18_in_D... | https://musicbrainz.org/work/99538f90-2ca3-4b3... | mid | Craig Stuart Sapp | https://viaf.org/viaf/218082488 | http://www.wikidata.org/entity/Q1977772 | 57-89 (A3-F6) | Piano | 38-78 (D2-F#5) | Piano | |
K576-2 | {1: '3/4'} | {1: 3} | 67 | 67 | 201.00 | 67 | 67 | 201.00 | () | 506.50 | ... | https://imslp.org/wiki/Piano_Sonata_No.18_in_D... | https://musicbrainz.org/work/99538f90-2ca3-4b3... | mid | Craig Stuart Sapp | https://viaf.org/viaf/218082489 | http://www.wikidata.org/entity/Q1977773 | 56-88 (G#3-E6) | Piano | 40-74 (E2-D5) | Piano | |
K576-3 | {1: '2/4'} | {1: 2} | 189 | 189 | 378.00 | 189 | 189 | 378.00 | () | 848.17 | ... | https://imslp.org/wiki/Piano_Sonata_No.18_in_D... | https://musicbrainz.org/work/99538f90-2ca3-4b3... | mid | Craig Stuart Sapp | https://viaf.org/viaf/218082490 | http://www.wikidata.org/entity/Q1977774 | 57-89 (A3-F6) | Piano | 33-78 (A1-F#5) | Piano |
54 rows × 53 columns
Composition years histogram#
Show source
hist_data = summary.reset_index()
hist_data.corpus = hist_data.corpus.map(corpus_names)
fig = px.histogram(
hist_data,
x="composed_end",
color="corpus",
labels=dict(
composed_end="decade",
count="pieces",
),
color_discrete_map=corpus_name_colors,
title=f"Temporal coverage of the {N} annotated pieces in the Distant Listening Corpus",
)
fig.update_traces(xbins=dict(size=10))
fig.update_layout(**utils.STD_LAYOUT)
fig.update_legends(font=dict(size=16))
save_figure_as(fig, "pieces_timeline_histogram", height=1250)
fig.show()
Dimensions#
Overview#
def make_overview_table(groupby, group_name="pieces"):
n_groups = groupby.size().rename(group_name)
absolute_numbers = dict(
measures=groupby.last_mn.sum(),
length=groupby.length_qb.sum(),
notes=groupby.n_onsets.sum(),
labels=groupby.label_count.sum(),
)
absolute = pd.DataFrame.from_dict(absolute_numbers)
absolute = pd.concat([n_groups, absolute], axis=1)
sum_row = pd.DataFrame(absolute.sum(), columns=["sum"]).T
absolute = pd.concat([absolute, sum_row])
return absolute
absolute = make_overview_table(summary.groupby("workTitle"))
# print(absolute.astype(int).to_markdown())
absolute.astype(int)
pieces | measures | length | notes | labels | |
---|---|---|---|---|---|
Piano Sonata no. 1 in C major | 3 | 332 | 938 | 4706 | 728 |
Piano Sonata no. 10 in C major | 3 | 385 | 834 | 5331 | 845 |
Piano Sonata no. 11 in A major | 3 | 361 | 997 | 5970 | 687 |
Piano Sonata no. 12 in F major | 3 | 514 | 1582 | 6600 | 933 |
Piano Sonata no. 13 in B flat major | 3 | 471 | 1834 | 7294 | 1108 |
Piano Sonata no. 14 in C minor | 3 | 561 | 1926 | 6189 | 850 |
Piano Sonata no. 15 in F major | 3 | 548 | 2074 | 7131 | 1268 |
Piano Sonata no. 16 in C major | 3 | 220 | 661 | 3483 | 408 |
Piano Sonata no. 17 in B flat major | 3 | 353 | 1207 | 4590 | 776 |
Piano Sonata no. 18 in D major | 3 | 416 | 1059 | 5896 | 827 |
Piano Sonata no. 2 in F major | 3 | 394 | 897 | 3811 | 548 |
Piano Sonata no. 3 in B flat major | 3 | 377 | 1025 | 5057 | 745 |
Piano Sonata no. 4 in E flat major | 3 | 210 | 564 | 2680 | 409 |
Piano Sonata no. 5 in G major | 3 | 436 | 939 | 4631 | 832 |
Piano Sonata no. 6 in D major | 3 | 479 | 1785 | 8590 | 1313 |
Piano Sonata no. 7 in C major | 3 | 486 | 1361 | 7453 | 972 |
Piano Sonata no. 8 in A minor | 3 | 471 | 1297 | 7235 | 972 |
Piano Sonata no. 9 in D major | 3 | 474 | 1463 | 6906 | 1051 |
sum | 54 | 7488 | 22445 | 103553 | 15272 |
def summarize_dataset(D):
all_metadata = D.get_metadata()
summary = make_summary(all_metadata)
return make_overview_table(summary.groupby(level=0))
corpus_summary = summarize_dataset(D)
print(corpus_summary.astype(int).to_markdown())
| | pieces | measures | length | notes | labels |
|:---------------------|---------:|-----------:|---------:|--------:|---------:|
| mozart_piano_sonatas | 54 | 7488 | 22445 | 103553 | 15272 |
| sum | 54 | 7488 | 22445 | 103553 | 15272 |
Measures#
all_measures = D.get_feature("measures")
print(
f"{len(all_measures.index)} measures over {len(all_measures.groupby(level=[0,1]))} files."
)
all_measures.head()
7564 measures over 54 files.
mc | mn | quarterbeats | duration_qb | keysig | timesig | act_dur | mc_offset | numbering_offset | dont_count | barline | breaks | repeats | next | markers | jump_bwd | jump_fwd | play_until | volta | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
corpus | piece | i | |||||||||||||||||||
mozart_piano_sonatas | K279-1 | 0 | 1 | 1 | 0 | 4.0 | 0 | 4/4 | 1 | 0 | <NA> | <NA> | <NA> | <NA> | firstMeasure | (2,) | <NA> | <NA> | <NA> | <NA> | <NA> |
1 | 2 | 2 | 4 | 4.0 | 0 | 4/4 | 1 | 0 | <NA> | <NA> | <NA> | line | <NA> | (3,) | <NA> | <NA> | <NA> | <NA> | <NA> | ||
2 | 3 | 3 | 8 | 4.0 | 0 | 4/4 | 1 | 0 | <NA> | <NA> | <NA> | <NA> | <NA> | (4,) | <NA> | <NA> | <NA> | <NA> | <NA> | ||
3 | 4 | 4 | 12 | 4.0 | 0 | 4/4 | 1 | 0 | <NA> | <NA> | <NA> | <NA> | <NA> | (5,) | <NA> | <NA> | <NA> | <NA> | <NA> | ||
4 | 5 | 5 | 16 | 4.0 | 0 | 4/4 | 1 | 0 | <NA> | <NA> | <NA> | line | <NA> | (6,) | <NA> | <NA> | <NA> | <NA> | <NA> |
all_measures.get_default_analysis().plot_grouped()
Harmony labels#
All symbols, independent of the local key (the mode of which changes their semantics).
try:
all_annotations = D.get_feature("harmonylabels").df
except Exception:
all_annotations = pd.DataFrame()
n_annotations = len(all_annotations.index)
includes_annotations = n_annotations > 0
if includes_annotations:
display(all_annotations.head())
print(f"Concatenated annotation tables contains {all_annotations.shape[0]} rows.")
no_chord = all_annotations.root.isna()
if no_chord.sum() > 0:
print(
f"{no_chord.sum()} of them are not chords. Their values are:"
f" {all_annotations.label[no_chord].value_counts(dropna=False).to_dict()}"
)
all_chords = all_annotations[~no_chord].copy()
print(
f"Dataset contains {all_chords.shape[0]} tokens and {len(all_chords.chord.unique())} types over "
f"{len(all_chords.groupby(level=[0,1]))} documents."
)
all_annotations["corpus_name"] = all_annotations.index.get_level_values(0).map(
utils.get_corpus_display_name
)
all_chords["corpus_name"] = all_chords.index.get_level_values(0).map(
utils.get_corpus_display_name
)
else:
print("Dataset contains no annotations.")
mc | mn | quarterbeats | duration_qb | mc_onset | mn_onset | timesig | staff | voice | volta | ... | numeral_or_applied_to_numeral | intervals_over_bass | intervals_over_root | scale_degrees | scale_degrees_and_mode | scale_degrees_major | scale_degrees_minor | globalkey | localkey | chord | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
corpus | piece | i | |||||||||||||||||||||
mozart_piano_sonatas | K279-1 | 0 | 1 | 1 | 0 | 4.0 | 0 | 0 | 4/4 | 2 | 1 | <NA> | ... | I | (M3, P5) | (M3, P5) | (1, 3, 5) | (1, 3, 5), major | (1, 3, 5) | (1, #3, 5) | C | I | I |
1 | 2 | 2 | 4 | 2.0 | 0 | 0 | 4/4 | 2 | 1 | <NA> | ... | ii | (M3, M6) | (m3, P5) | (4, 6, 2) | (4, 6, 2), major | (4, 6, 2) | (4, #6, 2) | C | I | ii6 | ||
2 | 2 | 2 | 6 | 0.5 | 1/2 | 1/2 | 4/4 | 2 | 1 | <NA> | ... | V | (M2, a4, M6) | (M3, P5, m7) | (4, 5, 7, 2) | (4, 5, 7, 2), major | (4, 5, 7, 2) | (4, 5, #7, 2) | C | I | V2 | ||
3 | 2 | 2 | 13/2 | 0.5 | 5/8 | 5/8 | 4/4 | 2 | 1 | <NA> | ... | I | (m3, m6) | (M3, P5) | (3, 5, 1) | (3, 5, 1), major | (3, 5, 1) | (#3, 5, 1) | C | I | I6 | ||
4 | 2 | 2 | 7 | 0.5 | 3/4 | 3/4 | 4/4 | 2 | 1 | <NA> | ... | ii | (M3, M6) | (m3, P5) | (4, 6, 2) | (4, 6, 2), major | (4, 6, 2) | (4, #6, 2) | C | I | ii6 |
5 rows × 52 columns
Concatenated annotation tables contains 14995 rows.
Dataset contains 14995 tokens and 466 types over 54 documents.