Generate music by following the outlined musical form presented using letters and incorporating the provided motif.
X:1
L:1/8
Q:3/8=120
M:6/8
K:D
['A d2 d f2 a gfg e2', 'B2 B']  
X:1
L:1/8
Q:3/8=120
M:6/8
K:D
 A | d2 d f2 a | gfg e2 a | f2 d B2 e | cBc A2 A | d2 d f2 a | gfg e2 a | afd gec | d2 f d2 :: A | 
 d2 d cBc | B2 B B2 B | e2 e dcd | c2 c c2 A | dcd ede | fef gfg | afd gec | d2 f d2 :|  