Image copyright Getty Images Image caption Ryan Tedder reportedly makes $2.5 million writing songs for other artists in a single year

Ryan Tedder has written some of pop's biggest hits, including Beyonce's Halo, Ed Sheeran's Happier and, for his own band OneRepublic, Counting Stars.

But he says pop is in danger of being stifled by the rise in copyright cases.

"It's a conversation in every writing session," he tells the BBC.

"The odds of getting sued in this day and age are so high, we're going to get to a point where nobody can write anything - because everything will be derivative of something else.

"It's just ludicrous."

There's been a surge in copyright claims ever since Marvin Gaye's family sued Robin Thicke over the single Blurred Lines in 2015.

They successfully claimed Thicke and Pharrell Williams copied Gaye's 1977 hit Got to Give It Up - winning $4.98m (£3.9m) in damages and a 50% share of future royalties.

Image copyright Getty Images Image caption Blurred Lines set new precedents on copyright cases, as it was found to copy the "feel", rather than the melody, of Gaye's hit

Since then, artists including Bruno Mars, Mark Ronson, Madonna and Miley Cyrus have all been tied up in costly legal proceedings.

Others have sought to pre-empt potential claims by crediting people whose work influenced their songs.

Ed Sheeran shared the royalties of Shape Of You with the writers behind TLC's No Scrubs, while Taylor Swift gave Right Said Fred a credit on Look What You Made Me Do after noticing a similarity to their 1991 single I'm Too Sexy.

Tedder says the plagiarism is usually not deliberate.

"I just did a record with Sam Smith and I brought up the Stay With Me Thing with Tom Petty," he says [Smith gave the late rock star a co-writing credit on Stay With Me, over its resemblance to Petty's 1989 single I Won't Back Down].

"And he said, 'Ryan, with God as my witness, had I ever heard that song before? Probably. But do you know how young I am? I'm 25. I didn't grow up listening to Tom Petty!'"

'Not pretty'

While Tedder has "never had a lawsuit, knock on wood," he narrowly avoided one over his contribution to the Jonas Brothers' new single, Sucker - which many people compared to Portugal The Man's Feel It Still.

Portugal The Man were unconcerned, even acknowledging their own debt to The Marvellettes' Please Mister Postman, but the incident still raised problems.

"We had to spend thousands of dollars on musicologists just to verify the fact that we didn't reference the song at all," says Tedder.

"I know John [Gourley] from Portugal The Man, and he never brought it up - which tells me it's probably the publisher trying to make a landgrab," the singer adds.

"But now we're $5,000 poorer because we had to hire all these people to prove there was no case.

"So even if you don't copy, sometimes it can still cost you."

Meanwhile, OneRepublic are tangentially involved in a dispute between Russia's DJ Arty and dance producer Marshmello.

Arty says Marshmello and Bastille's song Happier copied a synth riff from his remix of OneRepublic's I Lived, and is suing for damages.

"Arty wouldn't sue somebody for the sake of it, because there's too much to lose," says Tedder, citing the negative "exposure of suing Marshmello".

"But if you listen to both of the [songs], I think anybody with a decent measure of musicality will draw their own conclusion. I'll leave it at that."

Copyright concerns aside, Tedder has been back in the studio with OneRepublic after a two-and-a-half year break from the band.

Their new single, Rescue Me, was released on Friday, and Tedder sat down to explain how the track came about, how pop songs are getting shorter, and why his band will never be A-listers.

Rescue Me pulls a cunning trick: It starts off as an acoustic ballad, then there's a massive bass drop.

Haha! Yeah, it's a different kind of vibe. It's funny, the song itself came about at the end of a Jonas Brothers' session. I had about 10 minutes left and my bass player picked up the guitar and started playing a riff. I swear to God, the entire lyric was written in five minutes.

Those lyrics are asking some pretty tough questions - "Would you rescue me? / Would you get my back? / Would you take my call when I start to crack?" Where did they come from?

Honestly, when I write my best songs I'm not thinking, so if I told you what was on my mind, it would be a lie.

But when I went back and dissected it, it's really about the idea of friendship, and the people around you. There's only so much time you have on earth, so are you spending it with the right people?

Especially once you have kids.

Of course! If something's going to rob me of my time with my kids, the stakes are higher.

The last three songs you've released have all been under three minutes long. Is that decision influenced by the trend for shorter songs on streaming services?

It's not a decision I ever make at the outset, so it's probably reactionary. But I'm definitely aware that songs are shorter. Look at Bazzi's Mine, I think it's 2 minutes 10 seconds.

Yes, and Lil Nas X's Old Town Road is 1'52".

And Thierra Whack released an album where every song was 60 seconds. I don't think we're headed that direction necessarily but the trend is definitely towards shorter songs.

Without question streaming has influenced that. People are doing two or three things at the same time and if you get three minutes into a song and it's not almost over, you're probably skipping to the next song, and that's just the truth.

With this single, I actually tried to figure out how could I make it longer. We doubled the length of the second chorus, we tried to add a bridge, but everything I tried to add just felt like fat.

Your singles don't always jump into the Top 10, but they have a habit of sticking around for months. Can you explain that?

I've had a lot of time to analyse it, and there's a couple of reasons.

The first part is, I've never had celebrity attached to myself or the band. We've never had that young, zeitgeist, 'holy crap' factor like Billie Eilish or One Direction or even Maroon 5, with all their crazy television exposure and marrying supermodels.

Not only do we not have celebrity, but we've never been adjacent to celebrity. Like, nobody in our band is dating an actress. Silly things like that create cultural zeitgeist on a level that's disproportionate to the event itself. If one of our band members married Emma Watson or was dating Rosalía, all of sudden we're selling twice as many tickets. It's stupid but it's true.

A second part of it is that, historically, we don't do songs that have features. So we don't have Cardi B and her Instagram followers swarming to our song. That's probably bad business but my whole thing is that a song's either good enough or it isn't.

You know, Counting Stars is now the number one song in the history of Interscope [Records]. We're almost at 40 million singles sold for that one song. So when we connect, it is literally only because of the quality of the song.

Isn't it reassuring that in an era of social media influencers and being "Instagram famous", a good song can still cut through?

Yeah, it is but the frustrating thing for me is that it's always taken us three to four times more work than any other artist.

Demi Lovato could drop a record that's a "B minus" and it will explode out the gate and react immediately with momentum because she's Demi Lovato. Now I've got nothing against Demi - all of us have released B minus records - but I'd be lying if I said there weren't days where I wish that was the case with OneRepublic.

Honestly dude, the reason I've taken two-and-a-half years off is it takes so much damn work, so much effort pushing that cart up the hill, that any time I considered releasing more music, I just thought, "I can't do it".

And all the time you're out promoting that music, you could be ticking off things bucket list things like working on Paul McCartney's album.

Exactly. That's the thing I always have to consider. I have two kids and a wife and until 2017, I was gone the majority of every year. I don't want to be that type of dad.

Image copyright Stewart Gerard Image caption OneRepublic's hits include Apologize and Counting Stars

As well as OneRepublic coming back, you're working on a TV show. What can you tell me about that?

Well, first of all, I get to wake up and drive to work at Universal Studios - which as a kid was my dream. I literally get to drive through the Back To The Future set every morning. I was writing lyrics last month sitting underneath the clock tower!

But the show's a scripted drama with Simon Fuller that's all about music. It's based on the Brit school, but based in Southern California. I've got the lead writer from Scrubs, so it's going to be hysterical.

So it's an S Club 7 reboot?

Haha! S Club 9! No, it's not… But we're going to launch five or six artists off this show, because I'm writing songs for the characters, and we have a huge streaming platform all tied in. It's crazy.

Rescue Me is out now.

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