Part four is about melody. First question: which notes actually fit? The answer is simple — the notes of the chord that is currently sounding always fit.
Parts one to three built the foundation. Now for the line that runs across the top of it. The first question is almost always "which notes am I allowed to use?"
The chord's own notes always fit
While a C chord is sounding, you can sing C, E or G and it fits. Obviously — the accompaniment is already playing them. Whenever you get stuck, returning to a chord tone always lands.
A note belonging to the chord currently sounding. Use it in the melody and it always fits.
What about the rest of the key?
The key contains notes that are not in the chord — over a C chord, those are D, F, A and B. They are not "wrong" notes. Used as passing notes they give the melody movement. Held for a long time, they float away from the harmony.
Placement beats note choice
What matters is where a note lands, not which note it is. A chord tone on a strong beat (the downbeat from chapter four) sounds settled. A non-chord tone on a weak beat just passes through, and passing through sounds natural.
- A melody over C, F, G, C
C | F | G | C
Generate, then look at the piano roll and check which notes fall on the strong beats.
Generate over C, F, G, CChord tones on strong beats sound settled; other notes create movement. Placement matters more than which note.