Develop a musical piece using the given motif and adhere to the outlined structure.
X:1
L:1/8
M:4/4
K:D
['f2 A2 (gf) (ed) |({=c} B3', 'A (de) (fg) a2 (fa) (ba) (gf)'  
X:1
L:1/8
M:4/4
K:D
 (de) |{d} f2 (A>B){B} A3 d |({=c} BA) (Bd){f} e2 (de) | f2 A2 (gf) (ed) |({=c} B3 ^c d2) (de) | 
 f2 (A>B) A3 d | (BA) (Bd) e2 (de) |{d} f2 A2 (gf) (ed) |({=c} B3 ^c) d2 |] z A | 
 (de) (fg){f} a3 a | (ba) (gf) e3 A | (de) (fg) (ab) (ag) | (f3 g) a2 z A | (de) (fg) a2 (fa) | 
 (ba) (gf) e2 (de) | f2 A2 (gf) (ed) |({=c} B3 ^c){e} d2 |]  