Compose a piece of music based on the provided motif and adhering to the outlined musical structure.
X:1
L:1/8
M:2/4
K:G
['B A']  
X:1
L:1/8
M:2/4
K:G
 d d/ d/ e g | d d3 | g e/ d/ d E | G G3 | G3/2 A/ d B | A B A G | A A/ B/ G D | E E G/ G/ G/ E/ | 
 D D3 |]  