Compose a musical piece in accordance with the outlined theme and structure.
X:1
L:1/8
Q:3/8=50
M:3/8
K:D
['|:S d ff/g/f/e/ dd/e/d/c/ Bcd A2 A', 'd2 e/f/ (g/a/).g/.f/.e/.d/ ceg fdA FAd Bcd', 'dcB cea g2 f gfg Bed'  
X:1
L:1/8
Q:3/8=50
M:3/8
K:D
|:S d | ff/g/f/e/ | dd/e/d/c/ | Bcd | A2 A | .gfe | .bac | edd | d2 :: e/f/ | (g/a/).g/.f/.e/.d/ | 
 ceg | fdA | FAd | Bcd | ege | ce/d/c/B/ | A2S :| A | AFd | dcB | cea | g2 f | gfg | Bed | 
 (c/d/).e/.d/.c/.B/ | (A/B/).A/.G/.F/.E/ | FAd | dcB | cea | g2 f | gfg | Bed | d/c/B/A/B/c/ | 
 d2 |]  