Formulate melodies by adhering to the specified pattern and supplied motif.
X:1
L:1/8
M:2/2
K:D
['(3gfe dAFA D2 FA dfec dcBc A2', 'dg g2 bg g2 dgbg'  
X:1
L:1/8
M:2/2
K:D
 (3gfe | dAFA D2 FA | dfec dcBc | A2 ce (3ABA ce | faec dcBA | dAFA dAFA | dfec dcBA | g3 b afdf | 
 eABc d2 :: d2 | dg g2 bg g2 | dgbg agfg | A2 ce (3ABA ce | faef dcBA | dg g2 bg g2 | dgbg agfa | 
 gfgb afdf | eABc d2 :|  