Using the given motif as a foundation, craft a musical piece adhering to the outlined form.
X:1
L:1/8
Q:1/2=92
M:4/4
K:D
['f3 g a2 d2 e2 dc d3', 'B2 B2 e2'  
X:1
L:1/8
Q:1/2=92
M:4/4
K:D
"^Moderato" f3 g a2 d2 | e2 dc d3 c | B2 A2 c2 d2 | e/f/g f2{f} e4 | e2 a2 ^g2 a2 | b2 d2{d} c4 | 
 d3 f (ec)BA | B2 A^G A4 :| d2 d/e/f B2 B2 | e2 e/f/g{d} c4 | g3 b afed | e2 (dc){c} d4 | 
 d2 e/f/g B2 B2 | e2 e/f/g d2 c2 | g2 ga/b/ afed | fedc d4 |]  