Formulate melodies by adhering to the specified pattern and supplied motif.
X:1
L:1/8
M:9/8
K:D
['(AFD) (DFD) (AFD)', '(dfd) (afd)'  
X:1
L:1/8
M:9/8
K:D
 B | (AFD) (DFD) (AFD) | (B/c/d).B (AFD) (BGE) | (AFD) (DFD) (AFD) | (Bgf) (efd) (Bcd) :: 
 (dfd) (afd) (bge) | (dfd) (afd) (ecA) | (dfd) (afd) (bge) | agf efd cBA :|  