Working out the key of a piece