Ed Sheeran has serenaded London's High Court in an attempt to prove he did not copy portions of his 2017 hit Shape of You from another artist.
The star is accused of lifting his song's "Oh I, oh I, oh I" hook from Sami Chokri's 2015 single Oh Why.
In court, he sang elements of Nina Simone's Feeling Good and Blackstreet's No Diggity to illustrate how the melody is commonplace in pop music.
"If you put them all in the same key, they'll sound the same," he explained.
Sheeran denies having heard Mr Chokri's song and rejected the suggestion that friends might have played it to him before he wrote Shape of You in October 2016.
His upbeat pop track became 2017's best-selling single and remains the most-played song of all time on Spotify.
But Sheeran's royalties - estimated to be about £20m - have been frozen since Mr Chokri and his co-writer Ross O'Donoghue claimed copyright infringement in 2018.
Court hears voice memos
Lawyers for the pair played the court excerpts from the Shape of You recording sessions as they built their case.
In one recording, Sheeran could be heard saying he needed to change the "oh I" melody because it was "a bit close to the bone".
"We thought it was a bit too close to a song called No Diggity by Blackstreet," the star told the court. "I said that... we should change it."
Asked whether his final melody bore a similarity to Chokri's song, he added: "Fundamentally, yes. They are based around the minor pentatonic scale [and] they both have vowels in them."
Andrew Sutcliffe QC, representing Mr Chokri and Mr O'Donoghue, asked: "It was a phrase you already had in your head after listening to the chorus of Sam's song, wasn't it?"
"No," Sheeran replied.
The singer was also accused of being an "obsessive music squirrel" who consumed music "voraciously" and would have been aware of Mr Chokri's music.
"I'm a music fan, I like music, I listen to music," Sheeran said. But he insisted he had "disappeared for the whole year" in 2016 and was "not plugged in" to the UK music scene.
A collaborative effort
Sheeran was repeatedly asked who had come up with the "oh I" phrase, but explained it had been a collaborative effort with his co-writers Steve Mac and Johnny McDaid.
"It was all of us three bouncing back and forth in a circle," he said. "That was how it originated."
"Three people could not create the germ of the melody," suggested Mr Sutcliffe.
"Why can't three people create a melody?" Sheeran replied.
The court also heard how Sheeran tweaked the first version of Shape of You to remove elements that were similar to the Bill Withers song Grandma's Hands and TLC's No Scrubs.
"Your approach is take it, change it and make lots of money, isn't it?" Mr Sutcliffe asked the star.
"No," he replied, later adding that a "musicologist went over the song [Shape of You] and found similarities and we changed the similarities".
Sheeran pointed out that he had sought clearance from TLC's writers, although they had not responded by the time his song was released. They were later given a credit on the track.
Unreleased song played
The star disclosed that Shape of You was originally envisioned for Little Mix or Rihanna, and that he had not wanted to release it on his multi-platinum Divide album.
"I thought this song clashed with Castle On The Hill. It doesn't fit with the rest of the album," he said. "I didn't want to put it out and I was subsequently proved wrong."
The singer briefly became irritated when a snippet of an unreleased song was mistakenly played to the court.
"That's a song I wrote last January. How did you get that?" he asked, glancing at his lawyers. "I want to know how you got that."
It was later explained that some of the music played to the court was coming from Steve Mac's personal laptop, and the wrong folder had been accidentally accessed.
Sheeran and his co-authors launched legal proceedings in May 2018, asking the High Court to declare they had not infringed Mr Chokri and Mr O'Donoghue's copyright.
In July 2018, Mr Chokri and Mr O'Donoghue issued their own claim for "copyright infringement, damages and an account of profits in relation to the alleged infringement".
Mr Sutcliffe accused Sheeran and his co-writers of issuing what he called a "slapp suit" intended to "intimidate" his clients with the burdensome cost of a legal defence "until they abandon their claim".
"No I wanted to prove I was right," he replied. "I'm trying to clear my name here."
The case continues.