Construct a piece of music using the designated motif as the basis, while ensuring the required form is followed.
X:1
L:1/8
M:6/8
K:G
['G2 B BAB GBd def gfg edB', 'def gfg'  
X:1
L:1/8
M:6/8
K:G
 D | G2 B BAB | GBd def | gfg edB | dcA A2 B | G2 B BAB | GBd def | gfg edB | dBG G2 :: d | 
 def gfg | dag fed | def gfg | a2 A A2 B | G2 B BAB | GBd def | gfg edB | dBG G2 :|  