Toward a Theory of Formal Musical Languages