Through the centuries, countless artists have tapped their suffering for creative inspiration. Add playwright and performer Michael Yates Crowley and director Michael Rau to that list.

Crowley and Rau are the duo behind a new offering at Oberon, “Song of a Convalescent Ayn Rand Giving Thanks to the Godhead (In the Lydian Mode),” a quirky multimedia cabaret that examines intersections of pain, illness, and art with a little help from the unlikely pairing of Ludwig van Beethoven and Ayn Rand.

It’s also a show with deeply personal roots.

Crowley has known the nightmare of migraines, debilitating headaches that can strike without warning and incapacitate the sufferer for hours — sometimes days — since he was a boy. Now he is putting his pain on stage.

The show grew directly out of the migraine diaries (“dry data”) he began compiling in high school. The entries tracked his sleeping and eating habits to identify lifestyle choices or even weather patterns that might be affecting his migraines.

Eventually Crowley’s inner poet took over, transforming his journals, he said, into “an extremely weird way of describing what was happening to me.” He blended characters from his imagination with his daily routines and medical research about the headaches. Later, his longtime friend Rau helped him see the theatrical potential in those words.

The spirituality of the stage

The two met at their Illinois high school, where they shared a love for the stage. They worked on Shakespeare plays as teens and remained friends and collaborators through college and beyond. In 2007, they founded a company, Wolf 359, and began producing their own shows. In 2012, they piled Crowley’s 15 years of headache information and daily musings on the floor. Rau, Crowley said, “cut things up and mushed them together.” What emerged were two very different approaches to illness inspired by two very different cultural icons, the German pianist and composer Beethoven and the Russian-born American libertarian author Rand.

Recovering from a serious illness, Beethoven wrote his lush “String Quartet in A Minor, Opus 132,” in 1825. He titled its third movement “A Convalescent’s Hymn of Thanksgiving to God, in the Lydian Mode.” A recent performance of the movement was described by a reviewer as “an almost mystical meditation on overcoming illness.”

But while Beethoven used illness as inspiration, Rand had no time for pain or suffering. She “denied illness and weakness entirely and refused to accept it,” said Crowley, and adopted the approach that “if you are sick, then it must be in your head.”

Through song and dance, monologue and mayhem, Rau and Crowley investigate those opposing viewpoints. Crowley in the lead portrays a range of characters: himself, Rand, Beethoven, and even a drag queen, in an effort to probe pain and suffering.

Rau said the show, viewed through the lens of Crowley’s migraines, is “a perfect exploration of this idea of what do you do with suffering.”

“Everyone will experience something bad happening at some point in their life,” Rau said, and the show asks important questions such as: “What do you learn from that? What do you take away from that? How do you handle that when it happens?”

Harvard’s Fanny Peabody Professor of Music Alexander Rehding said Beethoven, who composed some of his greatest works after going deaf, is inextricably linked to the notion of overcoming suffering and adversity. “That’s what we take away from Beethoven’s biography,” said Rehding, “and that’s what we hear in his music.”

Following their performance on Oct. 22, Crowley and Rau will take part in a discussion about art and illness with Rehding and Harvard Medical School professor and writer-in-residence at Massachusetts General Hospital Suzanne Koven.

For Crowley, making art of his suffering has helped him come to terms with it. During a break from afternoon rehearsals this week, he called facing and sharing his pain so directly “freeing.”

“I think so many other times in your life you are forced not to deal with pain or not to interrogate it or not show it or not talk about it. Pain is very uncomfortable for other people. It’s very uncomfortable for anyone to see someone else in pain or to hear them talk about it. And so to have this platform or this place in which you can be free with that … there is something very cathartic about it.”

“Song of a Convalescent Ayn Rand Giving Thanks to the Godhead (In the Lydian Mode),” Oct. 22 and 23 at 7:30 p.m. at Oberon.