Compose a musical piece using the given motif and adhering to the outlined musical form.
X:1
L:1/4
M:4/4
K:D
['d d2 B']  
X:1
L:1/4
M:4/4
K:D
"D" d d2 B |"D" d2 f2 |"D" d d2 B |"G" B2"A7" A2 |"D" d d2 B |"D" d2 f2 |"^(G)" f a"A7" f e | 
"D" d4 |]  