You can learn to do this when not tripping, but it's much easier to pick up when on drugs. I often hear instrumental music that's entirely a hallucination when drifting off the sleep—rock, jazz, pop, I'm not sure how my brain decides. As best I can tell most of it is synthesized in my brain—it's quite different from "playing a track in your brain" from memory.