Ah, polyphonics... I'm not sure that's the solution you'll find to be effective. You could try a library with threads, such as boost, and tie each of your music playing actions to a thread so they would run simultaneously. I think that should work pretty well.
The thing about C++, and the reason why I believe your problem will not be answered with loops, is that code will execute from the top down. If you nested one loop inside another, you could set that loop's condition to be bound against a counter in your first loop. It would only ever execute then, if your counter in your first loop was suitable. But the execution of your first loop would then wait while the second one ran. Only once the second loop was finished, would the first one resume iteration. (You see what I mean by that, right?) That's why I think threading is the solution for you.
I'm no expert on sound libraries, heck I've never even worked with one, but the way it works would have some effect on how this would be done... sorry, that's about all the advice I've got.