Imagine a world without the music of John Lennon or Paul McCartney. Imagine, in other words, a world without Imagine, not to mention She Loves You and Yesterday. Danny Boyle’s new film has just such a premise – and if the idea sounds familiar, it is not surprising. Back in the 90s the television sitcom Goodnight Sweetheart, starring Nicholas Lyndhurst, used a similar plot device.

“I have noticed the similarity, of course,” said Maurice Gran, who wrote the much-loved show with Laurence Marks. “I am being terribly generous about it of course, but Laurence is already contacting hitmen.”

Boyle’s film, Yesterday, which has its world premiere on 4 May at New York’s Tribeca film festival, tells the story of a struggling singer-songwriter who wakes up to realise he is the only one who can remember the Beatles and their songs. Understandably, the hopeful musician, played by Himesh Patel, decides to capitalise on the situation and claims the songs as his own. It stars Lily James, but has cameo appearances from Ed Sheeran and James Corden and is rumoured to feature the two remaining Beatles.

In the BBC sitcom, which ran for six series and is to become a stage musical early next year, a time travel portal took the hero back to wartime London, before the Beatles existed, leaving him free to play their hits as his own on a pub piano.

Boyle’s film is based on a story by Jack Barth and has a screenplay by Richard Curtis. This weekend Gran, 69, conceded that no one had a monopoly on stories that play with time: “It is a tempting canvas to draw upon. We know Richard Curtis quite well, but we haven’t had him on the phone yet. I suppose we’ll have to be nice, because he is a bit of a saint really, with the Comic Relief work.”

The musical version of Goodnight Sweetheart will include at least one Beatles song. It is hard, admits Gran, to find modern songs that have melodies to match the tunes from the 1940s. “I don’t know exactly how the song rights were handled by the BBC. They had some special arrangement and it was mainly short snatches anyway. I do remember a bomb shelter scene when the cast all sang I Am the Walrus. But then, in terms of royalties, singing songs is different to playing the actual record.

Facebook Twitter Pinterest Nicholas Lyndhurst and Elizabeth Carling in Goodnight Sweetheart. Photograph: Fremantle Media/REX/Shutterstock

“I guess, to flatter ourselves, Laurence and I might say that Goodnight Sweetheart is so much a part of British culture now that it is there to be dipped into to some extent,” said Gran. “But if people are thinking, ‘Great idea. I wonder if Curtis is sending Marks and Gran a crate of champagne?’, then I guess it won’t do us any harm.”

The new musical has been a 12-year project for the Birds of a Feather writers. “Of all the TV shows that have been turned into musicals, this one really deserves it because it was partly about the songs. We asked Nicholas Lyndhurst to be in it. He said, ‘Thanks, but I can’t sing, I can’t play the piano and am too old’.”

A spokesperson for Boyle did not respond to a request for comment.