Using the given motif as a foundation, craft a musical piece adhering to the outlined form.
X:1
L:1/8
M:2/4
K:D
['e f2 f>e ed d>d cd ef', 'fB B>c', 'a>a gf eB B2'  
X:1
L:1/8
M:2/4
K:D
|: e | f2 f>e | ed d>d | cd ef | a^g =g2 | g2 g>f | fe e>e | dc Bc |1 BA A :|2 d3 |: e | fB fB/B/ | 
 fB B>c | dB B/c/d/B/ | cF F>e | fB fB | fB B>c | dd cd/c/ | B3 :| ^A | A>A de | f3 g | a>a gf | 
 eB B2 | e>e g/f/e | g3 a | b>b ag | fe d/e/d/B/ | AA/A/ de | f2 fg | a>a gf | eB B2 | b>b cb | 
 ba f/g/a | a^g/a/ bc | d3 ||  