Melody Writing and Analysis