Ed Sheeran performed a rendition of his hit song Thinking Out Loud as he took to the witness stand on the latest day of his copyright trial.
The British star, 32, is being sued by the heirs of Ed Townsend, who was the songwriter who originally wrote the popular 1973 track Let's Get It On sung by Marvin Gaye.
It was claimed that Ed's 2014 song Thinking Out Loud - which won him a Grammy Award - plagiarises the iconic track's harmonic progressions and melodic and rhythmic elements.
In court, his lawyer asked the singer how he came up with the song which led to Ed whipping out his guitar and giving the courtroom a musical performance.
The singer started playing the instrument to demonstrate how he came up with the lyrics and the chord progression.
Ed said songwriting was natural for him and that he could write up to nine in a single day.
The Bad Habits star went on to claim that his song collaborator Amy Wadge first started playing with the Thinking Out Loud chords before they wrote the lyrics together.
To demonstrate how his songwriting works, he started playing the chords of the popular song.
He first started by singing 'I'm singing out now' which soon transformed to 'I'm thinking out loud'.
Ed said: "When I write melodies, it's like phonetics."
"...When inspiration hits, you get excited, and it just comes out."
Ed insisted that he isn't "the world's most talented guitar player" and said he's "not classically trained in anything".
Meanwhile, Wednesday's proceedings at the Manhattan Federal Court saw laughter inside the courtroom after a plaintiff musicology expert, Dr Alexander Stewart, played an AI recording of the soul star's song.
The robotic voice sang: "Giving yourself to me, can never be wrong," with every syllable crisply stated, according to Business Insider.
The publication said the clip saw Sheeran suppress a grin at the defence table while others laughed.
"Come on, come on, come on, come on, come on baby," the voice continued, without the usual groove fans are used to.
Gaye and co-composer Townsend repeat a four-chord progression throughout the song, the musicologist, Dr. Alexander Stewart, explained.
After the track ended, the lawyer asked the expert: "Dr Stewart, did that sound particularly soulful to you?"
Sheeran's lawyers interrupted with an "objection" call before the lawyer withdrew the question.
Townsend’s heir, Kathryn Griffin Townsend, later told Insider the AI rendition of her late father's track was "hideous".
She added: "I think he would have laughed to hear it. Because he had a sense of humour."
* Follow Mirror Celebs on Snapchat, Instagram, Twitter and Facebook.