An Adaptive Music Engine For Interactive Systems