Image caption Pete Shelley on Top of the Pops in 1978

Everybody has fallen in love with someone they shouldn't have fallen in love with, so everybody can relate to the famous Buzzcocks song.

But not everybody knows their late frontman Pete Shelley, inspired by a line from a musical, wrote it about a man.

Manchester punk band Buzzcocks made a big impact on music in a number of ways.

They essentially invented indie by releasing the first DIY single, the Spiral Scratch EP, in 1977.

They booked the Sex Pistols to perform in Manchester in 1976 for two gigs that inspired a generation of great Mancunian bands.

And then there were their actual songs. They were regulars on Top of the Pops with a run of brilliant singles in 1978 and '79.

One of those would become the tune that came to define the band above all others.

Media playback is unsupported on your device Media caption Shelley co-founded Buzzcocks, one of the UK's best-known punk bands

Ever Fallen in Love (With Someone You Shouldn't've) only reached number 12 when it was released in September 1978, but it's now seen as a bona fide classic.

It captured the universal feeling of unrequited longing in the form of a spiky, infectiously melodic pop song.

"He wrote these fantastically beautiful melodies and he dealt with the quixotic and complicated subject of love, and he made it so simple," punk singer and journalist John Robb told Radio 5 Live.

"This was someone who was very confused - confused by his sexuality, confused by love and lust and things, and he wrote songs that told the truth about love."

As with all the best songs, it has been covered and reinvented many times. Fine Young Cannibals took it to number nine in the UK in 1987, while Pete Yorn introduced it to a new generation on the Shrek 2 soundtrack.

"Ever Fallen in Love is absolutely the essence of Shelley's ability to deal with something that you would have thought by now that no one could deal with in a fresh way - which is the love song - and give it an incredible new kick," said music journalist Paul Morley in a Radio 2 documentary about the band.

Image copyright Getty Images Image caption Buzzcocks, with Shelley centre, in 1977

Most people assume a punk band's tour is an endless, debauched crawl around bars and clubs.

But Ever Fallen in Love wouldn't have been written if Shelley had not been in the band's hotel room watching a 1950s Hollywood musical on BBC Two while on tour in Scotland in November 1977.

"I wrote that while we were doing the Orgasm Addict tour," he told the documentary. "We were up in Edinburgh, stopping at the guest house, watching TV there, and it was the movie musical Guys and Dolls.

"One of the characters, Adelaide, is saying to Marlon Brando's character, 'Wait till you fall in love with someone you shouldn't have.' I thought, fallen in love with someone you shouldn't have? Hmm, that's good."

He started writing the song the following day while parked outside the city's post office.

Image copyright Getty Images Image caption L to R: Pete Shelley, Steve Diggle and Garth Smith of Buzzcocks in 1977

Part of the track's genius is that he never specified whether it was about a man or a woman - everyone could apply it to their own lives. Shelley himself was bisexual.

"I tried to be as gender neutral as possible in writing songs, because for me I could use the same song for either sex," he told Manchester DJ Dave Haslam.

Ever Fallen in Love is such a universal song that Shelley shied away from talking about whom he had in mind when he wrote it. But he did reveal to the Outpunk fanzine that it was about a friend called Francis.

In Buzzcocks - The Complete History, author Tony McGartland said the object of Shelley's affections was Francis Cookson, who was in The Tiller Boys with Shelley and launched a label called Groovy Records with the singer.

"I lived with Francis for about seven years, and then he went off and got married in Switzerland," Shelley said.

The singer said he fell in love when the pair started living together. "He was the first - well, the second - person that I actually lived with, so it was difficult at times."

Image copyright Getty Images Image caption Buzzcocks outside the Manchester Free Trade Hall in 1978

Punk may be thought of as a macho scene, but Shelley never saw a reason to hide his sexuality.

He told Outpunk that everyone was "stretching the boundaries" of what was permissible.

"It didn't really matter what you were, what sexual persuasion you were from or what gender you were," he said.

"It didn't really matter, it didn't raise eyebrows if someone was gay."

Though most of Shelley's songs were gender neutral, that wasn't always the case. His 1981 solo single Homosapien, with its opening line "I'm the shy boy, you're the coy boy", was an out-and-out electro LGBT anthem.

"It's hard to overestimate the importance of Pete Shelley," said Abigail Ward, co-founder of Manchester Digital Music Archive, in 6 Music documentary Queer As Punk.

"He was openly bisexual and spoke about his sexuality in the mainstream music press. And to me, he had a real humour and lightness of touch about that."

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.