The story goes that Louis Armstrong was walking around the house scat singing. His wife said to him "Louie, why don't blow that stuff on your horn that you're singing?"
Man, did he ever! Satchmo's still got some of the coolest chops around.
To play melodically, you have to let the music lead YOU. Not the other way around.
Play 3 notes. Any 3 notes. Notice how they suggest the next note?
Sing that note. Then let that sequence suggest some more notes to you.
Sing the entire phrase now. With feeling, please.
You'll find that when your soul connects with mother nature's original musical instrument (the voice), you'll be singing melodically in the most natural of ways.
Now that you've sung your melody, figure it out out your instrument. I can't tell you how many times I've found that an idea that I'd come up with with my voice, I probably wouldn't have thought of with my fingers.
Have some fun. Take that basic melody and fiddle around with it.
Bottom line is: Every note has some kind of tendency, so it's pretty easy to figure out what note is supposed to come next if you just let it.
I call this "The Suggestive Method". You let the music *suggest* to YOU the next course of action. In this way the music virtually writes itself and you're just the facilitator - the "middle man" so to speak.
Pretty zen, huh? But it works!
With time you'll be able to skip the singing part of it and "pre-hear" the phrases on your own instrument. Bird was the master at that.
I should also qualify that there are ideas that my fingers come up with that my voice probably wouldn't. Ideally voice and instrument should reinforce and influence each other.