HOW’S this for a setup to recording your debut album: You form an indie band in college and – less than a year later – your pop sextet becomes the talk of New York’s CMJ music fest in 2006. You release an EP soon after and, in 2007, become the latest “it” band and prepare to record an album.

Then the unfathomable happens in June of the same year: The drummer, a gifted songwriter and guitarist who co-writes the band’s lyrics and melodies, drowns.

The band, which decides not to break up, now has a daunting task: to record under this shadow and make it worthy of the drummer’s artistic vision – particularly because he wrote half the songs.

A difficult scenario indeed, but that’s just what Ra Ra Riot went through before recording its debut disc, “The Rhumb Line.” The band performs songs from the new album on Thursday at the Bowery Ballroom and at the Music Hall of Williamsburg, Brooklyn on Friday (both shows are sold out).

The late drummer was John Pike, 23.

“We all thought separately about how difficult it would be to play without John on an emotional as well as a practical level,” says lead singer Wesley Miles, 24. “But we wanted to continue and play the music we wrote with him.”

“Dying Is Fine,” with lyrics written by Miles and Pike (with a truly catchy chorus of “I wouldn’t like death if death were good”), took on unexpected meaning.

“If we were writing that song today it would be different,” says Miles. “The concept of mortality is personal now.”

The bandmates – lead singer Miles (also on keyboards), the late drummer Pike, guitarist Milo Bonacci, bassist Mathieu Santos, cellist Alexandra Lawn and violinist Rebecca Zeller – met at Syracuse University and formed Ra Ra Riot in 2006. (Cameron Wisch is the new drummer.)

“The boys weren’t music majors, but the girls were,” says Miles, speaking to The Post on the phone while his tour van is stopped at a Chick-fil-A restaurant in Pensacola, Fla.

“They write all the string arrangements and add a certain classical perspective.”

The band once drew comparisons to Arcade Fire, but now those have shifted to Vampire Weekend. That’s amusing to Miles, as he’s been pals with Vampire Weekend’s frontman, Ezra Koenig, since elementary school. In middle school, they were in the same band – the Aquatones.

Although Pike’s gone, Miles, who now writes most of the lyrics, learned enough about melodic and lyrical structure from his friend to stay inspired for a lifetime. “I’m not much of a guitar player, but John could play anything,” he says.

The band may try to complete and include some of Pike’s songs, recorded as demos, on the next record. For now, you can hear his guitar playing at the end of “St. Peter’s Day Festival,” and his spirit lives in songs playing in earbuds of indie music fans everywhere.