diff --git a/Humdrum/Music824/Assignments/assignment2.help.html b/Humdrum/Music824/Assignments/assignment2.help.html index 50d3e95..e39c9fc 100644 --- a/Humdrum/Music824/Assignments/assignment2.help.html +++ b/Humdrum/Music824/Assignments/assignment2.help.html @@ -63,7 +63,7 @@

In order to understand what is going on, it is important to read the documentation about the shell interpreter. -A +A short description can be found in the Humdrum User Guide. Now is a good time to read this description. diff --git a/Humdrum/Music824/Assignments/submitting.work.html b/Humdrum/Music824/Assignments/submitting.work.html index 3bd0aa4..774e217 100644 --- a/Humdrum/Music824/Assignments/submitting.work.html +++ b/Humdrum/Music824/Assignments/submitting.work.html @@ -103,7 +103,7 @@
This document is available at -http://csml.som.ohio-state.edu/Music824/Assignments/submitting.work.html +https://csml.som.ohio-state.edu/Music824/Assignments/submitting.work.html diff --git a/Humdrum/Music824/music824.html b/Humdrum/Music824/music824.html index b3f116d..367a47e 100644 --- a/Humdrum/Music824/music824.html +++ b/Humdrum/Music824/music824.html @@ -69,13 +69,13 @@

  • Index to On-line Musical Scores
  • - + Online Unix Manual
  • - + Online Unix Help
  • - + Themefinder
  • @@ -98,14 +98,14 @@ Related links:

    This document is available at -http://csml.som.ohio-state.edu/Music824/index.html +https://csml.som.ohio-state.edu/Music824/index.html
    . diff --git a/Humdrum/Music824/music824.starting.html b/Humdrum/Music824/music824.starting.html index 0c96d8e..a2287b5 100644 --- a/Humdrum/Music824/music824.starting.html +++ b/Humdrum/Music824/music824.starting.html @@ -72,7 +72,7 @@

    CSML Lab Start-up (in Mershon 503)

    CSML Lab Start-up (remotely)

    The computers can also be remotely accessed over the internet. You don't access humdrum through the website. You need to use an SSH client application to connect to the command line (the "shell") on a CSML machine.

    Putty is a good client for Windows:
    - http://www.chiark.greenend.org.uk/~sgtatham/putty/

    + https://www.chiark.greenend.org.uk/~sgtatham/putty/

    For OS X, it's easiest to use the built-in ssh client:

    1. In the Finder, from the Go menu, select the Utilities item to open the Utilities folder.
    2. @@ -94,7 +94,7 @@

      Next Steps



      This document is available at -http://csml.som.ohio-state.edu/Music824/music824.starting.html +https://csml.som.ohio-state.edu/Music824/music824.starting.html diff --git a/Humdrum/Music824/unix.html b/Humdrum/Music824/unix.html index e93d20e..f724318 100644 --- a/Humdrum/Music824/unix.html +++ b/Humdrum/Music824/unix.html @@ -76,13 +76,13 @@ Useful information regarding UNIX can be found at innumerable web sites. Some useful sources are



      This document is available at -http://csml.som.ohio-state.edu/Music824/unix.html +https://csml.som.ohio-state.edu/Music824/unix.html diff --git a/_includes/chapternav-rep.html b/_includes/chapternav-rep.html index 65e76dd..583a13d 100644 --- a/_includes/chapternav-rep.html +++ b/_includes/chapternav-rep.html @@ -26,7 +26,7 @@ output += '" class="btn btn-primary btn-lg btn-responsive">Original HTML version'; // output += ' // vim: ts=3 +{% if page.verovio == "true" %} + // list of rendering jobs that need to be done once verovio has been loaded: var VEROVIO_QUEUE = []; var vrvToolkit; - -////////////////////////////// -// -// Module -- this variable is needed by the WASM version of verovio. -// The Module.onRuntimeInitialize() function will be called when -// the verovio script has been loaded and is ready to render notation. -// Once ready, the onRuntimeInitialized() function will render any -// requests that were made for notation before verovio was ready. -// - -var Module = { - onRuntimeInitialized: function() { - vrvToolkit = new verovio.toolkit(); - console.log(`Verovio (WASM) ${vrvToolkit.getVersion()} loaded`); - console.log("QUEUE", VEROVIO_QUEUE); - for (var z=0; z { + vrvToolkit = new verovio.toolkit(); + // Now process any queued rendering requests + // console.log("QUEUE", VEROVIO_QUEUE); + for (var z=0; z +{% endif %} + +{% if page.verovio == "true" %} + {% include scripts/verovio_support_functions.html %} +{% endif %} + + diff --git a/_includes/scripts/verovio_support_functions.html b/_includes/scripts/verovio_support_functions.html index 52ad447..782d089 100644 --- a/_includes/scripts/verovio_support_functions.html +++ b/_includes/scripts/verovio_support_functions.html @@ -56,10 +56,10 @@ console.log("Could not find humdrum content element with id =", id); return false; } - var newid = id + "-humdrum"; + var newid = id + "-humdrum-pre"; var target = document.querySelector("#" + newid); if (!target) { - console.log("Error: could not find Humdrum target ID", id + "-humdrum"); + console.log("Error: could not find Humdrum target ID", id + "-humdrum-pre"); return false; } // need to remove any initial blank space so that verovio can detect @@ -139,7 +139,7 @@ console.log("Error: could not find svg target #" + targetid); return; } - var humid = id + "-humdrum"; + var humid = id + "-humdrum-pre"; var helement = document.querySelector("#" + humid); if (!helement) { console.log("Error: could not find Humdrum source #" + humid); @@ -148,7 +148,15 @@ var content = helement.textContent.replace(/^\s+/, ""); var cleaned_options = cleanOptions(content, options); + content = content.replace(/\n*$/,"\n"); + if (!`${options.filter}`.match(/^\s*$/)) { + let filter = `!!!filter: ${options.filter}\n`; + content += filter; + delete cleaned_options.filter; + } + var svg = vrvToolkit.renderData(content, cleaned_options); + selement.innerHTML = svg; // automatically set the height of the Humdrum element to be the // same size as the height of the SVG (barring limitations on the @@ -212,6 +220,152 @@ } +//////////////////////////////////////////////////////////////////////////// +// +// Base64 encode/decode: Fixes problems with atob and btoa with UTF-8 encoded text. +// +// https://www.webtoolkit.info +// + +var Base64 = { + // private property + _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + + // public method for encoding + encode : function (input) { + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + + input = Base64._utf8_encode(input); + + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); + } + + return output; + }, + + // public method for decoding + decode : function (input) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + while (i < input.length) { + + enc1 = this._keyStr.indexOf(input.charAt(i++)); + + if (i < input.length) { + enc2 = this._keyStr.indexOf(input.charAt(i++)); + } else { + enc2 = 64; + } + + if (i < input.length) { + enc3 = this._keyStr.indexOf(input.charAt(i++)); + } else { + enc3 = 64; + } + + if (i < input.length) { + enc4 = this._keyStr.indexOf(input.charAt(i++)); + } else { + enc4 = 64; + } + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + + } + + output = Base64._utf8_decode(output); + + return output; + + }, + + // private method for UTF-8 encoding + _utf8_encode : function (string) { + string = string.replace(/\r\n/g,"\n"); + var utftext = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } else if((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + + return utftext; + }, + + // private method for UTF-8 decoding + _utf8_decode : function (utftext) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + + while ( i < utftext.length ) { + + c = utftext.charCodeAt(i); + + if (c < 128) { + string += String.fromCharCode(c); + i++; + } else if((c > 191) && (c < 224)) { + c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } else { + c2 = utftext.charCodeAt(i+1); + c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + } + return string; + } +} diff --git a/_includes/verovio.html b/_includes/verovio.html index 6b0fdc8..f907431 100644 --- a/_includes/verovio.html +++ b/_includes/verovio.html @@ -1,5 +1,4 @@ - +{% if include.humdrum-position == "bottom" %} + + + - - + + {% unless include.humdrum-visible == "false" %} + + + + + {% unless include.notation-visible == "false" %} + + + + {% endunless %} + +
      + + {% else %} +
      + + {% endunless %} + {% unless include.notation-visible %} +
      + +
      + {% endunless %} +
      +
      +
      +
      + +{% elsif include.humdrum-position == "top" %} + + + + + {% unless include.humdrum-visible == "false" %} + + + + + {% unless include.notation-visible == "false" %} + + + + {% endunless %} + +
      + + {% else %} +
      + + {% endunless %} + {% unless include.notation-visible %} +
      + +
      + {% endunless %} +
      +
      +
      +
      -{% unless {{include.humdrum-visible}} == "false" %} - -
      - -
      - {% else %} - -
      - -
      - -{% endunless %} - - -
      - - - - + + + + + + + {% unless include.humdrum-visible == "false" %} + + {% else %} + + {% endunless %} + {% unless include.notation-visible == "false" %} + + {% endunless %} + + {% unless include.humdrum-visible == "false" %} + + + + {% endunless %} +
      + + +
      + +
      +
      +
      +
      +
      +{% endif %} + + In general, kern is intended to represent @@ -107,13 +84,13 @@ or double whole-note is a special case and is represented by the number zero. Stem directions are encoded using the slash `/` for up-stems and -the back-slash `\\` for down-stems. +the back-slash `\` for down-stems. Pitches are represented through a scheme of upper- and lower-case -letters. Middle C (C4) is represented using the single lower-case letter -`c`. Successive octaves are designated by letter repetition, thus C5 -is represented by `cc`, C6 by `ccc` and so on. The higher the -octave, the more repeated letters. +letters. Middle C (C4) is represented using the single lower-case +letter `c`. Successive octaves are designated by letter repetition, +thus C5 is represented by `cc`, C6 by `ccc` and so on. The higher +the octave, the more repeated letters. For pitches below C4, upper-case letters are used: `C` designates C3, `CC` designates C2, and so on. Changes of octave occur between @@ -131,6 +108,12 @@ similarly encoded by repetition. Sharps, flats, and naturals are mutually exclusive in kern, so tokens such as `cc#n` and `GG-#` are illegal. +Example Humdrum data on this page is editable and the musical +notation associated with the example will be update automatically. +Try changing accidentals, stem directions, clef, time signature and +pitches in Example 2.1 to see what happens to the music notation +on the right. + In Example 2.2, two musical parts are encoded. In the corresponding kern encoding, each musical part or voice has been assigned to a different musical staff — labelled @@ -141,47 +124,14 @@ score were turned sideways. **Example 2.2.** J.S. Bach, *Praeambulum* BWV 390. {% include verovio.html - source="guide-02-2" - scale="65" + humdrum-height="100%" pageWidth="900" - humdrum-min-height="650px" + scale="55" + source="guide-02-example-02" + tab-size="12" %} - Each column contains its own separate information. Both columns @@ -228,82 +178,52 @@ Finally, pitches in kern are encoded as interpretation* is provided to indicate if the tuning system is other than equal temperament. -Two other aspects of Example 2.2 are noteworthy. In measure 3 an -inverted mordent appears on the first note in the bass part. Mordents -are encoded via the letter `M` — upper-case `M` for whole-tone -mordents and lower-case `m` for semitone mordents. Inverted mordents -are similarly encoded using the letter `W`. In Example 2.2, it is -not clear whether the mordent should be a semitone (consistent with -a G harmonic minor figure) or a whole-tone mordent (consistent with -a G melodic minor figure). The signifier `Ww` is a special -representation indicating that the ornament may be either one. - -Also evident in Example 2.2 are the upper-case letters `L` and `J`. -These encode beaming information. Each beam is opened by the letter -`L` and closed by the letter `J` (think of left and right angles). -Multiple beams and partial beams are discussed in Example 2.4. - -Example 2.3 shows a four-part chorale harmonization by Bach. In -this example, two musical parts share each of the two staves. Notice -how the corresponding kern encoding assigns -each part to a separate column, but links the appropriate parts -using the `*staff` indicators. +Two other aspects of Example 2.2 are noteworthy. In measure 3 +an inverted mordent appears on the first note in the bass part. +Mordents are encoded via the letter `M` — upper-case `M` for +whole-tone mordents and lower-case `m` for semitone mordents. +Inverted mordents are similarly encoded using the letter `W`. In +Example 2.2, it is not clear whether the mordent should be a +semitone (consistent with a G harmonic minor figure) or a whole-tone +mordent (consistent with a G melodic minor figure). The signifier +`Ww` is a special representation indicating that the ornament may +be either one. + +Also evident in Example 2.2 are the upper-case letters `L` and +`J`. These encode beaming information. Each beam is opened by the +letter `L` and closed by the letter `J` (think of left and right +angles). Multiple beams and partial beams are discussed in +Example 2.4. + +Example 2.3 shows a four-part chorale harmonization by Bach. +In this example, two musical parts share each of the two staves. +Notice how the corresponding kern encoding +assigns each part to a separate column, but links the appropriate +parts using the `*staff` indicators. **Example 2.3.** *Nun danket alle Gott*, arr. J.S. Bach. {% include verovio.html - source="guide-02-3" - scale="45" - pageWidth="900" - humdrum-min-height="475px" - tabsize="14" + filter="satb2gs" + humdrum-height="100%" + humdrum-position="top" + pageWidth="1600" + spacingNonLinear="0.55" + scale="40" + source="guide-02-example-03" + tab-size="16" %} - - Once again, clefs, key signatures and meter signatures are encoded separately for each part. Notice how the meter signature has been -encoded as 4/4 rather than `common time`. This again reflects -kern’s preoccupation with functional -information rather than orthographic information. (Later we will -see how to encode the fact that the meter signature is visually -rendered as `C` rather than 4/4.) +encoded as 4/4 rather than *common time*. This again reflects kern’s preoccupation with functional information +rather than orthographic information. (Later we will see how to +encode the fact that the meter signature is visually rendered as +`C` rather than 4/4.) In measure 2, pauses (fermatas) `;` have been encoded for all four voices even though only two pause symbols appear in the printed @@ -348,9 +268,9 @@ The equals-sign indicates the logical presence of a barline. The colon indicates the repeat sign, followed by a thin line `|`, followed by a thick line `!`. -Example 2.4 shows a keyboard work by Franz Joseph Haydn. In this -example, the lower staff appears to have two concurrent voices. The -excerpt has been encoded using three spines, two of which encode +Example 2.4 shows a keyboard work by Franz Joseph Haydn. In +this example, the lower staff appears to have two concurrent voices. +The excerpt has been encoded using three spines, two of which encode material appearing on the same staff. Notice that key signatures are provided that explicitly indicate that there are no sharps or flats in the key signature. @@ -370,64 +290,14 @@ and end with `JJ`. **Example 2.4.** Franz Joseph Haydn, *Sonata in C major, Hob. XVI: 35*. {% include verovio.html - source="guide-02-4" - scale="45" - pageWidth="1200" - humdrum-min-height="675px" + humdrum-height="100%" + pageWidth="1000" + scale="40" + source="guide-02-example-04" + tab-size="12" %} - Slurs are evident in the third measure. Open and closed slurs are @@ -470,35 +340,16 @@ completely ignore the spines. **Example 2.5.** Ojibway Song. {% include verovio.html - source="guide-02-5" - scale="65" - pageWidth="1200" - humdrum-min-height="375px" - tabsize="16" + humdrum-height="100%" + pageWidth="1000" + scale="55" + source="guide-02-example-05" + tab-size="16" %} - - ## Reference Records ## A particularly important type of global comment is the [*reference @@ -570,8 +421,8 @@ defines separate codes for publisher of the electronic edition, publisher of the original source document, date of copyright, date of data release, country of copyright, copyright message, original copyright owner, original year of publication, and other information. -The `YEC` reference record shown in Example 2.6 simply encodes the -date and copyright owner of the electronic document. +The `YEC` reference record shown in Example 2.6 simply encodes +the date and copyright owner of the electronic document. Codes that begin with `A` identify analytic information concerning the document. The code `AMT` provides a metric classification. @@ -607,7 +458,6 @@ common types of reference records. A complete description of reference records is given in Appendix II. - ## Reprise ## In this chapter we have introduced the Humdrum strophe -- selectively extract strophic data for Humdrum inputs +strophe -- selectively extract strophic +data for Humdrum inputs ------------------------------------------------------------------------ ## SYNOPSIS ## -` strophe [-s strophe_list | -x strophe_label] [inputfile ...]` +`strophe [-s strophe_list | -x strophe_label] [inputfile ...]` ------------------------------------------------------------------------ ## DESCRIPTION ## -The strophe command is used to isolate or extract selective strophic -data. Strophic data encode alternative concurrent information for a -given passage. Examples of alternative concurrent information might -include the texts for different verses of a song, alternative renditions -of the same passage (such as *ossia* passages), or differing editorial -interpretations of a given note or sequence of notes. - -The strophe command permits the user to extract selected information -paths (called *strophes*) present in a Humdrum input. - -Structurally, strophic data must begin from a single common spine, split -apart into two or more alternative spines, and then rejoin to form a -single spine. Since the strophes split from a common spine, all strophic -data necessarily begin by sharing the same data type. Different -exclusive interpretations may be introduced in the strophic passage — -provided all strophic spines end up sharing the same data type just -prior to being rejoined. - -The beginning of a strophic passage is signalled by the presence of a -*strophic passage initiator* — a single asterisk followed by the -keyword \"strophe\" (`*strophe`). The end of a strophic passage is -signalled by the *strophic passage terminator* — a single asterisk -followed by the upper-case letter \`S\' followed by a minus sign -(`*S-`). Each spine within the strophic passage begins with a *strophe -label* and ends with a *strophe end indicator* (`*S/fin`). +The strophe command is used to isolate +or extract selective strophic data. Strophic data encode alternative +concurrent information for a given passage. Examples of alternative +concurrent information might include the texts for different verses +of a song, alternative renditions of the same passage (such as +*ossia* passages), or differing editorial interpretations of a given +note or sequence of notes. + +The strophe command permits the user to +extract selected information paths (called *strophes*) present in +a Humdrum input. + +Structurally, strophic data must begin from a single common spine, +split apart into two or more alternative spines, and then rejoin +to form a single spine. Since the strophes split from a common +spine, all strophic data necessarily begin by sharing the same data +type. Different exclusive interpretations may be introduced in the +strophic passage — provided all strophic spines end up sharing +the same data type just prior to being rejoined. + +The beginning of a strophic passage is signalled by the presence +of a *strophic passage initiator* — a single asterisk followed +by the keyword "strophe" (`*strophe`). The end of a strophic passage +is signalled by the *strophic passage terminator* — a single +asterisk followed by the upper-case letter 'S' followed by a minus +sign (`*S-`). Each spine within the strophic passage begins with a +*strophe label* and ends with a *strophe end indicator* (`*S/fin`). Strophe labels may consist of either alphanumeric names, or numbers. -Numerical labels should be used when the strophic data imply some sort -of order, such as verses in a song. Alphanumeric labels are convenient -for distinguishing different editions or *ossia* passages. The following -example encodes a melodic phrase containing four numbered verses from -\"Das Wandern\" from *Die Schöne Müllerin* by Schubert. `` - -------------------------------------------------------------------- -!! Franz Schubert, \`Das Wandern\' from \"Die Schoene Muellerin\" -------------------------------------------------------------------- - ------------------ ----------------- ---------- --------- ---------- -\*\*kern \*\*text -\*\>\[V,V,V,V\] \*\>\[V,V,V,V\] -\*\>V \*\>V -\*k\[b-e-\] \*Deutsch -\* \*solo -\* \*strophe -\* \*\^ -\* \*\^ \*\^ -\* \*S/1 \*S/2 \*S/3 \*S/4 -8f Das Vom Das Die -=5 =5 =5 =5 =5 -8f Wan- Was- sehn Stei- -8b- -dern -ser wir -ne -8a ist ha- auch selbst , -8ee- des -ben den so -=6 =6 =6 =6 =6 -(16dd Mül- wir's Rä- schwer -)16ff \| \| \| \| -(16dd -lers ge- -dern sie -)16b- \| \| \| \| -8f Lust , -lernt , ab , sind , -8dd das vom den die -=7 =7 =7 =7 =7 -(8.cc Wan- Was- Rä- Stei- -)16a \| \| \| \| -8b- -dern ! -ser ! -dern ! -ne ! -8r \% \% \% \% -\* \*S/fin \*S/fin \*S/fin \*S/fin -\* \*v \*v \*v \*v -\* \*S- -\*- \*- ------------------ ----------------- ---------- --------- ---------- - -Notice that this file contains a single section labelled \`V\' (verse) -and that an expansion list occurs near the beginning of the file that -indicates the section is to be repeated 4 times in total. +Numerical labels should be used when the strophic data imply some +sort of order, such as verses in a song. Alphanumeric labels are +convenient for distinguishing different editions or *ossia* passages. +The following example encodes a melodic phrase containing four +numbered verses from "Das Wandern" from *Die schöne Müllerin* by +Schubert. + +**Example 1:** Franz Schubert, 'Das Wandern' from "Die schöne Müllerin" + +{% include verovio.html + humdrum-height="100%" + humdrum-position="top" + pageWidth="1800" + scale="40" + source="tool-strophe-example-01" + spacingLinear="0.6" + tab-size="12" + filter='shed -x text -e "s/\\s+([,!])+/$1/g; s/^[%|]$/./" | autobeam | autobeam -l' +%} + + +Notice that this file contains a single section labelled 'V' (verse) +and that an expansion list occurs near the beginning of the file +that indicates the section is to be repeated 4 times in total. The strophic passage in the above example pertains only to the spine -marked text. Following the strophic passage indicator (`*strophe`), -the spine is split apart until the required number of verses are -generated. Then each spine is labelled with its own strophe label. Since -the verses have an order, it is appropriate to label them with -numbers:`*S/1, *S/2,` and so on. The individual verses are terminated -with strophe end indicators (`*S/fin`), the spines rejoin, and then a -strophic passage terminator (`*S-`) marks the end of the strophic -passage. +marked text. Following the strophic passage +indicator (`*strophe`), the spine is split apart until the required +number of verses are generated. Then each spine is labelled with +its own strophe label. Since the verses have an order, it is +appropriate to label them with numbers:`*S/1`, `*S/2`, and so on. The +individual verses are terminated with strophe end indicators +(`*S/fin`), the spines rejoin, and then a strophic passage terminator +(`*S-`) marks the end of the strophic passage. Executing the command: -` strophe -s 4` - -produces the following output: `` - -------------------------------------------------------------------- -!! Franz Schubert, \`Das Wandern\' from \"Die Schoene Muellerin\" -------------------------------------------------------------------- - ------------------ ----------------- -\*\*kern \*\*text -\*\>\[V,V,V,V\] \*\>\[V,V,V,V\] -\*\>V \*\>V -\*k\[b-e-\] \*Deutsch -\* \*solo -8f Die -=5 =5 -8f Stei- -8b- -ne -8a selbst , -8ee- so -=6 =6 -(16dd schwer -)16ff \| -(16dd sie -)16b- \| -8f sind , -8dd die -=7 =7 -(8.cc Stei- -)16a \| -8b- -ne ! -8r \% -\*- \*- ------------------ ----------------- +```bash +strophe -s 4 +``` + +produces the following output: + + +**Example 2:** Extracting the 4th verse. + +{% include verovio.html + humdrum-height="100%" + humdrum-position="top" + pageWidth="1600" + scale="40" + spacingLinear="0.5" + source="tool-strophe-example-02" + tab-size="15" + filter='shed -x text -e "s/\\s+([,!])+/$1/g; s/^[%|]$/./" | autobeam | autobeam -l' +%} + Strophic encodings are nearly always encoded in *abbreviated* rather than *through-composed* file formats. Abbreviated encodings employ -*section labels* and *expansion-lists* in order to identify how various -passages are repeated and ordered. +*section labels* and *expansion-lists* in order to identify how +various passages are repeated and ordered. When extracting a single strophe, either the abbreviated or -through-composed versions can be used as input. However, when using the -strophe command to select more than one strophe for output, it is -essential that the input first be expanded to a through-composed -version, via the thru command. For example, in order to -select the first and third verses in the above passage by Schubert, the +through-composed versions can be used as input. However, when using +the strophe command to select more than +one strophe for output, it is essential that the input first be +expanded to a through-composed version, via the thru command. For example, in order to select +the first and third verses in the above passage by Schubert, the user would need to execute the following command pipeline: -` thru wandern | strophe -s 1,3` +```bash +thru wandern.krn | strophe -s 1,3 +``` -The list following the s option can contain individual strophes -separated by commas. For example, the following command extracts verses -1, 3 and 4 in succession: +The list following the s option can +contain individual strophes separated by commas. For example, the +following command extracts verses 1, 3 and 4 in succession: -` thru wandern | strophe -s 1,3,4` +```bash +thru wandern.krn | strophe -s 1,3,4 +``` Strophes may also be output in non-numeric order as in the following command invocation: -` thru wandern | strophe -s 4,3,2,1` - -If the x option is invoked, strophe outputs only a single -strophe whose string *label* is specified as an option. Strophe names -need not be numerical. E.g. - -` strophe -x ossia` - -If the strophe command is invoked without any option, then all -strophes are expanded in the output in numerical order beginning with -strophe 1. Missing numerical strophes (such as a missing strophe `S/3` -in a four-strophe encoding) will cause an error to be generated and -terminate the strophe command. - -Note that the strophe command allows strophe numbers containing a -single decimal point, such as strophe `*S/4.2`. Having extracted the -verse `*S/1`, the strophe command will output verse `*S/1.1` in -preference to `*S/2` — if the decimal strophe is present. This feature -allows more than one strophic passage to be encoded within a single -abbreviated format file. This feature might prove useful, for example, -in a musical work that contains a brief refrain in the middle of each -verse. +``` +thru wandern.krn | strophe -s 4,3,2,1 +``` + +If the x option is invoked, strophe outputs only a single strophe whose +string *label* is specified as an option. Strophe names need not +be numerical. E.g. + +```bash +strophe -x ossia +``` + +If the strophe command is invoked without +any option, then all strophes are expanded in the output in numerical +order beginning with strophe 1. Missing numerical strophes (such +as a missing strophe `S/3` in a four-strophe encoding) will cause +an error to be generated and terminate the strophe command. + +Note that the strophe command allows +strophe numbers containing a single decimal point, such as strophe +`*S/4.2`. Having extracted the verse `*S/1`, the strophe command will output verse `*S/1.1` in +preference to `*S/2` — if the decimal strophe is present. +This feature allows more than one strophic passage to be encoded +within a single abbreviated format file. This feature might prove +useful, for example, in a musical work that contains a brief refrain +in the middle of each verse. The various strophe-related tandem interpretations are summarized below: ---------------- ----------------------------- -\*strophe strophic passage initiator -\*S- strophic passage terminator -\*S/*string* strophe name label -\*S/*n\[.n\]* strophe number label -\*S/fin strophe end indicator ---------------- ----------------------------- +**Table 1:** *Types of Strophe Interpretations* -*Types of Strophe Interpretations* +{% include_relative tool-strophe-table-01.txt %} Note that for each strophic passage, all strophe labels must appear on the same record. See [EXAMPLES](#EXAMPLES) below. @@ -213,142 +190,61 @@ The *strophe* command provides the following options: --------------------- ------------------------------------------------------- h displays a help screen summarizing the command syntax --s *strophe\_list* output numbered strophes according to *strophe\_list* --x *strophe\_label* output only strophes labelled *strophe\_label* ---------------------- ------------------------------------------------------- -Options are specified in the command line. +{% include_relative tool-strophe-options.txt %} + +Options are specified on the command line. ------------------------------------------------------------------------ -[]{#EXAMPLES} +
      ## EXAMPLES ## -The following example is concocted to illustrate the operation of the -strophe command. Consider the following Humdrum input: `` - -------------------------- -------------------- --------- -!! \`strophe\' example. -\*\*example \*\*bar -\*\>\[A,V,V,Coda\] \*\>\[A,V,V,Coda\] -\*\>A \*\>A -A i -\*\>V \*\>V -\* \*\*foo -\* \*strophe -\* \*\^ -\* \*S/1 \*S/2 -B 1 2 -\* \*S/fin \*S/fin -\* \*v \*v -\* \*S- -\* \*\*bar -C refrain -\* \*strophe -\* \*\^ -\* \*S/1.1 \*S/2.1 -B 1 2 -\* \*S/fin \*S/fin -\* \*v \*v -\* \*S- -\*\>Coda \*\>Coda -\* \*\*foo -E i -\*- \*- -------------------------- -------------------- --------- - -Since this file is in abbreviated format, we must first expand it to -through-composed form using the thru command. The -resulting output is: `` - -------------------------- -- -- ----------- -- -- --------- -!! \`strophe\' example. -\*\*example \*\*bar -\*thru \*thru -\*\>A \*\>A -A i -\*\>V \*\>V -\* \*\*foo -\* \*thru -\* \*strophe -\* \*\^ -\* \*S/1 \*S/2 -B 1 2 -\* \*S/fin \*S/fin -\* \*v \*v -\* \*S- -\* \*\*bar -\* \*thru -C refrain -\* \*strophe -\* \*\^ -\* \*S/1.1 \*S/2.1 -B 1 2 -\* \*S/fin \*S/fin -\* \*v \*v -\* \*S- -\*\>V \*\>V -\* \*\*foo -\* \*thru -\* \*strophe -\* \*\^ -\* \*S/1 \*S/2 -B 1 2 -\* \*S/fin \*S/fin -\* \*v \*v -\* \*S- -\* \*\*bar -\* \*thru -C refrain -\* \*strophe -\* \*\^ -\* \*S/1.1 \*S/2.1 -B 1 2 -\* \*S/fin \*S/fin -\* \*v \*v -\* \*S- -\*\>Coda \*\>Coda -\* \*\*foo -\* \*thru -E i -\*- \*- -------------------------- -- -- ----------- -- -- --------- +The following example is concocted to illustrate the operation of +the strophe command. Consider the following +Humdrum input: + +{% include verovio.html + notation-visibile="false" + source="tool-strophe-example-03" + tab-size="16" +%} + + +Since this file is in abbreviated format, we must first expand it +to through-composed form using the thru +command. The resulting output is: + +{% include verovio.html + notation-visible="false" + source="tool-strophe-example-04" + tab-size="16" +%} + The command: -` strophe file` - -will produce the following output: `` - -------------------------- ---------- -!! \`strophe\' example. -\*\*example \*\*bar -\*thru \*thru -\*\>A \*\>A -A i -\*\>V \*\>V -\* \*\*foo -\* \*thru -B 1 -\* \*\*bar -\* \*thru -C refrain -B 1 -\*\>V \*\>V -\* \*\*foo -\* \*thru -B 2 -\* \*\*bar -\* \*thru -C refrain -B 2 -\*\>Coda \*\>Coda -\* \*\*foo -\* \*thru -E i -\*- \*- -------------------------- ---------- +```bash +strophe file +``` + +will produce the following output: + +{% include verovio.html + humdrum-min-height="475px" + notation-visible="false" + source="tool-strophe-example-05" + tab-size="16" +%} + + ------------------------------------------------------------------------ @@ -356,22 +252,16 @@ E i DOS 2.0 and up, with the MKS Toolkit. OS/2 with the MKS Toolkit. UNIX systems supporting the *Korn* shell or *Bourne* shell command -interpreters, and revised *awk* (1985). +interpreters, and revised *awk* (1985). (The **strophe** command was +lost, but a partial emulation was added to Humdrum Extras.) ------------------------------------------------------------------------ ## SEE ALSO ## -` extract (4), thru (4), *strophe (2), yank (4)` +extract (4), thru (4), strophe (2), yank (4) ------------------------------------------------------------------------ -\ -- [**Pertinent description in the Humdrum User - Guide**](../guide20.html#The_strophe_Command) -- [**Index to Humdrum Commands**](../commands.toc.html) -- [**Table for Contents for Humdrum User Guide**](../guide.toc.html) -\ -\ diff --git a/tool/strophe/tool-strophe-example-01.txt b/tool/strophe/tool-strophe-example-01.txt new file mode 100644 index 0000000..c1a681d --- /dev/null +++ b/tool/strophe/tool-strophe-example-01.txt @@ -0,0 +1,36 @@ +!!!Schubert, Franz +!!!OPR: Die schöne Müllerin +!!!OTL: Das Wandern +**kern **text +*M2/4yy * +*>[V,V,V,V] *>[V,V,V,V] +*>V *>V +*k[b-e-] *lang:DE +* *solo +* *strophe +* *^ +* *^ *^ +* *S/1 *S/2 *S/3 *S/4 +8f Das Vom Das Die +=5 =5 =5 =5 =5 +8f Wan- Was- sehn Stei- +8b- -dern -ser wir -ne +8a ist ha- auch selbst , +8ee- des -ben den so +=6 =6 =6 =6 =6 +(16dd Mül- wir's Rä- schwer +16ff) | | | | +(16dd -lers ge- -dern sie +16b-) | | | | +8f Lust , -lernt , ab , sind , +8dd das vom den die +=7 =7 =7 =7 =7 +(8.cc Wan- Was- Rä- Stei- +16a) | | | | +8b- -dern ! -ser ! -dern ! -ne ! +8r % % % % +* *S/fin *S/fin *S/fin *S/fin +* *v *v *v *v +* *S- += = +*- *- diff --git a/tool/strophe/tool-strophe-example-02.txt b/tool/strophe/tool-strophe-example-02.txt new file mode 100644 index 0000000..a1023e6 --- /dev/null +++ b/tool/strophe/tool-strophe-example-02.txt @@ -0,0 +1,30 @@ +!!!Schubert, Franz +!!!OPR: Die schöne Müllerin +!!!OTL: Das Wandern +**kern **text +*M2/4 * +*>[V,V,V,V] *>[V,V,V,V] +*>V *>V +*k[b-e-] * +* *lang:DE +* *solo +8f Die +=5 =5 +8f Stei- +8b- -ne +8a selbst , +8ee- so +=6 =6 +(16dd schwer +16ff) | +(16dd sie +16b-) | +8f sind , +8dd die +=7 =7 +(8.cc Stei- +)16a | +8b- -ne ! +8r % += = +*- *- diff --git a/tool/strophe/tool-strophe-example-03.txt b/tool/strophe/tool-strophe-example-03.txt new file mode 100644 index 0000000..a70dfab --- /dev/null +++ b/tool/strophe/tool-strophe-example-03.txt @@ -0,0 +1,27 @@ +!! 'strophe' example +**example **bar +*>[A,V,V,Coda] *>[A,V,V,Coda] +*>A *>A +A i +*>V *>V +* **foo +* *strophe +* *^ +* *S/1 *S/2 +B 1 2 +* *S/fin *S/fin +* *v *v +* *S- +* **bar +C refrain +* *strophe +* *^ +* *S/1.1 *S/2.1 +B 1 2 +* *S/fin *S/fin +* *v *v +* *S- +*>Coda *>Coda +* **foo +E i +*- *- diff --git a/tool/strophe/tool-strophe-example-04.txt b/tool/strophe/tool-strophe-example-04.txt new file mode 100644 index 0000000..d7d58d3 --- /dev/null +++ b/tool/strophe/tool-strophe-example-04.txt @@ -0,0 +1,49 @@ +**example **bar +*thru *thru +*>A *>A +A i +*>V *>V +* **foo +* *thru +* *strophe +* *^ +* *S/1 *S/2 +B 1 2 +* *S/fin *S/fin +* *v *v +* *S- +* **bar +* *thru +C refrain +* *strophe +* *^ +* *S/1.1 *S/2.1 +B 1 2 +* *S/fin *S/fin +* *v *v +* *S- +*>V *>V +* **foo +* *thru +* *strophe +* *^ +* *S/1 *S/2 +B 1 2 +* *S/fin *S/fin +* *v *v +* *S- +* **bar +* *thru +C refrain +* *strophe +* *^ +* *S/1.1 *S/2.1 +B 1 2 +* *S/fin *S/fin +* *v *v +* *S- +*>Coda *>Coda +* **foo +* *thru +E i +*- *- diff --git a/tool/strophe/tool-strophe-example-05.txt b/tool/strophe/tool-strophe-example-05.txt new file mode 100644 index 0000000..a7c8fd6 --- /dev/null +++ b/tool/strophe/tool-strophe-example-05.txt @@ -0,0 +1,26 @@ +!! 'strophe' example. +**example **bar +*thru *thru +*>A *>A +A i +*>V *>V +* **foo +* *thru +B 1 +* **bar +* *thru +C refrain +B 1 +*>V *>V +* **foo +* *thru +B 2 +* **bar +* *thru +C refrain +B 2 +*>Coda *>Coda +* **foo +* *thru +E i +*- *- diff --git a/tool/strophe/tool-strophe-options.txt b/tool/strophe/tool-strophe-options.txt new file mode 100644 index 0000000..542f62a --- /dev/null +++ b/tool/strophe/tool-strophe-options.txt @@ -0,0 +1,6 @@ + +| Option | Description | +| ------ | ----------- | +| -s strophe_list | output numbered strophes according to *strophe_list* +| -x strophe_label | output only strophes labelled *strophe_label* + diff --git a/tool/strophe/tool-strophe-table-01.txt b/tool/strophe/tool-strophe-table-01.txt new file mode 100644 index 0000000..79a9209 --- /dev/null +++ b/tool/strophe/tool-strophe-table-01.txt @@ -0,0 +1,9 @@ + +| interpretation | meaning | +| -------------- | ------- | +| `*strophe` | strophic passage initiator +| `*S-` | strophic passage terminator +| `*S/`*string* | strophe name label +| `*S/`*n\[.n\]* | strophe number label +| `*S/fin` | strophe end indicator +