I was thinking about that whole music/software programming thing, that wouldn't actually be a bad idea. Not sure if it has been done before (I am sure it has) but a module could be made to summarize a musical composition and make recommendations based on the analysis of the existing material.
The hardest part would be the theme recognition/summarization algorithm, but I am not exactly sure what all factors would come into play because I am not advanced enough in music. Certain weighting factors could be implemented for interval, melody, harmony, rhythm. As the music goes further away from the current location of where a recommendation would take place, the summarization would become greater, although I would think there would be a fairly granular analysis of the first and last beats in a measure. Something like that could be sold directly to a company or licensed out to multiple companies.
The distance from the relevant location where generated music would go could affect the weighting priority placed on, it gets less the further out it goes, although those would need some sort of isolated algorithm in itself to recognized theme patterns. There would need to be a large dictionary of theme patterns and how they are classified.
As a beginning build something more simple could be done such as only analysis of the tempo, timing, and a selectable theme which then just generates a random bar or measure in the key of the composition. Maybe some limited analysis of rhythm, melody, harmony.
The idea is to create a generator that doesn't necessarily create a perfect filler, but rather kicks off ideas to kill composition block.