Max
has been around for 20 years.
Max gives you the parts to create unique sounds, stunning visuals, and engaging interactive media. These parts are called ‘objects’ – visual boxes that contain tiny programs to do something specific. Each object does something different. Some make noises, some make video effects, others just do simple calculations or make decisions. In Max you add objects to a visual canvas and connect them together with patchcords. You can use as many as you like. By combining objects, you create interactive and unique software without ever writing any code (you can do that too if you really want to).
Are you aware that algorithmic composition is something that has been going on forstarted centuries ago, well before computers existedin one form or another? In recent years, andalgorithmic composition has received a lot of academic study?.
There is a Wikipedia article on Algorithmic Composition. The article itself provides a cursory overview of this field. It doesn't have a lot of practical information but it has a bibliography that you could use to look for more information.
The Wikipedia article also provides a long list of commercial and open-source music software apps for algorithmic composition. It would be worth your while to try some of those and see what you can learn from them. Some of them are for creating avant-garde experimental music, and some of them, like Band in a Box, are for composing recognizable mainstream jazz. There is a modular toolkit for algorithmic composition with a graphical user interface called Max which is in use all over the world, particularly in academic circles.
As an interesting aside, Wolfgang Amadeus Mozart published an algorithmic music system in 1787, called the Musical Dice Game. It involved arranging musical phrases (composed by Mozart himself) in different combinations according to the roll of dice and a set of rules. This comes under the category of what is referred to as stochastic composition. You can Google "Mozart musical dice game" for more references. Here is one reference worth reading.
Other topics to look into from the pre-computer era would be aleatoric composition (championed by the 20th-century composer John Cage) and 12-tone serial composition (championed by 20th-century composer Arnold Schoenberg and explored by many other composers since then). Many pieces (most of them extremely dissonant and atonal) by these composers are now in the standard repertoire of 20th-century classical music.