Marking Up Hymns

I have been wanting to do a project for a long while that will serve as a open repository for hymn texts and tunes. I finally bit the bullet and registered hymnody.org and have begun design of this repository. I thought, for a while, that I would use a wiki-like product, but that didn’t even come close to having the features I wanted to provide. So I’m doing a custom data-driven website.

The question I would like to ask you all is: I need a markup language for hymn texts. Hymns have particular markup requirements, if the texts are to be usefully matched up with tunes:

  1. The markup needs to break syllables in the correct places to match up with the meter of the hymn. For example, the word “blessed” can be either one or two syllables, depending on the meter of the hymn in which it is used.
  2. The markup needs to indicate line breaks.
  3. Specialized markup is needed to deal with contracted word forms and other peculiarities of setting metrical hymns, e.g.: “the˘op-ressed” needs special typesetting when engraved in music.

I could do this using HTML markup:

<div class="stanza">
  <div class="line">
    <span class="syl">Come</span> <span class="syl">Ho</span><span class="syl">ly</span> <span class="syl">Ghost,</span>
  </div>
</div>

But that is awfully wordy. Does anyone know of existing markup languages that have been designed for my needs or can be coopted? If not, do people have an opinion on defining a dialect of HTML versus inventing a new XML vocabulary?

Atom Feed for Comments 11 Responses to “Marking Up Hymns”

  1. Mike Kaply Says:

    Check out:

    http://www.ccel.org/w/waring/hymns.xml

    and

    http://www.4ml.org/

  2. Jay K Says:

    Two opposing views:

    A very thorough and verbose format, along the lines of musicxml (http://en.wikipedia.org/wiki/MusicXML, which I think can do lyrics without music)

    Very simple… html-based, and use the soft hyphen (­) to represent syllable breaks. (http://www.w3.org/TR/html4/struct/text.html#h-9.3.3) After all hymn texts are just poems.

  3. ketsugi Says:

    While I have no immediate answer for your markup question, I must say that this sounds like an extremely interesting project that I would love to be part of should you decide to make the development open as well. I’ve been thinking of doing something similar for contemporary worship songs and chords (but eventually abandoned the idea due to the likelihood of running into tons of copyright problems) and have been thinking of how to design an XML vocabulary that can capture song lyrics as well as guitar chords.

  4. Jay K Says:

    ketsugi… I haven’t looked into it enough to be able to say how well it works, but check out http://www.cifranet.org/xml/ChordML.html.

  5. Andrew Sidwell Says:

    I would suggest you use plain text (hymns are songs are poetry). Inventing a way to markup syllables seems redundant, unless you’re going to create something that looks at some tune markup, and tries to figure out which tunes and which lyrics match up. In which case, well, good luck; I’m not sure it would be worth the effort. Tunes can be modified to fit words and words can be played with to fit tunes.

    Something more useful may be keeping track of the number of syllables in each line of the text, or if it’s in a regular verse shape (randomly, something like 8-syllables-per-line rhyming couplets), then store that somehow. I’m not sure anything more specific would give enough extra data to justify the amount of time spent inputting individual syllables.

  6. ant Says:

    You could write it in XML using shorthand tags (“s” for syllable etc.), then use XSLT to write out all the HTML tags for you. It’ll save a lot of typing in the long run.

  7. MaW Says:

    Lilypond has the ability to do syllable markup in order to match up lyrics properly with notes when typesetting songs. You might want to have a look at the notation for that.

    If you’re going to do it with XML, please, please, please define a new tag for syllables. Anything with a name more than one character long will have people running away, screaming. Probably better to define your own language though – sure XML is a universal, but it’s a real pain if you want to actually write it.

  8. Neil Says:

    Why not (for ex/am/ple) just put slash/es be/tween syll/a/bles, and then trans/form this in/to wha/tev/er you like pro/gra/ma/tic/al/y?

  9. db48x Says:

    Lilypond is probably the way to go. The cool thing is that you can have a wiki that lets you type lilypond data in and get a picture back.

  10. Benjamin Smedberg Says:

    It seems several people missed that the primary purpose is marking up *texts*. No music engraving involved, at least in the first pass.

  11. db48x Says:

    If all you want is the text, then just use text. Don’t make things too complicated, just put / between syllables that are separated by the meter, etc. Then you can reuse that same text when you’re putting together lilypond files :)

Leave a Reply