Craft a musical piece that incorporates the given motif and follows the outlined structure.
X:1
L:1/16
M:2/4
K:D
['d2(ef) agfg', 'eee2 aaa2 fff2 bbb2', "ccc2 d2d2 g4 (f2a2c'2)f2 a2g2 dcd2 BBB2"  
X:1
L:1/16
M:2/4
K:D
 fg | aaaa a2d'2 | f2a2 d2(ef) | agfg e2(fg) | ga^ga f2(fg) | aaaa a2d2 | g2a2 d2(ef) | agfg e2c2 | 
 d4 z2 || c2d2 | eee2 aaa2 | fff2 bbb2 | .a2.g2.f2.e2 | c'2b2 a2 cd | eee2 aaa2 | fff2 bbb2 | 
 agfe c'2b2 | a4 z2 ||[K:G] BBB2 ccc2 | d2d2 g4 | (f2a2c'2)f2 | a2g2 dcd2 | BBB2 ccc2 | e2d2 g4 | 
 fgab c'd'e'f' | g'2g'2g'2 ||  