Construct a musical piece that integrates the provided motif and corresponds to the indicated musical structure.
X:1
L:1/8
M:2/2
K:Gmix
['g3 d']  
X:1
L:1/8
M:2/2
K:Gmix
 d2 | g3 d g3 d | gfef g2 B2 | c2 A2 e3 e | A8 | G2 GG G2 G2 | GABc d3 B | cd e2 d3 c | B6 |]  