>>11
You just play notes randomly and when they make a pleasing melody you write that down. There are some suggestions to what can be avoided since they very rarely produce pleasing melodies, but there's no real method to coming up with a melody. It's just exploration and experimentation.