Need Meter For Your Lyrics?

I had to show this html / javascript file I created using Claude. You type in your lyrics and it gives you the accent marks of your text. I call it the Lyric Meter Analyzer project. I am now on version two in development (see links below). Here is some background:

I asked the question: Is there a way to convert poetry meter to musical meter?

Yes, there’s a rich and well-established relationship between poetry meter and musical meter — they share deep historical roots (song and poetry were essentially the same thing in ancient Greece), and converting between them is very doable, though it involves some interpretation.

The core correspondence

Poetic meter is built on feet — patterns of stressed (/) and unstressed (u) syllables. Musical meter is built on beats — patterns of strong and weak pulses grouped into measures. The two map onto each other naturally:

  • A stressed syllable ≈ a strong beat (downbeat)
  • An unstressed syllable ≈ a weak beat (upbeat or offbeat)

Foot-to-time-signature conversions

The most common poetic feet translate fairly cleanly into musical equivalents:

  • Iamb (u /) → 2/4 or 6/8 time, with the melody landing on beat 2 (a classic “pickup” feel)
  • Trochee (/ u) → 2/4 time, strong downbeat, like a march
  • Dactyl (/ u u) → 3/4 or 6/8, similar to a waltz
  • Anapest (u u /) → 6/8 or 12/8, with a galloping, lilting feel
  • Spondee (/ /) → can suggest 2/2 (cut time), two equal strong beats
  • Amphibrach (u / u) → 3/4 with the accent on beat 2

Practical steps for conversion

  1. Scan the poem — mark stressed and unstressed syllables
  2. Identify the dominant foot — this determines your time signature
  3. Set each foot as one measure (or one beat, depending on the tempo you want)
  4. Assign note values — stressed syllables get longer or stronger notes (quarter notes, dotted notes), unstressed syllables get shorter ones (eighth notes)
  5. Handle substitutions — poets vary their feet for rhythmic interest; you’d do the same in music with syncopation, ties, or triplets

A quick example

Take an iambic pentameter line: “Shall I compare thee to a summer’s day?” (u / u / u / u / u /)

In music, you might set this in 5/4 (five iambs = five beats), or break it into measures of 2/4 and let each iamb occupy one measure across ten bars, with the unstressed syllables as eighth-note pickups into each downbeat.

Where it gets nuanced

  • Pyrrhic and spondee substitutions (very light or very heavy feet) require judgment calls — do you use rests, ties, or note length adjustments?
  • Elision and syncopation — poets sometimes slur syllables together; this maps well onto musical ties and syncopation
  • Speech rhythm vs. musical rhythm — the best text-setting composers (Purcell, Britten, Wolf) often subtly bend the meter to match natural speech, rather than forcing a rigid grid

Version two has an external database that I can only upload as a zip file (see second link below) since it is a .js file. I have also included the “xsd” schema file and the xsl file for transformation. Unzip the folder and open the html file to run. You can also run the html file here (first link) but it uses an algorithm to determine each word’s stress markings. The CMU Pronouncing Dictionary is a free, open-source pronunciation dictionary developed at Carnegie Mellon University that contains over 134,000 English words. Each entry maps a word to its phonemes (sounds) and crucially includes stress markers — 0 for unstressed, 1 for primary stress, and 2 for secondary stress. So the word “amazing” would be encoded something like AH0 M EY1 Z IH0 NG, telling you immediately that the second syllable carries primary stress. Other improvements in version two are the ability to identify musical form and customize the sections (chorus, verses, etc).

Example of html output after Stylesheet transformation