This is a pretty basic question, but I'm self-taught and never really asked before.
In composition, when multiple instruments are playing different melodies at the same time, how can you ensure that they all sound good together?
Do they just have to all be playing in the same key, or is there more to it?