main controller to play melodies