Musical plagiarism was an accepted practice in the 17th and 18th centuries. In fact, is was considered more of an homage.
When discovering the works of Vivaldi, Bach went to work on rewriting them in his own style. No lawsuits were filed.
Here’s a great example. Joseph Haydn wrote these very unique eight notes to begin the menuet of his 21st symphony, 1764:
A full 23 years later (1787), Mozart felt no compunction about lifting them whole cloth for his minuet in his famous Eine Kleine Nachtmusik:
Now let’s skip ahead to our litigious age where George Harrison’s My Sweet Lord and many other accusations of copyright violations were settled in court.
I only provide two examples here, though they differ in the basic intricacies of copyright law.
In this first example, Keith Jarrett laid down a funky little riff based on only two chords (Long As You Know You’re Living Yours), but listen to the similarity in the rhythm:
Now listen to Steely Dan’s Gaucho from 1980:
After Jarrett filied suit, Fagen & Becker settled by adding his name to the “composed by” credit.
Jarrett’s clip is YouTube Premium only. So see this:
The following case is much different. Bill Evans’s Peace Piece consists of only two chords (CMaj7 / Gsus9):