That looks like very nice code indeed!
Although the accent on sound programming by me (ASIO engine, VST's) lay in the early 2000's I am certainly going to try that code: I just wrote a triplet composer for every common scale, so I will try and connect that code to it.
BTW: I see you write the wav on the fly: I'd like to see you using TWaveFormat or preferably TWaveFormatEx, because then it is easier to integrate with other wav dependent software like audio studio's. But as is it should also work.
Keep you posted about my results.