Charlotte Smith published "To Melancholy" as a part of her collection of poems she called "Elegiac Sonnets." She basically smushes together two types of poetic form: the elegy, or a sad, mournful poem, and the sonnet, which is traditionally a love poem. This combination was pretty mind-blowing: imagine if you heard someone singing a really peppy tune that everyone knows, like "Twinkle, twinkle little star," only they changed the words to be about death and sorrow.
That's basically what Charlotte Smith did by combining the sonnet form with the elegy, and it was a revolutionary move to make in 1785, when the only sonnets most readers were familiar with had been written a couple of centuries before, by William Shakespeare and by the Italian poet Petrarch. Charlotte Smith pretty much single-handedly re-popularized the sonnet form. Mad props.
So now that you've got the historical context, let's back up and explain what a sonnet actually is.
A sonnet is a 14-line poem. It's usually, but not always, in iambic pentameter (check out "The Windhover" by Gerard Manley Hopkins for an exception to that). We'll say more about the meter in a minute. One last thing about theme for now: a sonnet is usually, but not always, about love. ("To Melancholy" is an exception to this.)
Now, there are two types of traditional sonnets. The original is the Petrarchan sonnet, which was invented by the Italian Renaissance poet Petrarch. William Shakespeare (heard of him?) imported the sonnet form to England, and he changed it up a bit.
So, Charlotte Smith had a choice: she could use the imported English (a.k.a. Shakespearean) sonnet form, or she could go to the roots of the form and use the Petrarchan sonnet. She chose Petrarch—maybe because she wanted to re-popularize the form in England, but didn't want to do it in the same way that Shakespeare did (after all, those would be some mighty big poetic shoes to fill…).
Like almost any sonnet, "To Melancholy" is written in iambic pentameter. Now, before you glaze over, let us explain: the meter of a poem just describes the rhythm and pattern of stressed and unstressed syllables in each line. An iamb is the name of one unstressed syllable followed by a stressed syllable. It sounds like this: da-DUM. (If you say "allow" out loud, you'll hear an iamb.) "Pentameter" means that there are five (the prefix penta- means five) of those iambs per line. If we highlight the syllables you'd naturally stress as you read it, you'll see what we mean. Check it out:
When latest Autumn spreads her evening veil (1)
See? Five iambs per line = iambic pentameter.
Rhymin' and Schemin'
So that's it for the meter, or rhythm. What about the rhyme scheme? A Petrarchan sonnet is written as an octet (or group of 8 lines with an ABBAABBA rhyme scheme) followed by a sestet (group of 6 lines, usually with a rhyme scheme of CDECDE). Great. So what's that mean exactly? Well, each letter (A, B, etc.) stands for a particular end rhyme. So, in the octet for example, the last word of the first line (A) will rhyme with the last words of line 4, 5, and 8 (everywhere else an A is notated). Check out how the rhyme scheme works in this poem:
When latest Autumn spreads her evening veil, A
And the grey mists from these dim waves arise, B
I love to listen to the hollow sighs, B
Through the half-leafless wood that breathes the gale: A
For at such hours the shadowy phantom, pale, A
Oft seems to fleet before the poet's eyes; B
Strange sounds are heard, and mournful melodies, B
As of night wanderers, who their woes bewail! A
Look to the last word in each line to identify the end rhymes. As well, notice how in line 7, "melodies" only looks like it rhymes with "eyes"? That's called an eye-rhyme. Now for the sestet.
Here, by his native stream, at such an hour, C
Pity's own Otway I methinks could meet, D
And hear his deep sighs swell the sadden'd wind! E
O Melancholy!--such thy magic power, C
That to the soul these dreams are often sweet, D
And soothe the pensive visionary mind! E
There's another eye-rhyme here—did you spot it? "Mind" and "wind" only look like they rhyme.
It makes some sense that Smith should use some eye-rhymes in her sonnet. After all, this only looks like a traditional, Petrarchan sonnet. But it's addressed "To Melancholy," and not written about love, so the poem's content only looks like a traditional love sonnet. Cool, huh?