There are a lot of songs that have a melody, usually a simple one or even a two-note pattern, that is played during many bars, but the bass note for each bar changes, implying chord changes?
One example is the intro to Sweet Child O'Mine.
UPDATE: Other is the two-note guitar melody in U2 "With or Without You".
UPDATE2: A perfect example is the guitar melody in Steve Vai's "Junkie", which keeps unaltered even after full strummed chord progression begins.
Is there a "formula" do achieve this?