constructing melody