Ground, undergrounds and fillers

Given several ground melodies, and several other melodies (fillers), the program adds the fillers, suitably transposed, to the ground. The ground may consist of independent musical lines, each containing chords, e.g. :

One musical line, which must be present, is defined as ground; the others, if any, as underground.

The instruction:

perl   file_filein     rand_345     five_7     pass_1/8     fix    
will produce a score named  scorename  and the corresponding midi file  scorename.mid. The score name is generated from filein , which is an input file containing the ground and the fillers.

All the parameters except the first are optional. Their interpretation is as follows:

Must appear; filein is the name of the file to be processed by tondur.

The number seed is used to initialize the random numbers generator.

manynotes is too many notes for one chord. manynotes is between 5 and 8, inclussive; 5 is reasonable, as the standard harmony is in four voices. However, specifying higher values 6,7 or 8, makes the program add more fillers, resulting in richer counterpoint.

fix dissonances, if possible, using trills.

If the duration of the dissonant chord is less than  fraction,  it will be considered as consisting of passing notes, and will not change, even if  fix dissonances  is required.

The driver executes, via system from perl:

perl @ARGV > a$ID
perl @ARGV > b$ID
midi $ID
The identifier $ID is based on filein  and the random seed . The outputs name  scorename  is $ID.