How to dramatically change the feeling of a song while keeping the melody largely the same? Let's say we have a happy, upbeat pop song and we want to turn it into a sad song (or vice versa). Is it generally possible? Does the feeling of a song depend more on the melody or the harmony?
If it can be done, are there any general rules or common patterns that we can follow? One who have time can explore the infinitely many ways, but general rules can serve as good start points and help those with little composing experience.
It would be nice if you can provide an example of two passages with the same melody but opposite or very different feelings, and briefly explain the structural differences of the two passages.
Clarification: Transposing the melody from major and its relative minor is too big of a change for me. If possible, I'd like to preserve the relative pitch of the notes in the melody (but perhaps radically change other stuffs such as the harmony).