Melodies are built from motives (short rhythmic/melodic cells) grouped into phrases
A motive is the smallest unit of melody — typically 2-4 notes with a strong, recognizable rhythm. Motives have both a rhythmic identity (the pattern of note lengths) and a melodic identity (the intervals used). Two related motives combine to form a phrase, often in a question and answer (antecedent/consequent) relationship. Phrases in turn build sections. To write a memorable motive: (1) establish the rhythm first; (2) choose intervals that match the emotional intent. In electronic music, motives in bass lines, leads, or stabs give tracks identity and hook.
Examples
Beethoven 5th: 3-note da-da-da-DUM motive in two bars = one phrase. Dance bass motive: two sixteenths + eighth, looped = driving groove.
Assessment
Identify the motive in a 4-bar bass line you know. Write a 2-bar phrase from a rising-fifth motive in A minor.