Starting point is the simple task to write down 100 "beautiful" versions of a given arpeggio. Assuming a seven-note-arpeggio, it is possible to (automatically) generate no less than 7! = 5040 versions/permutations of the existing notes.1 In a next step, all 5040 versions are being played through (preferably on a keyboard instrument). According to his subjective judgement the player chooses 100 versions out of them.
Mechanical Creativity and its Background
Commonly creativity is thought to be connected to some kind of highly subjective process and almost "mystified" – and therefore withdrawn from rational understanding. In contrast to that the mechanical aspect of creativity shall be lightened up here.
The permutational aspect of music was frequently discussed in 17th and 18th century. As a first to be mentioned is Marin Mersenne and his Harmonie universelle. Not only is he doing very detailed calculations on the number possible permutations under various circumstances. He also dared to print in the Harmonie universelle no less than all 720 possible permutations of a hexachord. Combinatorical considerations can regularly be found also in later sources.2 Common to almost all of them, including Mersenne, is the mentioning of God in the context of the "almost infinite" amount of variations that permutation can generate.
"All the people of the earth couldn't sing all of the possible songs contained in the harmonic hand […] Even if they sang a thousand different songs every day from the creation of the world until the present."
[Mersenne, Harmonie universelle]
"With evident regret, Mersenne conceded that it would never be possible on this earth to compose a perfect melody, although he held out the happy prospect that the devout Christian might yet hear such perfect melodies sung by the angels in paradise if it so pleased God. Still, the exercise in permutation theory was a useful one, if only to remind us of the unfathomable riches God has made available to us on this earth. Music is thus a parable for the plentitude of His creation. In contemplating this science of sound, Mersenne continually reminds us, the pious listener is lead inexorably to greater devotion to God."
[Thomas Christensen, "The sound world of father Mersenne" in Susan McClary (ed.): Structures of Feeling in 17th Century Cultural Expression, p. 69]
Yet, most of the sources considered combinatorial arts to be an important help in both, composition as well as improvisation.