NEW YORK -- Justin Timberlake, so often shuttling between movies and music, for once didn't have to choose.
In the Coen brothers' "Inside Llewyn Davis" he plays a supporting role as a cheery sweater-wearing 1960s folk musician. But he also collaborated with producer T Bone Burnett on the movie's memorable period songs and helped shape the film's most unforgettable and comic tune, "Please Mr. Kennedy."
"It's the first time that I've gotten to kind of do a lot of things that I love to do at the same time," Mr. Timberlake said in a recent interview by phone from the road, where he's on tour. "It will always be a milestone for me to get to write, sing, act and bring it all together."
For the multitasking Mr. Timberlake (Mr. Burnett calls him "a quadruple threat"), the film was a rare chance to combine his talents: a Coen playground staked out between worlds Mr. Timberlake usually navigates separately. Some fans and media seem to want him to pick a side: musician or actor.
"I don't even know what I am, man," he chuckles.
The various Timberlakes are uniquely on display at the moment. "Inside Llewyn Davis" opened last week. He's in the midst of touring "The 20/20 Experience," his Grammy-nominated return to music after a spell in movies such as "The Social Network." And he was the musical guest on "Saturday Night Live," where the former Mouseketeer first revealed his comedy chops.
The folk revival music of "Inside Llewyn Davis" is quite a distance from Mr. Timberlake's "Suit and Tie" or "My Love," but Mr. Burnett doesn't think much of genre divisions.
"He's from Memphis," says Mr. Burnett. "He's an R&B singer, basically. But he's got a beautiful voice and he's got incredible tone and he can sing anything he wants to. A song is a song."
"Inside Llewyn Davis" is about a struggling and bitter folk musician (the title character, played by Oscar Isaac) in 1961 Greenwich Village, the cusp of Bob Dylan's arrival. Mr. Timberlake plays a friend of his with a rosier outlook and less concerns with selling-out. The movie is filled with full performances of songs, all but one of which were recorded live.
Work on the film began with the music: "We found the characters through the type of music they did," says Mr. Timberlake.
He went to Mr. Burnett's Los Angeles home to work on "Please Mr. Kennedy." The song, whose chorus goes "Please Mr. Kennedy, don't shoot me into outer-space," is the comedic high point of the film, and one of the strangest songs that will ever be credited to Mr. Timberlake (along with Mr. Burnett and the Coens). The premise, Mr. Burnett says, was astronaut John Glenn having second thoughts.
The song is roughly based on "Please Mr. Kennedy," a 1962 novelty song by the Goldcoast Singers that pleads to the president not to be shipped off to Vietnam. It went through several other different iterations through the '60s. (Because the song is based on previously recorded material, it's ineligible for an Academy Award.)
While working on the song, Mr. Timberlake wanted to get his own guitar, so the two stopped into a music shop in San Fernando Valley. Mr. Burnett says Mr. Timberlake "put some sex into it, put some swing into it."
"I just started strumming these chords and strumming in a way that we felt was almost like [the Beach Boys'] 'Surfin' Safari' or a Coasters tune," says Mr. Timberlake. "It was just one of those things where when the punch lines fit in with the melody so good. We kind of just wrote the song in the back of this guitar shop."
When the song was later recorded in the studio and on film, the silliness grew. Although "Please Mr. Kennedy" becomes a hit in the film, it's everything Llewyn detests about music. It's a pop music hell for him; he's just there for some quick cash.
With Mr. Timberlake and Mr. Isaac (a proficient musician himself) on guitar, they're joined by Adam Driver ("Girls") who, in a cowboy hat, adds some of the more ridiculous harmonies. ("Adam Driver is a deeply courageous actor," says Mr. Burnett.) Ethan Coen, in particular, pushed them to add quirks like a repeated "pah- pah- pah-" before the "please."
Molded by Mr. Burnett, Mr. Timberlake, the Coen brothers, Mr. Isaac and Mr. Driver, the song may very well be one of the most absurd collections of talent for a recording. It's also a hit.
But the unusual group of musicians, actors and filmmakers was perfectly suited to Mr. Timberlake. He also jumped in to sing bass on the a cappella "Auld Triangle" with the Punch Brothers and Marcus Mumford. It was a surreal swirl of music and moviemaking. The Coens, says Mr. Timberlake, are "the equivalent of Dylan in the film industry."
"We just all jammed together for a couple weeks," says Mr. Timberlake. "So you felt like this counter-culture collective."
"I don't like rules of 'well, this is what you do, or this is the picture frame you're supposed to live in,' " he says. "You just never know what might come out of trying everything."