Construct melodies utilizing the provided motif and adhere to the outlined musical structure.
X:1
L:1/8
Q:1/8=180
M:4/4
K:D
['Acec aecA d2 cd ecdc', 'A2 (3Bcd', 'Bc dBGB dBGB dBGG G2 FG Aeef'  
X:1
L:1/8
Q:1/8=180
M:4/4
K:D
"^A modal" ed | c2 B2 Acec | aecA d2 cd | ecdc Bced | cAec Bfed |"^5" (3cdc (3BcB Acec | 
 aecA d2 cd | ecdc Bfed | cAAA A2 || ce |"^9" a2 af abc'a | beee e3 f | (3gag ef gbag | fddd dfed | 
"^13" c2 B2 Acec | aecA (3ded cd | ecdc Bced | cAAA A2 || (3Bcd |"^17" e3 c A2 (3Bcd | efec A2 Bc | 
 dBGB dBGB | dBGG G2 FG |"^21" Aeef ed (3BcB | Aeec (3ded cd | ecdc Bced | cAAA A4 |]  