Compose a piece of music based on the provided motif and adhering to the outlined musical structure.
X:1
L:1/8
M:9/8
K:D
['G2 B BAG ABc', 'ABc d2 d'  
X:1
L:1/8
M:9/8
K:D
 G2 B BAG ABc | d2 g gfd BcA | G2 B BAG ABc | A2 d ded BcA | G2 B BAG ABc | d2 g gfd BcA | 
 G2 B BAG ABc | A2 d dgd fga || b2 a bge dgb | a2 a aga bgd | e2 e edB ABc | d2 d dgd fga | 
 b2 g gba ged | e2 e ede gdB | A2 A ABG ABc | d2 d dgf dcA ||  