Many have. This is more or less how I learn every new programming language. Generative music is really fun and immediate. Anyway, I think the first time I ever saw anyone introduce recursion into music generation was Giles Bowkett's Archaeopteryx. That was way back in the days when Ruby was still young and cool. He did some interesting stuff for keeping a stable clock in ruby using recursion without blowing up the stack, but also managed to use the same technique for generating variations on probabilistic sequences. Pick your language and you will find people doing small projects like this all over the place.