What is the definition of melody in a song?

A melody is a sequence of single notes that is musically satisfying. Any series of single tone creates a melody. The human voice, the flute, horn,—all instruments capable of emitting but one tone at a time. Each of these instruments produces a melody. Melody constitutes, then, a line of tones. The quality of the melody depends upon the choice and duration of each successive tone.

A good melody is one that appeals to the music lover as tuneful, pleasing, and intelligible. It is one where each successive tone and each successive group of tones stands in a rational harmonic relation to the one before it, and even, usually, to several preceding tones or groups. To say it another way, the tones are not arranged haphazard, but with reference to their harmonious agreement with each other.