An early example of the use of computers to learn from and mimick the styles of other composers is David Cope's Experiments in Musical Intelligence.
Genetic algorithms and more recently large language models have also been used to create symbolic, as well as direct digital audio, music with computers.