Procedural music generation in C++