Construct a musical piece that integrates the provided motif and corresponds to the indicated musical structure.
X:1
L:1/8
M:3/4
K:Bmin
['B2 B3 d (BA) B2 d2 e2', 'B4 (ag) f2 a2 b2 (a2 f2)'  
X:1
L:1/8
M:3/4
K:Bmin
 (fe) | (d2 B2) B2 | B3 d (BA) | B2 d2 e2 | f3 e d2 | d3 e (de/f/) | A4 (fe) | d2 B2 B2 | 
 B3 d (BA) | B2 d2 e2 | f3 e d2 | e3 d (ef) | B4 :: (ag) | f2 a2 b2 | (a2 f2) e2 | d3 e f2 | 
 f3 g a2 | (f3 e) d2 | A4 (fe) | d2 B2 B2 | B3 d (BA) | B2 b2 (ag) | f3 e d2 | e3 d (ef) | B4 |]  