One Saturday in 1964, neurologist Oliver Sacks took a bit of amphetamines, LSD, a “touch” of cannabis, faced a white wall in his home, and said “I want to see indigo now—now!”

“And then,” he wrote in the New Yorker in 2012, “as if thrown by a giant paintbrush, there appeared a huge, trembling, pear-shaped blob of the purest indigo. Luminous, numinous, it filled me with rapture: it was the color of heaven, the color, I thought…I leaned toward it in a sort of ecstasy. And then it suddenly disappeared, leaving me with an overwhelming sense of loss and sadness that it had been snatched away. But I consoled myself: yes, indigo exists, and it can be conjured up in the brain.”

Sacks did not experiment with mind-altering drugs until he was 30 years old, but did so regularly afterwards, experiencing a wide variety of hallucinations that he said gave him more empathy for his patients with disordered brains.

There’s a long history of academics and scientists experimenting with hallucinogens, not to “tune in and drop out,” but to push the brain to its limits and, like Sacks, see what it was capable of. Sacks wrote that when he first began taking drugs, our understanding of how neurotransmitters and chemicals run the show (and therefore experience and behavior) was just emerging. It was leading to questions like: “Why was LSD so enormously potent? Were all its effects explicable in terms of altering the serotonin in the brain?”

We’ve come a long way in understanding the effects of LSD, especially as it becomes used more frequently in mainstream research. A study from 2016 used three types of imaging to show that LSD causes changes in brain blood flow, electrical activity, and creates a brain that is much more connected—meaning various brain regions have more communication among them—than brains in the placebo group. The paper included striking images that showed brains on LSD ablaze with activity and connection compared to brains without it.

But there’s still much to be uncovered about the exact neurobiology of when a brain is on LSD, and what we can infer about the normal brain from it. A recent study published in Scientific Reports sought to do just that. An international team used a new kind of imaging that uses the literal shape of the brain itself to interpret the brain’s activity during LSD. What they found is that on LSD, the brain expands its behavior and connections in ways we didn’t know of before; it brings our brains right to the edge of chaotic behavior, without allowing us to topple over it.

The findings also point to potential explanations as to why hallucinogens are helpful in treating conditions like depression, and offer proof of a basic principle of chaos and order that exists in all of our brains, whether on LSD or not.

When I spoke to the first author of the paper, Selen Atasoy, a postdoctoral researcher at Oxford University, she said that before she explained any of that, we would need to take a step backwards. I discovered that the new method she’s using to read the brain is a head trip all on its own, and to explain it, we have to go back in time more than 200 years.

In the late 18th century a German acoustic scientist named Ernst Chladni put sand on metal plates, ran the bow of a violin or cello against them, and watched as beautiful and complex patterns appeared.

The sound, at its particular frequency, was creating what's called a standing wave on the metal plate, by causing certain parts of the plate to move up and others to move down, synchronously. The sand jumped away from the areas that were being moved up and down, and fell and collected at the boundaries of the regions which didn't move.

Atasoy says that any system capable of vibrating will create these standing waves, and if you increase the frequency, a standing wave becomes increasing complex. All musical instruments, she tells me, when they play a pitch, have an accompanying standing wave pattern reflected on the instrument.

Standing waves can look different by a change in frequency, but they can also change by adjusting the size or shape of the object being vibrated. Back to the metal plates: if you ran a violin bow on a circular plate or a triangular one, instead of square, the standing wave patterns would look different. There’s an equation that scientists (usually physicists) can use to predict standing waves, and it calculates what their particular shape will be, together with their associated frequencies, given the shape of the surface they're on.

The standing wave equation also works on other synchronous occurrences in nature. The equation can predict electron orbits in quantum mechanics or electromagnetic patterns on a grid of ions. Remarkably, the standing wave equation can be used to understand why animals–like leopards, zebras and giraffes–have the markings that they do. If you do Chladni’s metal plate experiment with the shape of the plate cut to match an animal’s body, you end up seeing animal like patterns at different frequencies.

Recognizing that standing waves, or harmonics, as they’re also called, were universal in nature, Atasoy decided to apply this same equation to the shape of the human brain.

The Human Connectome Project used a technique called diffusion tensor imaging to create a structural map of the human brain. It shows which regions are connected to one another, by the brain’s white matter fibers that stretch across different parts of the brain. The result, called the human connectome, is like a physical road map of all the brain’s connections.

There is a relationship between that map and the patterns scientists see on fMRI, which represents neuronal activity (if the connectome is like the highways connecting different parts of the cortex, fMRI shows the cars on the highways). But this relationship between the two was mostly unknown, Atasoy says. People were trying to understand how the physical structure of the brain influenced what activity it could have, not just when the mind was active, but also when it was resting. fMRI data shows that even when people aren’t actively doing anything, their brain show synchronous activity, meaning there are up and down oscillations that correspond with each other throughout different brain regions.

These synchronous resting states are what led Atasoy to think she could apply the harmonics equation to the brain. Essentially, in place of a metal plate, Atasoy and her collaborators used the literal physical structure of the inner workings of the human brain (the connectome) plus MRI data of the outer folds of the cortex to predict the standing waves of the brain.

“We just solved the same equation, for the harmonic patterns, on the human connectome instead of other geometrical shapes, like metal plates or spheres where it has been applied before,” Atasoy explains. “Then, when we take the fMRI data, instead of looking at where we see higher activity versus lower activity, we can ask the question: How do these harmonic patterns, or connectome harmonics, actually make up the fMRI data.”

By looking at the shape of the brain, Atasoy predicts what wave patterns will emerge on the cortex at many different frequencies. When all the patterns are looked at together, they compose a new language to describe the brain, she says, one that includes both the spatial and temporal elements of neural activity. The patterns tell us which regions should be synchronized with each other at a particular frequency, and then we can describe fMRI data as a combination of these patterns. To wrap my mind around what this means, Atasoy suggests a musical analogy.

“It’s as if the brain is playing a musical piece, or it’s like an orchestra,” she says. “The fMRI data gives us the sounds, then what we’re doing is decomposing it into the musical notes; trying to find out which notes are combined in that particular time to create the fMRI sounds that we are ‘hearing.’” This is how they examined the minds of 12 people on LSD, on placebo, and on LSD listening to music, in their new research; not just by seeing how their brain activity changed, but by reading their brain activity through the lens of the brain’s underlying connectome-harmonics. Is your mind blown yet?

What they found was that under the influence of LSD, more of these harmonics were contributing to brain activity and their strength of activation was also increased. The brain was essentially activating more of its harmonics simultaneously, and in new combinations.

Going back to the music analogy, Atasoy says it’s like the difference between someone playing a piece of sheet music and someone improvising. Studies have found that musicians use more notes during improvisation compared to memorized play. The brain, similarly, is expanding its repertoire in a way that wasn’t random; the result is still a coherent piece of “music,” just accessing new notes and scales in combinations that haven’t been heard or played before.

“This type of repertoire expansion, which is not random, made us think that there must be kind of a reorganization in brain dynamics,” Atasoy says.

When they looked closer at that specific reorganization, they found a potential explanation: statistical evidence of a neuroscientific principle that was once mired in controversy, but has gained support in the last decades. The brain’s reorganization was showing signatures of something called criticality, or a concept of brain activity that says that our brains dance on the fine line between order and total chaos, and that LSD was pushing us closer to the edge.

Criticality is a theory first proposed by a Danish physicist Per Bak in 1999. Neurophysiologist Dante Chialvo, one of the other early pioneers of criticality, says that their theories were initially mocked openly. “The dominant idea was that the brain is like a circuit,” he says. “And as a circuit, it always repeats the same thing.”

The basic premise is that criticality is a tipping point between order and chaos, when these two extremes are tenuously in balance. Think of the transition from ice to water. When the temperature starts changing, nothing happens until you reach a critical temperature, and then the ice starts to melt. Ice is a more organized molecular structure, compared to water; criticality is the in-between of ice and water, when both exist together. Nature shows us that all three phases of water can be present at once, Chialvo says: rain in clouds, frozen lakes, the vapor of a hot humid summer day, all inter-depending in the same system containing structure and flexibility, order and disorder.

This is the state that Chialvo and his fellow criticality-believers thought the brain was in: always on the verge of chaotic behavior, but never fully crossing over. They thought this made sense. The brain needs to be flexible enough to adapt, but structured enough to function. “If you’re in a rigid, very organized system, it’s very difficult to move it from there,” he says. “If you’re completely disorganized, it’s very difficult to do something simple, because the disorder is too much.”

It’s taken 25 years, but a growing number of studies have emerged to support criticality, starting with findings that show evidence of it in neuronal activity. Our neurons don’t only fire together– this would be like the ice. They also aren’t completely disorganized either, like water. By existing on the very edge of chaos, we can have the combination of both. There is some synchrony– neurons that fire together– but there is also flexibility for chaotic, individual behavior, if needed.

“When I present this idea I use the example of a group of soldiers marching together, that would be high synchrony,” Atasoy says. “And a group of kids who play all individually, nothing to do with each other– that would be the chaos. No interaction among the members. Then, imagine a group of teenagers dancing, synchronously, yet they are allowed to have their own unique postures every now and then as well. That would be the criticality.”

Using a statistical indicator of criticality, Atasoy and her team noticed in their data that under LSD, the brain was being pushed even closer to criticality than in the placebo states. They think that the reorganization of brain dynamics they saw was the brain being pushed right to edge of chaos, making it closer to the transition between ice and water, more flexible, able to create new states, use more harmonics, and create all the sensory and emotional experiences people relate to tripping on LSD.

“Using LSD you can be in states that you have not seen before,” Chialvo says. “To talk, to think, to see, to create, you have to group different neuronal groups in all the possible combinations. We say that the largest number of configurations is achievable with criticality, and in this case it’s achievable even more so during the LSD state. I’m very glad to see these new results, even if I am not necessarily surprised. It’s necessary and very important to demonstrate empirically.”

To return to the musical improvisation metaphor: It’s like hearing those experimental jazz songs that use such a wild variety and combination of notes that it almost doesn’t sound like music anymore. That’s your brain on LSD.

Atasoy says that beyond increasing our understanding of fundamentals of the brain–its harmonic patterns, its tendency to live on the edge–we can also begin to understand why LSD and other hallucinogenics are being shown to be useful therapeutics for mental illnesses like depression.

She says more evidence is needed, but there’s some preliminary data showing that someone who is depressed might have brain dynamics that are stuck in a pattern that they can’t get out of. When they take psychedelics, it may allow for more flexibility and an exploration of new pathways and access to new wave patterns.

“We’ve seen that there’s a difference between the psychedelic brain and the normal brain: The psychedelic brain seems to be tuned closer to criticality,” she says. “Now, if a disorder, like depression, takes the brain further away from criticality by making it stuck in a certain harmonic, or a combination of harmonics, that would be similar to a musician playing the same music all the time. The musician can never improvise properly because she or he is stuck in that pattern of notes. If we were able to take the brain closer to criticality, where we allow the musician to use the whole spectrum of musical notes, the whole repertoire, then it may really help with the brain dynamics not getting stuck, or getting freer out of this stuck pattern. That is theoretically also what we would like to explore in the future.”

Oliver Sacks wrote that by the time he qualified to be a doctor, “I knew I wanted to be a neurologist, to know how the brain embodied consciousness and self and to understand its amazing powers of perception, imagery, memory, and hallucination.”

Exploring the brain with hallucinogenics is important not necessarily because of what we learn about the brain on hallucinogenics—it’s what we can uncover about the function and potential of the brain all on its own. Physicist M. Mitchell Waldrop wrote in his book Complexity: The Emerging Science at the Edge of Order and Chaos that “The edge of chaos is where life has enough stability to sustain itself and enough creativity to deserve the name of life.”

It’s humbling and amazing that the same equation that can explain why the shape of a Stradivarius violin produces beautiful sounds, or explain the shape of a leopard’s spots, can tell you the wave patterns that will emerge on the surface of your brain. Or further, that even without LSD, we regularly live on the edge of chaos—but through a remarkable balance, skirt the edge to produce complex cognitive tasks everyday. That’s a kind of trip all on its own.