Using the given motif as a foundation, craft a musical piece adhering to the outlined form.
X:1
L:1/8
Q:1/2=90
M:4/4
K:D
['d2 fd a4 (gf).e.d (dc).B.A (cB).d.B (BA).d.A', 'cedf ea^gb aedc |{c} B4 (ec).f.e (ed)(cd)', 'fd egce d2'  
X:1
L:1/8
Q:1/2=90
M:4/4
K:D
 d2 fd | a4 (gf).e.d | (dc).B.A (cB).d.B | (BA).d.A (GF).E.D | DCB,A, F2 F2 |{F} TE3 F G2 G2 | 
{G} F4 f2 f2 |{f} Te3 f g2 g2 |{g} f4 Bdce | dABG FACE | D4 :: (fd).c.B | (A^G).F.E (FA).G.B | 
 (Ac).B.d cedf | ea^gb aedc |{c} B4 (ec).f.e | (ed)(cd) (Bdb).d | (dc).B.c (ae).d.c | fdcB ce^GB | 
{B} A4 FDAD | GDBD ADAF | GDB,G, ^GEBE | AEcE BEB^G | AECA, (Ac).e.g | (Ad).f.a gfed | 
 cBAG [dF]2 fd | a4 (gf).e.d | (dc).B.A (cB).d.B | (BA).d.A (GF).E.D | DCB,A, F2 F2 | 
{F} TE3 F G2 G2 |{G} F4 f2 f2 |{f} Te3 f g2 g2 |{g} f4 Bdce | dABG FACE | D4 :: (FA).^G.B | 
 (BA).^G.A (E=G).F.A | (AG).F.G (BG).F.E | (AF).E.D (CB,).G.E | (DC).B,.A, (FA).^G.B | 
 BA^GB E^GFA | AGFG (Bd).c.e | dABG FACE | D2 fd egce | d2 fd egce | d2 fa d2 fa | 
 [fA]2 z2 [fA]2 z2 | [fA]4 :|  