A theory of harmony