I may have misunderstood the original post but I thought the question was more along the lines of: How do I work out which chord(s) to play when the piano is playing x notes.
At least I was hoping that is what the question was because I would like to know that as well. Obviously you could sit down and work out which notes are being played in total, then work out which scale that is, then establish a chord or chords from that scale.. but you can't do that every time, and it's also not very time efficient.. and also makes it look like you have no idea.. hehe.. :p