Compose a tune that integrates the letter-based representation of the determined musical pattern and the given melodic idea.
X:1
L:1/8
M:4/4
K:G
['BG G2', 'B2 dega b2 ag ea a2 agef', 'cBcA GB B2 BABc d2 AG FDEF']  
X:1
L:1/8
M:4/4
K:G
|: BG G2 d2 cA | (3Bcd cA BG G2 | AD D2 cD D2 | B3 d cAFA | BG G2 d2 cA | BdcA BG G2 | FGAd fdeg |1 
 fdcA G3 A :|2 fdcA G2 Bd |: g3 a gB B2 | eBgB eB B2 | dega b2 ag | ea a2 agef | g2 bg f2 af | 
 egfd eB B2 | c2 ec B2 dB | AGAB cdef :: g2 dc BG G2 | FGAB cBcA | GB B2 BABc | d2 AG FDEF | 
 G2 BG F2 AF | egfd eB B2 | c2 ec B2 dB |1 ABcd BG G2 :|2 ABcd B G3 ||  