The jazz musician Marcus Roberts’s new EP, “Race for the White House,” features songs meant to capture the candidacies of Bernie Sanders, Hillary Clinton, Donald Trump, and Ben Carson. Photograph by Desiree Navarro / WireImage / Getty

On Sunday, Marcus Roberts, the jazz pianist and composer whom Wynton Marsalis has called “the greatest American musician most people have never heard of,” was sitting at his piano playing a new song he’d written, about Bernie Sanders. Naturally, it was called “Feel the Bern.”

The song starts with a crash of drums (played by Marsalis’s younger brother Jason), then settles into a high-tempo bass-and-drum groove, before Roberts chimes in on piano with a three-note cue—Feel-the-Bern. A clarinet then hits the same three notes, followed by a tenor sax that picks them up as well.

“It’s to show the different components of Bernie Sanders’s personality,” Roberts said. “When the piano does it, it’s laid-back and it’s kind of cool and dignified. When the tenor plays it, it starts to get a little more rambunctious. You know, maybe that’s when he tells Hillary, ‘I don’t really give a damn about hearing about your e-mails anymore.’ It becomes kind of aggressive, and there’s a lot of fire, like, we’re going to get to this. I think that’s why Sanders appeals to young people.” In the middle of the song, there’s a drum solo. “Jason just kind of goes nuts for a little bit and expresses whatever emotion that is,” Roberts said.

“Feel the Bern” is one of four songs about Presidential candidates that Roberts recently recorded, for an EP called “Race for the White House.” Roberts, who has been visually impaired since he was a child, was in Tallahassee recording new music last November when the idea for the project struck him. “You can’t turn on the television without some daily update on these various candidates, and there just seems to be such a difference in every character,” he said. “And, of course, I’m not really looking at these people. I’m just listening to them, and they all have different personalities, temperaments, voice, rate of speed. It dawned on me that it would be interesting to try to capture a little bit of that in music. Jazz musicians, you know, we improvise, we make stuff up. We’re kind of a lot like these candidates when they’re at these town halls. When they’re being interviewed, people ask you all kinds of crazy stuff and you’ve got to think quick on your feet. So I thought it would be kind of cool to try to write some music that would in some way describe these personalities.”

The other songs on the album capture the candidacies of Hillary Clinton (“It’s My Turn”), Ben Carson (“I Did Chop Down That Cherry Tree”), and Donald Trump (“Making America Great Again [All by Myself]”).

“It’s My Turn” is slower and mellower than “Feel the Bern,” and it attempts to describe the many phases of Clinton’s long career in politics. “We know that she’s undergone a whole lot of changes,” Roberts said. A Clinton supporter, he was originally going to call the song “I Guess I’m Just Overqualified,” but he decided to keep the music as nonpartisan as possible. “People have been messing with the lady for twenty-five years about this and that, so I decided we’ve definitely got to have some changes,” he said, noting that, of the four songs, it is the most complicated and nuanced, just like her campaign. “We start in D-flat minor, but we change to G-flat and then to B-flat, and we change the meter and the tempo.”

Roberts said that he wrote the songs fast, attempting to capture the candidates based on what was happening in debates and on the campaign trail at the time. “I was focussed on something that was literally occurring even as I was writing it,” he said. “I’m listening to Ben Carson on TV, and he’s talking slow. I’m thinking, well, the piece for him can’t be up-tempo.” The Carson song was written at the stage in the campaign when Trump, feeling threatened by Carson’s candidacy, had attacked Carson for some bizarre anecdotes from his opponent’s memoir.

“Carson’s telling people he did all this lawless stuff as a kid,” Roberts said. “I’m like, how can I capture that?” Jason Marsalis’s initial drumming on the song didn’t sound quite right to Roberts. “I said, ‘No, man, I need it to sound like it’s a hammer hitting something, O.K.? I need it to sound like he might be beating up one of his friends at school. It needs to sound that way.’ ” They accomplished the musical equivalent of Carson’s hammer attack with a three-beat rim shot.

Trump’s was the easiest personality to capture. “It was clear that it needed to be bold and up-front and egotistical,” Roberts said. He told Marsalis to whistle as if he were Trump surveying his vast real-estate empire from up high. “You’re rich, you’ve got pretty much everything anybody could want, and you’re just chilling,” Roberts said. A trumpet cuts in on the whistling, to show Trump’s more aggressive and cocksure side. “He interrupts himself,” Roberts explained, “almost to say, ‘I’m going to get all this great stuff done, I don’t need any help, I know what I need to do, just get out of my way and let me do it.’ It almost has a Batman-superhero vibe to it.”

Roberts, who teaches music at Florida State, said that he hoped people, especially the young people attracted to the various candidates, would listen carefully to the songs as a reminder that art still has a place in politics. “We can describe a whole lot about our society and our culture through art,” he said. “Music is a way of describing life that can go beyond words, because there is a little mystery to it. There is a little imagination trying to figure out what the music is telling me.”