the pythagoreans , having discovered the mathematical laws of musical pitch ( reducing the length of a vibrating string by exactly half , raises the pitch of the string by exactly an octave ) , inferred that the motions of the planets produced a heavenly music , and based on this developed a musical therapy to bring humanity in harmony with the celestial spheres .