The writer Edith Wharton, a self-professed “slow worker,” dismissed the idea of easy creative triumph. “Many people assume that the artist receives, at the outset of his career, the mysterious sealed orders known as ‘Inspiration,’ and has only to let that sovereign impulse carry him where it will,” she wrote in her 1925 book The Writing of Fiction. The artistic impulse, she continued,  was instead achieved through “systematic daily effort.”

But while she championed diligence, Wharton was also driven by something she found more difficult to describe. Writing in The Atlantic in 1933, she sought to explain that “central mystery” of spontaneous creative expression—the “teeming visions which, ever since my small childhood, and even at the busiest and most agitated periods of my outward life, have incessantly peopled my inner world.”

“It is as impossible to fix in words,” she wrote, “as that other mystery of what happens in the brain at the precise moment when one falls over the edge of consciousness into sleep.”

There are many types of creativity, but in recent years, researchers have begun to understand more about the kind of creative flow Wharton described—the state that today is colloquially referred to as “being in the zone.”

In a 2008 study published in the journal PLOS, Charles Limb, an otolaryngologist at the University of California, San Francisco and accomplished jazz saxophonist, and Allen Braun, a speech researcher at the National Institutes of Health, designed a clever way to observe creative expression in the brain: an fMRI machine with a specially made musical keyboard. The two men recruited six professional jazz musicians for the study; while in the fMRI, the participants performed musical exercises ranging from a memorized scale to a fully improvised piece of music.

Observing the musicians’ brain activity as they performed each task, Limb and Braun found that when their subjects improvised, a region called the dorsolateral prefrontal cortex (DLPFC) became less active. Like a neural mother hen, the DLPFC is connected to planning, inhibition, and self-censorship; its deactivation has been suggested to play a role in altered states of consciousness such as daydreaming, meditation, and REM sleep. (A separate imaging study published in the journal Nature in 2012 found a similar lulling of the DLPFC during freestyle rap.) This pattern of brain activity, Limb and Braun wrote, may be “intrinsic to the creative process,” which “can apparently occur outside of conscious awareness and beyond volitional control.”

Their findings support a fundamental model of creativity developed by Arne Dietrich, the author of How Creativity Happens in The Brain and a professor of psychology at the American University of Beirut. Dietrich argues that the brain’s prefrontal cortex is central to creativity, and depending on the particular creative activity, the region will either significantly slow—as it did in the jazz study—or ramp up.

In other words, creativity is necessarily a variable phenomenon. At times, it’s the composer’s strict pen: intentional, revisionary, critical. And at times, it’s the spontaneous new melody: unconscious, experiential, flexible. So what determines which creative path a person takes in a given moment?

Earlier this year, Limb co-authored a new study led by Malinda McPherson, a doctoral candidate at the Harvard-MIT Program in Speech and Hearing Bioscience and Technology, to address that missing element. The study also asked jazz pianists to improvise in an fMRI scanner; this time, though, the musicians were instructed to first review photographs of a woman wearing a positive, negative, or neutral expression, and then to try to match the photo’s mood with their improvised melodies.

The results were somewhat surprising. McPherson’s team predicted the creativity-related DLPFC deactivation from the previous study would be found equally in the negative and positive improvisations, but it was much more pronounced during the happy trial. The researchers also found that the negative-photo improvisations showed greater activity in certain brain regions connected to cognitive control and reward; specifically, there was increased connectivity between the insula, an area that controls visceral awareness, and the substantia nigra, an area responsible for reward and pleasure.

Broadly, McPherson’s findings support Dietrich’s argument that creativity doesn’t stem from one easily definable process or brain pattern. The results also indicate that “emotion has a huge effect on the way our brains can be creative,” McPherson says. Positive emotion, for instance, seems to be related to a deeper state of creative flow. Her findings also seem to indicate that unhappy artistic expression requires more conscious restraint than happy music—but may also be, on some level, more rewarding.

“Sadness in art is perplexing,” McPherson says. “People love performing and listening to sad music, but generally try to avoid sadness in other areas of their lives.” It may be that the arts give us the chance to safely practice and experience a range of emotions, she says—or, as Wharton writes, to experience feelings “quite unrelated to the joy or sorrow caused by real happenings, but as intense.” Sad music, then, could be especially pleasurable because the musician “knows that the sadness is coming from the art, and not from any other loss,” McPherson speculates. Happy art, on the other hand, may allow a deeper creative flow because it carries less emotional risk, even if it also means less of a reward or release.

But Dietrich advises caution in extrapolating too much from McPherson's study or any neuroimaging research on creativity. “Even for the wilderness of human thinking, creative ideas seem to be deliberately designed to defy empirical enquiry,” he says, adding that some ideas pitched as neural explanations for creativity have “completely failed” to produce coherent results. Dietrich remains skeptical that fMRI-bound improvisations are an accurate representation of truly freewheeling creative flow. Even so, he says, the McPherson study is a “genuine addition to the literature.”

Of course, the more questions that are answered, the more questions arise: Do the findings about jazz improvisation apply equally to other forms of art and music? If there are distinct paths to creativity, how can we steer our brains to enter a state of creative flow? What happens to the brain during those more deliberate creative efforts, such as revising an artistic work?

As they move forward, Limb and his colleagues are working to both deepen their understanding of musical improvisation and extend the research to other areas of creativity. “There are so many deep and critical questions when it comes to the neuroscience of art,” he says. “It may take a while before we are able to unify the knowledge across disciplines.”