Skip to content

Commit

Permalink
add count for About page
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Ory committed Oct 3, 2023
1 parent 81a218c commit a71251d
Show file tree
Hide file tree
Showing 5 changed files with 4,797 additions and 7 deletions.
23 changes: 23 additions & 0 deletions about/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
##
## Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
## Creation Date: Thu Jun 8 19:45:08 PDT 2023
## Last Modified: Thu Jun 8 19:45:11 PDT 2023
## Syntax: GNU Makefile
## Filename: Makefile
## vim: ts=3
##
## Description: Download metadata for the 1520s project from the Google Spreadsheet
## for the project's metadata. You need to update the SID variable in
## _includes/metadata/Makefile when the deployment of the Google Apps
## Script has changed.
##
## Type "make" in this directory to download the JSON files for the metadata.
## into the _includes/metadata directory.
##

SID = AKfycbwuHJlO-idyGmlaHBhNshmSCtiOau1QsXwN3K7PHyJDZ47qvPMEvv-uACFzJCBLB7iWXw

download: works

works:
curl -L "https://script.google.com/macros/s/$(SID)/exec?sheet=works" > works.json
4 changes: 3 additions & 1 deletion about/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ img {
}
</style>

{% include_relative scripts-local.html %}

## A new aesthetic paradigm

Sometime during the 1520s, a new aesthetic paradigm for sacred European art music took hold.
Expand All @@ -22,7 +24,7 @@ Complicating matters further: more works from during the 1520s survive than from

## Meeting the challenge

The 1520s Project aims to meet this challenge head on by making the repertoire of the early sixteenth century available for performance, study, and analysis. Founded by [Benjamin Ory](https://benjaminory.com){:target="_blank"} in 2019, the project provides high-quality digital editions of the music in four data types: as PDFs, as Sibelius files, as MusicXML files, and as Humdrum files. At present, the corpus features more than 250 scores and more than 250,000 notes, making it the largest online database of music from the period in the world. The figure below shows the distribution of works by date of the first surviving source.
The 1520s Project aims to meet this challenge head on by making the repertoire of the early sixteenth century available for performance, study, and analysis. Founded in 2019 by [Benjamin Ory](https://benjaminory.com){:target="_blank"}, the project provides high-quality digital editions of the music in four data types: as PDFs, as Sibelius files, as MusicXML files, and as Humdrum files. At present, the corpus features <span id="work-count"></span> scores and <span id="note-count"></span> notes, making it the largest online database of music from the period in the world. The figure below shows the distribution of works by date of the first surviving source.

![Number of Works by Date of First Source](number_of_works_by_year.svg)

Expand Down
48 changes: 48 additions & 0 deletions about/scripts-local.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<script>

let METADATA = {% include_relative works.json %};

//////////////////////////////
//
// DOMContentLoaded event -- run after webpage has finished loading.
//

document.addEventListener("DOMContentLoaded", function () {
fillInCensusData(METADATA);
});

//////////////////////////////
//
// fillInCensusData --
//

function fillInCensusData(data) {
let workCount = 0;
let noteCount = 0;
let massCount = 0;
let motetCount = 0;
let secularCount = 0;

for (let i=0; i<data.length; i++) {
let count = data[i]["Note Count"];
if (count) {
noteCount += parseInt(count);
}
}

for (let i=0; i<data.length; i++) {
workCount++;
}

let noteElement = document.querySelector("#note-count");
if (noteElement) {
noteElement.innerHTML = noteCount;
}

let workElement = document.querySelector("#work-count");
if (workElement) {
workElement.innerHTML = workCount;
}
}

</script>
Loading

0 comments on commit a71251d

Please sign in to comment.