In an unpretentious medical clinic in downtown Toronto, there’s a man who can literally see inside the human brain. His name is Mark Doidge, and using a clinical electroencephalogram (commonly known as an EEG) he can create what he calls a “Portrait of Your Mind.”

With the help of some sophisticated software, Doidge is able to create dynamic, three-dimensional “movies” of brain activity. The images he generates aren’t just scientifically intriguing; they’re also works of art. And when music is used to stimulate brain activity, Doidge’s portraits become displays of fireworks, bursting with color.

Interest in the brain runs through Doidge’s family. His mother was a psychologist, and his brother, Norman, is both a psychiatrist and the author of two books: The Brain That Changes Itself and The Brain’s Way of Healing. “Even as teenagers, we had a deep interest in psychology and the mind,” he explains. Following undergrad studies in philosophy, Mark Doidge attended the University of Toronto’s medical school.

It was Doidge’s own medical research in the areas of sleep and pain that first kindled his interest in EEG brain scans. The technology dates back to the 1920s: a gadget that looks like a bathing cap dotted with electrodes is placed on the subject’s head to measure electrical impulses on the scalp. By updating the EEG with some on-screen graphics, Doidge can see exactly what the brain is doing, in real time.

“EEG is safe and portable,” explains the sixty-year-old medical practitioner. “It’s not yet universally available at the corner neurologist, but it’s moving that way.” He goes on to explain that while there are other technologies in use for brain research, the EEG has distinct advantages. “MRIs and PET scans are great for examining the brain. But these are incredibly expensive technologies, and they’re not portable. Getting information about how the brain operates cheaply is a big step. That’s the foundation for a revolution.”

Doidge credits his collaborator, biophysicist Joseph Mocanu, with the development of the software used to generate his images: “He’s the co-inventor of our main software platform called DECI, which stands for Dynamic Electrical Cortical Imaging.” The software makes it possible to localize brainwaves, plotting the origins of electrical activity within specific areas of the brain. The software assigns colors to different kinds of waves, and draws in vector lines emanating from their source. (To achieve precision, DECI divides the brain up into about six thousand tiny cubes.)

By 2008, the DECI software was ready, and Doidge was astounded by what he saw. “Joe showed me the color-coding and the lines,” he recalls, “so you could see alpha waves in one color, and theta and delta waves in different colors. We saw this incredible spectacle, with groups of lines wavering in a kind of order. It was phenomenal — we were looking at the rhythms of the brain. At that moment, the idea of Portrait of Your Mind was born.”

With DECI up and running, Doidge used EEG technology to observe the effects of music on the brain. The volunteer for the experiment was Brian Levine, executive director of Canada’s Glenn Gould Foundation. “We asked him to bring in recordings by Glenn Gould,” Doidge explains. “We did two recordings of his brain: one with his eyes closed and without music, and another recorded while he was listening to music.”

When I listened to Dvořák’s Waltz Op. 54, No. 1, the music coaxed rhythmic bursts of alpha waves from my brain.

The results were intriguing. “We were able to see obvious changes in the alpha and the delta waves. And there was a profound change in the frontal areas. That might be surprising, because the primary auditory cortex, which is involved in sound processing, is on the side of the brain. But when you think about music, and its effect on mood and emotions, it affects higher levels of consciousness. So it’s not surprising that other areas of the brain, such as the frontal lobe, are involved.”

It all sounds very technical and theoretical. But strap on one of Doidge’s electrode caps, and an EEG brain scan with DECI software becomes a tangible, even sensual, experience. That’s what I did in July, and a vivid choreography soon appeared on the computer screen, activated by billions of neurons in my brain. Nor could I resist the opportunity to try a whimsical little musical experiment: for my session I brought along some recordings of music I like — and some that I don’t. Would there be any discernible difference between the way my brain processed these musical examples? Would it be possible to “see” how my musical tastes manifest in my brain?

The short answer is “Not exactly.” The dramatic and mercurial opening of Beethoven’s Op. 95 “Serioso” String Quartet (which I like) produced a jangle of responses from my brain that wasn’t very different from my reaction to the helter-skelter opening of Pierre Boulez’s Le marteau sans maître (which I don’t like). However, when I listened to Antonín Dvořák’s Waltz No. 1 from his Op. 54 set, the music coaxed rhythmic bursts of alpha waves from my brain. (Alpha waves signify a relaxed mental state.) The sweet, lilting melody and steady pulse of Dvořák’s waltz seemed to be working a pleasant kind of magic inside my head.

So why does music have such a profound effect on the human brain? Doidge has some ideas on the subject. “Most of the systems in the brain,” he begins, “are considered to be the products of evolutionary neurobiology. In other words, at some point, they had a survival value. The survival value of music for humans isn’t entirely obvious — but one thought is that it offers social cohesion. When you think of African tribes gathering with music, you see people waving and shaking to the music, singing together in unison. It’s a profound cohesive force. Perhaps the tribe that sings together survives together.”

These days, music-and-the-brain research is all the rage. There are plenty of books on the subject, such as Daniel Levitin’s This Is Your Brain on Music, or Aniruddh Patel’s Music, Language and the Brain. Doidge’s brain research is primarily medical, focused on potential treatments for epilepsy and Alzheimer’s disease. But with his Portrait of Your Mind imaging, he has opened a window into the brain that may help to unlock many of its mysteries — including that of human fascination with music.

This article originally appeared in Listen: Life with Music & Culture, Steinway & Sons’ award-winning magazine.