Generalized musical intervals and transformations