Construct melodic segments by incorporating the provided motif with the designated musical pattern.
X:1
L:1/8
M:4/4
K:D
['d2 (3.B.c.d gdBd'  
X:1
L:1/8
M:4/4
K:D
|:"G" GA |"G" B2 GB AGEG |"G" DGGF G2 AB |"C" c2 AB cBAG | FAAG"D" FD GA |"G" B2 GB AGEG | 
"G" DGGF G2 (3.A.B.c |"C" d2 Bd gdBd |"D" cAFA"G" G2 ::"G" Bc |"G" d2 (3.B.c.d gdBd | 
 d2 (3.B.c.d gdBd |"C" e2 ce agfe |"D" defg agfe |"G" d2 (3.B.c.d gdBd |"G" d2 (3.B.c.d gdBd | 
"C" cBAc BAGB |"D" AGFA"G" G2 :|  