The \addNote function here makes it faster and simpler.
The syntax is : \addNote \melody \newNotes
Here :
melody = \relative {c'4.-> d8-. c4(\p b8) r c4\f c c2}
newnotes = {e f e d e s e}
Note that with this function, you can easily create some other useful functions. For example, a function \doubleOctave is shown here. This doubles each note with the note an octave higher.