Trying to work out how the basslines work was the hardest part. I've written it in JavaScript so you can just right click on the page and view the source. The relevant sections to do with beat/basslines are from about line 489 to the end, but I'm not sure how well it would translate to C++. It shoul...