A snippet of an unreleased song by Suffolk’s Ed Sheeran was accidentally played during the music star’s copyright infringement trial at the High Court.

Mr Sheeran, who grew up in Framlingham, and two of his Shape Of You co-authors, Steven McCutcheon and John McDaid, is involved in a legal battle with songwriters Sami Chokri and Ross O’Donoghue, who claim the 2017 hit rips off parts of their song, Oh Why.

The 31-year-old looked miffed when a short blast of music was heard during the hearing yesterday.

Glancing at his lawyers, Mr Sheeran said: "That’s a song I wrote last January. How have you got that?"

Mr Sheeran’s barrister, Ian Mill QC, later told the court his client was left “disconcerted” by the music being played while he was asked to listen to early recordings from the creation of Shape of You.

Mr Mill explained that the incident happened “by mistake” through the use of Mr McCutcheon’s computer and his iTunes which “contains some unreleased material”.

Mr Sheeran received an apology and Mr Mill said: "I'm sure it won't happen again."

During the court hearing yesterday, Mr Sheeran frequently burst into song and hummed musical scales and melodies while he was questioned over how Shape of You was put together.

Grime artists Mr Chokri and Mr O'Donoghue claim that a central “Oh I” hook in Shape Of You is “strikingly similar” to an Oh Why refrain in their own composition.

East Anglian Daily Times: Sami Chokri arrives at the Rolls Building at the High Court in LondonSami Chokri arrives at the Rolls Building at the High Court in London (Image: PA Wire/PA Images)

Mr Sheeran described the hooks as using the “pentatonic scale” with “vowels” when asked if they were similar, with several early initial iterations of parts of Shape of You played in court.

Andrew Sutcliffe QC, representing Mr Chokri and Mr O’Donoghue, asked the singer: “It was a phrase you already had in your head after listening to the chorus of Sami’s song Oh Why, wasn’t it?”

“No,” Mr Sheeran replied.

In written evidence, Mr Sheeran, who admitted he "didn't take music theory" said the "minor pentatonic pattern" was "very common" and was used in his song I See Fire and by Nina Simone.

The court heard that Shape of You was written at Mr McCutcheon’s Rokstone Studios in west London’s Parsons Green, where Mr McCutcheon initially came up with a marimba sound, in October 2016.

The writers decided on including a vocal chant section using the minor pentatonic scale after the song’s chorus.

Sheeran decided singing the section using the word “heya” was too “close to the bone” because it sounded similar to a song called No Diggity by the band Blackstreet.

He repeatedly told the court that he, Mr McDaid and Mr McCuctheon wrote the song together.

Mr Sutcliffe claimed Mr Sheeran’s co-authors could not recall “how this Oh I section came into being”, suggesting it was because Mr Sheeran “originated it”.

“No,” Sheeran said, adding: “I would say the melody and all of it was all of us three in a circle, bouncing back and forth. That was how it originated.”

“Three people could not create the germ of the melody,” Mr Sutcliffe claimed, but Sheeran replied: “Why can’t three people create a melody?”

Mr Sutcliffe earlier suggested that Mr Sheeran was “an obsessive music squirrel” who “consumed music voraciously in 2015 and 2016”.

The singer has previously denied that he was “talent spotting” and “plugged in” to the UK music scene in 2015, when Mr Chokri was making a return after a two-year absence.

On Monday, he told the court he had “disappeared for the entire year” in 2016 and “got rid” of his phone in late 2015.

“Of course I was listening to stuff here and there but I was not actively looking for it,” he said.

Mr Chokri and Mr O’Donoghue allege that Shape Of You infringes “particular lines and phrases” of their song Oh Why.

But Mr Sheeran’s lawyers have told the High Court that the singer and his co-writers have no recollection of having heard Oh Why before the legal fight and deny the allegations of copying.

Mr 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”.

The trial, which is expected to last for three weeks, continues.