In the Western Classical Tradition melodies are usually made up of arpeggios (i.e. skips between notes of the chord) or any of the following dissonances. If you are writing in a broadly Classical or early Romantic style you should avoid using dissonances other than those listed below.
In particular, the following dissonances are very rare and should be avoided (see dissonance rogues):
- dissonant notes followed by a leap (other than escape notes)
- unaccented dissonant notes approached by leap
There is one dissonance that is very commonly treated as a consonance and that is the seventh in a dominant seventh chord. In this example, the melody leaps freely both to and from the C (seventh of D) in the second bar:
When you are writing a melody you should (at least to start off with) label your chords and if necessary write out the component notes so that you are clear exactly what is dissonant and what is consonant. The example below shows some correct melodic dissonances: