Merged MML implementation from App_Melody 1.3.3.