**** notation.

Heres a simple way.
just find the notes that make up the D chord (major (happy) or minor(sad)) on the piano (if thats the first note your bassline starts) and play with them on all their octaves. Jam to your hearts content and then find a bit you like. Expant on this by introducing more notes in the D scale into the riff.

http://www.8notes.com/piano_chord_chart/Dm.asp