Compose a musical piece in accordance with the outlined theme and structure.
X:1
L:1/8
M:4/4
K:D
['B AAAf edBd AGAB dedB AAAf edBg', 'fedf edBg'  
X:1
L:1/8
M:4/4
K:D
 B | AAAf edBd | AGAB dedB | AAAf edBg | faAB d2 d :| g | fedf edBg | Tfefg aAag | fedf edBg | 
 f/g/a AB d2 dg | fedf edBg | Tfefg aAag | fdgf edBg | faef d2 d ||  