Grammy-winning rapper Residente has some new collaborators on his upcoming album: scientists.

The Puerto Rican performer said he studied intensely with professors at Yale University and New York University to read brain patterns in worms, mice, monkeys, fruit flies and even hitmaker Bad Bunny to create his second solo project.

"(The album is) going to be about everything that I have inside of my head ... because of that I kept brainstorming and I said, 'Oh I have to study my brain, and then I have to study other people's brains, and then I have to study animals' brains,'" he said.

Daniel Alfonso Colón-Ramos, an associate professor of neuroscience at Yale, said Residente spent days at the school doing research.

"We were joking that we should give him a diploma," said Colón-Ramos.

On campus, they used electroencephalogram (EEG) tests on worms to track and record brain wave patterns.

"Without harming the animals we can actually see as the animal is thinking, as it's moving, as it's exploring its environment, we can see individual cells talking into each other. It turns out when these cells, when these neurons talk to each other they're using rhythms to communicate — we call it rhythms of activity. But, at the end of the day, those rhythms can be turned into music," Colón-Ramos said.

The untitled album will be released in November. Residente, born René Juan Pérez Joglar, worked with Suzanne Dikker, a senior research scientist in NYU's Department of Psychology, to use EEG tests on himself and Bad Bunny to produce the album's first single, "Bellacoso."

The song is a return to Residente's reggaeton roots and the collaboration with Bad Bunny, born Benito Antonio Martínez Ocasio, came as a surprise since the 41-year-old Residente is known to rap about politics, social justice and related topics, and he has been critical of the younger generation of Latin trap stars as well as the popularity of the reggaeton sound.

"I wanted to prove to the people that even though we are different in certain ways, we can connect with each other with our brain frequencies," Residente said. "For my fan base, they are very hardcore fans and I know they don't understand why I'm collaborating with Benito even though he's huge. Because of the things that I stand for, and other stuff, the way I write lyrics, I wanted to show them that even though we're different, we can connect."

"As a human being, I like him," Residente said of 25-year-old Bad Bunny, who has become a breakout star around the world, launching multiple hit songs, topping the charts and even selling out New York's Madison Square Garden. "It was like working with a little brother."

Residente said during the EEG test he and Bad Bunny "were watching a woman dance, we were drinking (and) they were capturing those frequencies."

"The song is "Bellacoso" — it is like a fun song. It's like being better than horny. It's kind of like you're horny, but two steps up: super-horny," he said.

Residente is a member the alternative hip-hop band Calle 13 and is the most decorated act in the history of the Latin Grammys with 24 wins. He also has four Grammy Awards.

His new song's release comes after he was part of last month's massive protests against Puerto Rican Gov. Ricardo Rossello, who announced his resignation following controversies surrounding his time in office.

The colorful music video for "Bellacoso" — which starts with a group of men and women twerking in thongs — includes models of various sizes and skin tones.

Residente said diversity in music and film "is always important."

"You have to keep going with that," he said.

"Also it's cool, you see the butts and ladies, you're liking it, and it's a guy," he continued. "There's a transgender (model in the video). A nice (butt). Everyone has a nice (butt). I was like ashamed of my (butt)."

Follow NBC Latino on Facebook, Twitter and Instagram.