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:C
['d>gf>g b>gd>B (3cBA e>c (3BAG', 'd>ef>g (3agf'  
X:1
L:1/8
M:4/4
K:C
 BEA |[M:2/2][K:G]SOSOO .!fermata!PMTuCOMD>F | G>AB>c d>Be>c | d>gf>g b>gd>B | 
 (3cBA e>c (3BAG d>B | (3ABG (3FGE D>cB>A | G>AB>c d>ce>c | d>gf>g b>gd>B | (3cBA e>c (3BAG (3AGF | 
 G>BA>F G2 :: (f>g) | a>g (3fge d>ef>g | (3agf (3gfe d>ef>g | (3agf (3bag (3agf (3gfe | 
 d>gg>c (3BAG (3AGF | G>AB>c d>ce>c | d>gf>g b>gd>B | (3cBA e>c (3BAG (3AGF | G>BA>F G2 :|  