Compose a piece of music based on the provided motif and adhering to the outlined musical structure.
X:1
L:1/8
M:4/4
K:D
['a2 g2 B2 c2 B2 A^G A2', 'c2 Ag'  
X:1
L:1/8
M:4/4
K:D
 a2 g2 B2 c2 | B2 A^G A2 Af | f2 gA c2 GB | A2 dF A2 db | abag Bdce | BcA^G A2 df | c2 fa c2 ef | 
 d2 f2 d2 :| g2 gf e2 ed | c2 cB c2 Ag | f2 fe d2 dB | ABAG F2 Aa | gagf efed | cdcB c2 Ag | 
 fdAF GAce | d2 f2 d2 :|  