Compose a musical piece in accordance with the outlined theme and structure.
X:1
L:1/8
M:4/4
K:D
['D3 F', 'defd A3 B defd'  
X:1
L:1/8
M:4/4
K:D
 D3 F A3 B | deed efdA | DGDF AFAB | dBAF (3EFE D2 | D3 F A2 AB | deed ef d2 | D3 F AFAB | 
 dBAF (3efe d2 || defd A3 B | defd A B2 c | d2{f} ed Bcdc | dBAF (3EFE D2 | defd A3 B | defd B3 c | 
 de{g}fd Bc d2 | dBAF (3EFE D2 ||  