Text painting is a technique of music composition in which the composer deliberately illustrates aspects of the words in the text with localized aspects of the music. It is also called madrigalism (after the Renaissance madrigals who popularized it), word-painting, and less frequently as musica reservata. Examples help.
  • In Handel's famous oratorio Messiah, every mention of the word iniquity is underscored with unusual 7th chords or diminished chords, highlighting our contempt for the word and all things associated.
  • In the French composer Léo Delibes' exotic opera Lakme, the daughter of the priest imitates the sound of a bell with words in the aptly named "The Bell Song".
  • Monteverdi, in the Vespers aria "Nigra sum et formosa" (I am dark and comely) the words for dark are sung low and rich, and immediately afterwards the soloist must leap an octave to illustrate the words for comely.
Modern composers tend to eschew text painting as it is seen as a cleverness, i.e. an attempt at wit, or musical punning, rather than a "serious" musical expression.

But you can occasionally find it in modern popular music.

  • In Nirvana's All Apologies, Cobain gave the word sun the highest note in each line, (hum it and see, I'll wait) which I take to illustrate both its physical position over us and its metaphorical importance in the song. (Also note that the word married in the following line is the same note as sun from the preceding, illustrating a text-painted tonal rhyme of sorts.)
  • Most recently I was pleased to find Andrew Bird, crooning an adaptation of Galway Kinnell's poem First Song, oddly mouthing and stretching out the word what in the line "He began to hear the pond frogs all/Calling on his ear with whaaaaat seemed their joy." For a while I didn't get it, because the effect isn't initially that pleasant, and the word what didn't seem to bear emphasis—until I recognized that the treatment made it sound similar to a bullfrog's croak.

A false example: When I first learned the term, I was given the example of American national anthem The Star-Spangled Banner, in which the note for the word free in "the la-and of the freeeee…." is the most difficult to hit. This has been interpreted to illustrate that freedom is difficult to attain, but, as the lyrics were first written as a poem and later applied to the melody of a British drinking song titled "To Anacreon in Heaven" that was at the time almost a century old, I don't think we can ascribe intention on the part of Francis Scott Key (the poet), John S. Skinner (the adaptor), or John Stafford Smith (the drunkard).

A music-less example: Shakespeare used this kind of technique in Act I scene ii of Henry V, when the ambassador to the Dauphin brings a case of tennis balls to mock the king. Throughout Henry's response, the repeated use of the word mock illustrates the pitched sound of a match.