There was a time when I thought musical copyright only applied to lyrics and melody. But looking at a lot of the cases tried, it's clearly about more than that. The Katy Perry lawsuit over her song "Dark Horse" was lost because of the synth riff...which I guess is melodic...but it seems odd to me that you can't do that, but you CAN write unlimited blues songs with the exact same structure and similar melodies.

Than there's Led Zeppelin. This isn't the first time they've been accused of lifting other people's stuff...I don't think an album went by without them re-writing and rocking up a blues classic with basically the same lyrics and claiming it as their own, entirely. Here's a good list: https://www.rollingstone.com/music/music-news/led-zeppelins-10-boldest-rip-offs-223419/

I don't know where the line should be drawn, but Zeppelin definitely liked to push the boundaries further than any other band I can recall.