Using the given motif as a foundation, craft a musical piece adhering to the outlined form.
X:1
L:1/8
M:4/4
K:D
['D3 B ADFA dcde fdAF GFED CDEF', 'd3 g f2 dc dfaf gbed cdeg'  
X:1
L:1/8
M:4/4
K:D
 D3 B ADFA | dcde fdAF | GFED CDEF | GBAF EA, (3A,G,A, | FDA,D FGAc | BGBd cdef | fgaf gecd | 
 eddc d3 || g | f2 dc dfaf | gbed cdeg | fgaf gfed | edcB AGAG | FDFA dAFA | GFGB edcB | 
 Adfa gecd | eddc d4 ||  