Research->Music Software Development->Developing MIDI-Related Application->Developing Automated Composing System->Putting Weight By Probability
Explains the possible way of thinking when there is multiple options in programming.
When Multiple Options Allowed
Let's assume that there is music theory that allows multiple options. For example, let's think about rules as follows.
Rule
Initial sound level is 60.
From second sound onward, the sound forwards to either semitone higher, semitone lower, whole tone higher, or whole tone lower than the previous sound.
Note length is always 96.
For this case, it doesn't choose any from among only four sounds but can be weight at the probability, a specific sound is chosen easily, and it is possible to make, and to make easily not to be chosen. What probability you allocate can be decided referring to the actual tune. For example, How much actually frequency an advanced sound is is examined, and allotted under whole tone whole tone as a probability under the semitone in the semitone. A plausible expectation of actually examine it serious can be done. For instance, advancing to an upper and lower semitone thought about the following algorithms because it seemed to be fewer than advancement to upper and lower whole tone.

Algorithm - Probability of Sound Progression

1 Generate the first sound as sound level is 60 and Note length is 96.
2 The following procedure is repeated until 19 continuing sounds are generated.
3 Generates the sound that goes semitone higher than the previous sound with the probability of 20%.
Generates the sound that goes semitone lower than the previous sound with the probability of 20%.
Generates the sound that goes whole tone higher than the previous sound with the probability of 30%.
Generates the sound that goes whole tone lower than the previous sound with the probability of 30%.
Note length is 96.