What books, in your experience, are the best to read to learn the theory of writing melodies. I don't mean basic introductory books about scale tone tendencies and motives (which seems to be all that I can find), but more in depth books about writing melodies.
Also, what do you find is the best way to learn to write melodies?