you can draw a curve according to the pitch: the high pitch is drawn high, like a mountain. The bass is drawn low, like a canyon. The whole melody line rises and falls like a mountain.
Melody line is an undulating line formed due to the change of pitch direction, strength and emotional contagion.