If you can make the notes fade in rather than start at full volume immediately, that might get rid of the popping. And if you stop them without fading out, that too could cause popping. For my own game I decided to play music on real instruments and edit the recordings to remove some silence, but without cutting inside notes. So on the guitar track I only cut at the very start and end (on string instruments the notes tend to overlap, and I didn't have any too long silence inside the piece that I wanted to cut out), and I think I added a fade effect to make the last note fade slightly faster than it did when I recorded it.