“I always play music on set when I make a film,” says Joe Wright, the British director behind such pristine literary adaptations like Pride and Prejudice and Anna Karenina. For the library-set love scene in Atonement, Wright’s 2007 take on Ian McEwan’s novel, he played music from Mark Lanegan’s 2004 album Bubblegum. When it came to making Hanna, his 2011 teen assassin movie, he scored it with his old friends, the Chemical Brothers, whom he’d known since going to their first London DJ gig back in 1992, at a nightclub above a shoe shop in Islington.

So it’s no surprise that his latest film, Pan, a re-framing of the J.M. Barrie children’s classic, features the 43 year-old Wright’s “eclectic taste in music”. The film sets out to show how Peter (Levi Miller) became the boy who never grew up after he’s kidnapped during the Blitz and spirited away to Barrie’s magical Neverland. He arrives to find the fearsome pirate Blackbeard (Hugh Jackman) rousing his child labour-force with a chorus of Nirvana’s Smells Like Teen Spirit.

From Neverland to Nevermind, it’s one of the more surreal movie musical cues this year. Wright says it came out of rehearsals – a pirate boot camp. “I put on that track, which is something I’ve loved for a while, and suddenly everyone came alive and started pogo-ing along.” It sums up the anarchic spirit of Wright’s vision – a sort of grunge Peter Pan that has an almost Dickensian quality to it.

“One of the lovely things about doing a kids’ fantasy movie,” notes Wright, “is that the silliest, craziest ideas you can come up with can be incorporated.”

Wright then put the idea to Hugh Jackman. “I said I’d like to use this song and Hugh was bang up for it. And everyone went for it.” The only difficulty was securing the rights to Nirvana’s anthem from frontman Kurt Cobain’s widow, Courtney Love.

“I believe [that] was quite tricky and not cheap,” says Wright, diplomatically. “But I left that to the producers. They kept on saying, ‘Are you sure there’s not another song?’ But it had to be something people knew. Not as difficult as [getting the rights to] Cole Porter, though. That’s impossible.”

With the film also including the Ramones’ Blitzkreig Bop, Wright – who grew up in Islington, where his parents ran a puppet theatre – Wright wanted to make a film “for the kid in all of us”, particularly himself.

“I set out to make a film for my pre-adolescent self before he got trampled by the horrors of adolescence. And that kid was quite uncool and really open and excited by the world, and didn’t care about what other people thought, especially girls. That was the plan – an anti-cool film!”

While the box-office has been so far sluggish ($40 million to date overseas), it might suggest audiences don’t want anti-cool right now. But Wright’s intentions behind Pan are evidently genuine and personal. He says he made the film for his older son Zubin, 4 (his younger boy, Mohan, was born this February).

“At night, he sometimes gets scared of the shadows, as we all did, and I wanted to make sure he knows it’s OK,” he says. “I wanted to make a film that reflected my son’s night terrors and show him that he could overcome them.”

Perhaps unsurprisingly, Wright’s family has a musical connection; he’s married to sitar player Anoushka Shankar, the daughter of the legendary Ravi Shankar and half-sister to singer Norah Jones. He’s producing her next album, due next April.

“I don’t write music,” he says. “I do things like say, ‘OK, let’s make a track where you have the exodus out of the city, and people are very tired and they’re walking, and suddenly a truck goes past and our hero jumps on the truck…’ So it’s like telling stories really.”

It’s not his only departure from film, with Wright planning a return to the theatre in 2017, with a production of Bertolt Brecht’s Life of Galileo.

“I find not working very difficult. I’ve become quite moody when I’m not working, so I’m finding ways now of keeping working without necessarily making films.”

So is there not another film in the works?

“There’s a few things but your career is what happens whilst your busy developing other screenplays.” Maybe it’s about time he did a musical.

Pan opens today