Compose a tune that integrates the letter-based representation of the determined musical pattern and the given melodic idea.
X:1
L:1/8
Q:1/4=150
M:2/4
K:D
['', 'd>B G>B', 'z d', 'z z z/']  
X:1
L:1/8
Q:1/4=150
M:2/4
K:D
 d |: d>B G>B | D>G B>d | d>B G>B | D>G B>d | d2 A>d | d2 A>d | d2 A>d | B>A G>d | d>B G>B | 
 D>GB>d | d>B G>B | D>G B>d | d2 A>f | f2 d>a | a2 e>f | d2 z2 ::[K:G] c2 z B | ABcd | e2 z d | 
 defg | g z fg | f z ef | e z de | d2 z z/ B/ | c2 z B | ABcd | e2 z d | defg | g3/2 z/ Be | 
 d3/2 z/ AB | G>B d>B | G2 z2 ::"^Trio" b z g z | d z B z | Aeee | e z z z/ c/ | Afff | ffed | 
 gbge | d z z z/ d/ | b z g z | d z B z | Geee | e z z z/ c/ | Afff | ffed | g z b z | g z x2 :|  