Craft a musical piece that incorporates the given motif and follows the outlined structure.
X:1
L:1/8
M:2/4
K:D
['a>g fd/e/ fe d(a a)a/b/ a/f/d B>A', 'd2 dd f>e f/d/e d(d d)d/e/ f/e/d'  
X:1
L:1/8
M:2/4
K:D
 a>g fd/e/ | fe d(a | a)a/b/ a/f/d | B>A Ba | a3 g | f/d/e/c/ d(d | d)d/B/ AA/B/ | d>B d2 :| 
 dd f>e | f/d/e d(d | d)d/e/ f/e/d | B>A B(d | d)d f>e | f/d/e/c/ d(d | d)d/B/ AA/B/ | d>B d2 :|  