Markov Based Quality Metrics For Generating Structured Music With Optimization Techniques