Humdrum Workshop
Music Encoding Conference
19 Juliol 2021, 15:30-18:00
Alacant, Espanya
w/ Craig Stuart Sapp
Humdrum data format
Humdrum data
4C
4c
4cc
=3
T
4 = quarter note
C = C below middle C
cc = C above middle C
= = barline
T = trill (major second)
Start of data (“exclusive interpretations”)
End of data (“spine terminators”) star-dash (not underscore)
**kern = “core” of music
**text = lyric text
Start of data (“exclusive interpretations)
End of data (“spine terminators”) star-dash (not underscore)
**kern = “core” of music
**text = lyric text
“Tandem interpretations”
*clefF4 = bass clef
*clefG2 = treble clef
*M2/4 = 2/4 time signature
Data modifiers
Data rows indicate simultaneities in score
Data columns indicate parts (or streams of other parallel data) in score
http://bit.ly/twinkle-humdrum
Introduction to Humdrum music encoding
Verovio Humdrum Viewer
http://verovio.humdrum.org
Verovio Humdrum Viewer
Digital score
Graphical score
Hide digital score
Hide digital score from URL
Erase the score
Erase the score from URL
Erase the score from the toolbar
Hello World
Dash (minus sign), not underscore
Hello World (2)
Hello World (3)
Hello World (4)
Hello World (5)
One (or more) tabs between columns
Hello World (6)
Editing Humdrum Scores in VHV
Arrow Key Navigation
VHV note navigation
Moving Melodically
Esc key
To exit
editing
Moving Harmonically
Esc key
To exit
editing
Graphically
editing pitch/accidentals
Exercise: Editing pitches in Bach chorales
Click on “Scores” in menu then click on “Bach 370 chorales”
Or click on link at top of page to go to the first chorale in the repertory
Humdrum diatonic pitch names
c, d, e, f, g, a, b = Middle C octave (C4-B4 in scientific pitch
notation)
C, D, E, F, G, A, B = Octave lower (C3-B3)
Doubling lower case names raises the octave; doubling upper case names lowers the octave
Special pitch encodings
r = rest
rc = rest + pitch: rest displayed at given pitch height on staff
rr = force display of rest as a whole-measure rest
R = not a real pitch: visual pitch only (percussion notation)
RR = semi-pitched: not real pitch but relative pitch is accurate
(semi-pitched percussion)
Changing pitch graphically
Humdrum **kern Accidentals
# = sharp
## = double sharp
- = flat
-- = double flat
#y = invisible sharp #X = visible sharp
natural-sharp (double sharp cancellation)
editorial accidentals
n = natural
Automatic / Explicit display of accidentals
Implicit visual
accidentals
explicit
very
explicit
VHV graphical editing of accidentals
# = toggle sharp
- = toggle flat
2# = double sharp
2- = double flat
n = toggle natural
x = toggle forced display of accidental
i = toggle regular/editorial accidental
Slurs
Adding slurs graphically
Slur over multiple notes
4s
Slur orientation
b
Moving slur ends
N.B.: Graphical editing of slurs cannot be done across spine manipulation boundaries (yet).
Articulations
Articulations
Multiple articulations
9~
Pedaling
Adding Pedal-down graphically
p
p
Adding Pedal-up graphically
P
Adding Pedal up/down manually
Figured bass
Adding figured bass
Add new column for figured bass
extract -s 1,0,2-4
Fill in figured bass
Harmony
Adding harmony
Adding harmony spine
extract -s 0,1-4
Add **harm data to empty spine
extract -s 0,1-4
Mensural music
Mensural music (**mens)
Embedded
Verovio
option
Ligatures in CMN
Coloration in CMN
Marking / coloring notes
Basic marks
Multiple marks
Color interpretation
Color spine
Highlighting measures
Scroll to measure on loading
Highlighting one measure
Editing Tips
Freezing Notation
Freeze notation
unfrozen:
frozen:
!!ignore / !!Xignore
Selective rendering
Kernview filter
Editing one part of a full score
Visualizing Layers
Visualizing layer information
Save/Load Buffers
Saving editor contents to local buffer
Loading editor contents from local buffer
Google Spreadsheet
interaction
Spreadsheet toolbar
Upload data and edit
Download edited data
Download invalid data
Filtering
VHV architecture
Ace text editor
Verovio toolkit
Humlib
(filtering & conversion to MEI)
graphic
notation
SVG
MEI
Humdrum
Compile filter (alt-c)
satb2gs
satb2gs filter
satb2gs
Filter active
Click on circle icon
To cycle toolbar to
Filter toolbar
Activate filter
(press enter)
Embedded filters
!!!filter: satb2gs | extract -s 2
!!!filter: transpose -k g
extract
extract filter
Adding lyrics
Add an empty spine (column) to score
extract -s 1-4,0
Compiling a filter
New spine appears after compiling
Change data type from **blank to **text
myank
myank: “measure yank”
msearch
msearch: “music search”
msearch (2)
msearch -p cfacfagfef | myank --marks -d
search toolbar
Equivalent to myank --marks -d
Equivalent to msearch -p cfacfagfef
colortriads
colortriads
autostem
autostem
autostem -r
Removes stems
Apply and compile
autobeam
autobeam
transpose
transpose
transpose -k d
Input data
Humdrum
Loading Humdrum files from URL
Loading Humdrum files from built-in repertories
Drag-and-Drop Humdrum files
MusicXML
MusicXML import
Convert MusicXML into Humdrum
Humdrum conversion
Outputs
MEI data
Convert Humdrum to MEI data with alt-m
Convert Humdrum to MEI data with alt-m
Click on note to locate MEI source
Save editor contents (to browser downloads)
MusicXML data
Converting and Saving MusicXML data
Viewing MusicXML conversion in MuseScore
PDF files
Saving PDF file
Saving PDF file (2)
Musical excerpts
SVG excerpt
PDF excerpt
Loading into MS Word
VHV online scores
Online scores
Associated
website
Associated repository
List of Mozart piano sonatas
Mozart piano sonata movement
Work/
movement
navigator
shift+
left/right
arrow keys
are shortcuts
Shift-up
returns to
worklist
View source scan
View > Show source scan
Keyboard shortcut: alt-p
Where digital scores are stored
Keyscapes
Saving to HTML in VHV
Save as HTML
Open HTML file in web browser
Humdrum Notation Plugin
16:30
Basic verovio usage
<html>
<head>
<script src="http://verovio-script.humdrum.org/scripts/verovio-toolkit-wasm.js"></script>
</head>
<body>
<h1> Musical Example</h2>
<div id="notation"></div>
<script type="text/x-html" id="my-score">
**kern
*clefG2
*M4/
1c;
==
*-
</script>
<script>
let tk;
document.addEventListener("DOMContentLoaded", (event) => {
Module.onRuntimeInitialized = async _ => {
tk = new verovio.toolkit();
let humdrumdata = document.querySelector("#my-score")
.textContent.replace(/^\s+/, "");;
let options = {
scale: 120,
pageWidth: 3200,
pageHeight: 60000,
adjustPageHeight: 1,
spacingSystem: 18,
evenNoteSpacing: 1,
};
let element = document.querySelector("#notation");
let svg = tk.renderData(humdrumdata, options);
element.innerHTML = svg;
}});
</script>
</body>
</html>
Web worker
User interface thread
Web worker thread
Verovio toolkit
Input data
Output SVG
Humdrum Notation Plugin
Embedding data directly into webpage
<html>
<head>
<title>My Score</title>
<script src="https://plugin.humdrum.org/scripts/humdrum-notation-plugin-worker.js">
</script>
</head>
<body>
<h1>A musical example:</h1>
<script>
displayHumdrum({
source: "my-score",
autoResize: "true",
header: "true"
});
</script>
<script type="text/x-humdrum" id="my-score">
**kern
*clefG2
*M4/4
1c;
==
*-</script>
</body>
</html>
Source code for webpage
<html>
<head>
<title>My Score</title>
<script src="https://plugin.humdrum.org/scripts/humdrum-notation-plugin-worker.js">
</script>
</head>
<body>
<h1>A musical example:</h1>
<script>
displayHumdrum({
source: "my-score",
autoResize: "true",
header: "true"
});
</script>
<script type="text/x-humdrum" id="my-score">
**kern
*clefG2
*M4/4
1c;
==
*-</script>
</body>
</html>
embedded Humdrum
data
Find Humdrum data script labeled “example” and create notation (inserted at location of Humdrum script element).
Humdrum Notation Plugin script
Loading data from URL
<html>
<head>
<title>My Score</title>
<script src="https://plugin.humdrum.org/scripts/humdrum-notation-plugin-worker.js">
</script>
</head>
<body>
<h1>Another musical example:</h1>
<script>
displayHumdrum({
source: "my-score",
scale: 25,
url: "https://raw.githubusercontent.com/craigsapp/mozart-piano-sonatas/master/kern/sonata06-3c.krn"
});
</script>
<script type="text/x-humdrum" id="my-score"></script>
</body>
</html>
Note: no data since it comes from URL
Passing filter parameters
<script>
displayHumdrum({
source: "example3",
scale: 25,
uri: "github://craigsapp/bach-370-chorales/kern/chor001.krn",
filter: "extract -k4 | transpose -kc | msearch -q gfedc"
});
</script>
Command-line Tools
17:00
Installing command-line tools
cd $(which cint | sed s/humextra.*//)
make update
make
Update software at a later date:
Downloading repertories
mkdir chorales
cd chorales
humsplit h://chorales
ls
How many notes
notecount *.krn
How many notes with written repetitions?
84666
thrux *.krn | notecount
99388
Most common sonorities
Most common sonorities (2)
tntype *.krn ⇒ Forte-number sonorities (non-inverted)
ridx -H ⇒ Remove Humdrum data structure elements
sortcount -p ⇒ sort and convert to percentages
head -n 20 ⇒ list top 20 sonorities
tntype *.krn | ridx -H | sortcount -p | head -n 20
Most common melodic intervals in Bach chorales
cat *.krn | mint | serialize | ridx -H | grep -v [r[] | sortcount -v --sort interval -T "Chorale melodic intervals" -x interval > /tmp/analysis.html
Most common melodic intervals in soprano part
cat *.krn | extractx -s 4 | mint | serialize | ridx -H | grep -v [r[] | sortcount -v --sort interval -T "soprano melodic intervals" -x interval > /tmp/analysis.html
Dissonance labels
Label frequencies for all works in database
Dissonance frequencies in JRP scores
Humdrum-based
websites
17:15
Musical Dice Game
Musical Dice Game
Musical Dice source code
HTML for website
Hosted with Github Pages
Bach chorales
Example use of Humdrum Notation Plugin
On-demand notation rendering
Chorale #2
displays
after
clicking
on its title:
notation generated on demand
Chorale typesetting page
Create musical examples for your own webpages
Notice filter to extract parts
Humdrum data file for website
Tasso in Music Project
Tasso in Music Project website
Musical settings by poem
Tasso work pages
Tasso poetry variants
https://github.com/TassoInMusicProject/tasso-website/blob/gh-pages/data/variorum/Trm0047.aton
TiMP editing in VHV
TiMP digital scores on Github
TiMP metadata for website
@@BEGIN: SETTING
@CATALOGNUM: Trm0164a
@RIMETITLE: Vuol che l'ami costei, ma duro freno
@SOLERTI: 164
@COMPOSER: Barbarino, Bartolomeo
@PRINCEPSTITLE: Canzonette a una e due
@PRINCEPSLOC: Venetia
@NORMLOC: Venice
@NORMPUB: Amadino
@NORMPUBSHORT: Amadino
@PRINCEPSPUB: Amadino
@PRINCEPSYEAR: 1616
@PRINCEPSRISM: B 877
@OVOICES: 1+bc
@EXTANTVOICES: 1+bc
@PARTBOOKS:
@EXTPARTBOOKS:
@OCLEFS: C1,F4
@OMENSURATION: C
@OKEYSIG: b-
@FINAL: F
@TIMPEDITOR: Schleuse, Paul
@YOUTUBE: c6vgpu_A5AI
@YOUTUBESTART: 14
@YOUTUBEEND: 212
@NOTE:
@@END: SETTING
Other web resources used to create TiMP website
Jekyll is a static templating system for creating webpages hosted on a server (such as Github Pages). Handlebars is a javascript templating system used to create dynamic content from within a webpage (load data from server, then create HTML content to display data).
Interface to JSON which allows comments within data and easier encoding markup.
Used to create data plots within website
Josquin Research Project
Josquin Research Project
Josquin Research Project census page
Work pages
Data conversions
Vocal ranges
Work-level searching
Work-level analyses
Digital scores on Github
JRP scores in VHV
Chopin First Editions
Chopin First Editions
Work pages
Dynamic layout controls
Musical content searching
:Repertory-level searching
Work-level searching:
Musical content searching (2)
Automatic variant analysis
Kistner
Wessel
Schlesinger
Humdiff filter
Chooser filter
Chopin First Editions Github repository
Polyrhythm Project
Polyrhythm Project Website
Polyrhythm Project example pages
Metadata
Humdrum/Verovio notation
Analytic markup
Polyrhythm project digital scores in VHV
Analysis in VHV
Polyrhythm project digital scores on Github
Ratioscore
Specialized music representations in Humdrum
Specialized music representations in Humdrum
Humdrum notes
Humdrum documentation website
VHV documentation website
VHV issues (report bugs and request features)
**HUG: Humdrum Uers’s Group
Humlib: C++ Humdrum data parser