I don't base a melody on scale. What I do sometimes is choose one note and play it against chord progression. It will have a different function depending on what the chords are underneath. Then I can see where that note wants to go at various times, and how it wants to move rhythmically. If you are thinking of a scale then you are thinking of a chord as statically there for a long time allowing you to create scalar patterns with it, but the chord progression is always moving, even when it is not. Melody has to move horizontally, even when it repeats the same note. I've watched some youtube videos and they say: "don't do this" [plays a scale from top to bottom or bottom to top]. Well no. That's obvious, though of course classical composers do that sometimes.
If you play a pentatonic scale though it is almost automatically melodic [plays first line of someone to watch over me]. That means leaving out the 4th and the 7th. You can put the seventh back in as a passing tone and you have all you need. You can melodize all day long and never have to use the 4th.
What I feel missing in discussions of melody is the idea of lilt. This is not up or down, or down then up or up then down, but an engaging "up-down" contour that catches the ear at a certain angle.
Take Ornette's "Latin Genetics" in the last post. The A sections of the tune consists of a series of 7 chords arpeggiated in a downward movement to the same five note rhythm, with another down-up phrase at the end, played twice. It has a nice lilt to it and part of this is the lack of movement in the first three notes of the motif. The other part is you never know whether the next phrase will start or end lower or higher than the previous one. The tune sounds both simplistic and unexpected.