Nasir Bhanpuri is not a record producer. He’s never been high out of his mind with depraved rock stars in a Four Seasons hot tub; he’s never even been inside a studio. He’s a data scientist at a health care systems company, where he develops models to predict patients’ hospital needs. But on a fall night in 2014, in the back room of Schubas — a small, low-ceilinged venue on Chicago’s North Side — he caught a show by his friends in Bombadil, a quirky North Carolina folk-pop band. In the dressing room after the show, he had a conversation with the band that made him think about music the way he usually thinks about health care: What makes one Bombadil song more popular than another, and what if he could predict that?

Bhanpuri knew the band in its earliest incarnations — as experimental, Bolivian-inspired undergraduates at Duke University who wore outlandish costumes and played novelty songs about death and caterpillars. But a decade later, on this particular night in Chicago, they played mostly love songs — and Bhanpuri wondered why.

They seem to be more popular, Daniel Michalak, the lead singer, told Bhanpuri after the show. “They had this hunch from getting feedback when they were performing, but it hadn’t really been quantified,” Bhanpuri said. He was a guy who could quantify things.

After the show in Chicago and several conversations later, the band agreed to let Bhanpuri build a rudimentary model to try to predict the popularity of Bombadil’s songs. “The worst thing that can happen is we make a bad song, and we do that all the time anyway,” Bhanpuri recalls Michalak telling him during their initial conversations.

Data and predictive systems are being used to try to answer complex questions about policing, basic income, who’s going to win elections — but this is nothing like that. This is data analysis on the smallest scale, a model built for one peculiar little band that wanted to make better music for its fans. Bombadil wasn’t trying to change its whole sound or to manufacture a perfect song. It just wanted a more systematic approach to making music, with the goal of creating slightly better versions of the songs it was already making.

To figure out what about a Bombadil song made it popular, Bhanpuri first had to know what the components of the band’s songs were. So, for every song on Bombadil’s first four albums, Bhanpuri asked the band members to provide information like the amount of drums, the number of song sections and how much each person was singing. He narrowed that list to 20 categories and asked the band to rate the amount of each in every song, on a scale of 0 to 5. (To take the drum example — 0: no drumsticks were needed, 5: broke another drumstick.)

While the band broke down the songs into their piecemeal data parts, Bhanpuri worked on creating a metric for popularity that reflected the nuances of various music platforms. Together, everyone settled on a combination of ratings from Last.fm, Spotify and the Echo Nest (a music data and analysis company that is now part of Spotify). Using four albums’ worth of popularity scores and song characteristics, Bhanpuri developed a model to determine which combination of Bombadil song parts were the most popular — “‘it’s the drums on this song’ or ‘it’s Daniel singing on that song,’” as Bhanpuri put it.

The first test of the model was on their fifth album, “Hold On.” Bhanpuri used his model to try to predict which of the songs would turn out to be the most popular, and it did well, producing ratings that weren’t too far off from the popularity ratings on music services. “It gave us some confidence that the modeling approach might catch some things that their intuition was overlooking,” Bhanpuri said. A few months later, the band decided to use the model to actually change their music. The band had just finished a demo on a little lullaby called “I Could Make You So Happy” and sent it to Bhanpuri to run through the model. The feedback was a little awkward for the band: Michalak should be singing less and James Phillips, the drummer, more. “I didn’t hold anything against Nasir, but to be an artistic creative person, you have to have a strong ego, so it was a little hard for me to step back,” Michalak said.

Bombadil agreed to make another version of the song. The “data version” — as Bhanpuri called it — included some new elements and a little more drums. Now there were two versions of the same song, and Bhanpuri was confident that the data-driven song would “win” this time.

Listen to the two versions of “I Could Make You So Happy,” and let us know which you prefer.

Version A:

https://fivethirtyeight.com/wp-content/uploads/2016/05/i-could-make-you-so-happy-1-0.mp3

Version B:

https://fivethirtyeight.com/wp-content/uploads/2016/05/i-could-make-you-so-happy-2-0.mp3

They sent both versions of the song to about 50 friends and relatives and asked them to rate each on a scale of 1 to 5 (Michalak’s mom participated and gave both songs a 5). This wasn’t a perfect A/B test by any means, but these were the kinds of people Bombadil had wanted to make better music for: their fans and friends. More than 70 percent of the people who were surveyed preferred the data version — and in the end Bombadil did too.

It’s easy to imagine a horrified indie-rock lifer who thinks A/B testing signals the end times of creativity in the music industry. But Phillips disagrees. “It’s easy to write a similar song to one that you’ve already written,” he said. “Ironically, using data challenged us to break patterns and to create something new, and to take songs two or three steps further than we normally would have.” For a song they’re currently working on, feedback from the model led them to include more upbeat parts, different rhythms and vocal sections they’d originally written off because it “didn’t feel like it was in paradigm with the record,” Michalak said.

A/B testing songs based on feedback from a model is still pretty uncommon, said Liv Buli, who is a journalist at the music analytics company Next Big Sound and has worked on similar projects analyzing the audio properties of songs that lead to sales. “I haven’t heard of a lot of bands doing this,” she said. “I think it’s fairly unique simply because it’s still pretty controversial. The mindset is still that music is an aesthetic and creative process and you can’t do it by the numbers.”

This doesn’t mean what Bombadil and Bhanpuri have done is going to shake the music industry to its core. It’s possible there are other artists out there using data to create new songs or change existing ones, but I couldn’t find any. “I’ve definitely never heard of anyone doing this, and I talk to songwriters and musicians all day long,” said John Vanderslice, the founder of the recording studio Tiny Telephone and the producer that Bombadil will be working with on its next album.

Bombadil always knew that a totally data-driven approach to making a song wouldn’t necessarily make for a great album. The type of model that Bhanpuri used looks for an optimal set of parameters — a little more drums, a little more rap, a little less singing — meaning that every song would likely end up sounding the same. When they head to San Francisco to work with Vanderslice this fall, Michalak wants everyone, Bhanpuri included, to get in the studio together for the first time. He isn’t worried about potential tensions between an actual producer and a data-scientist-as-quasi-producer — in fact, he thinks their opposing ideas will lead to better results. And if it comes to it, the band can always A/B test the feedback.