Musical composition - engine

The musical engine - the core of the composition program - consists of several classes. These will be described in the following paragraphs.

The method of composing

Music originates in abstract systems (combinatorial systems of harmony, rhythm and melody) based on compositional rules and user-defined parameters of composition. The resulting music is derived by optimization, ie for a given parameter value there is usually only one single composition. (Random process is used only rarely - eg to automatically generate parameters - to replace user activity.

The resulting music is polyphonic with a harmonious subtext - the pre-created harmonic plan is covered by melodic lines, the rhythm of the individual lines and the subtext are generally independent (eg a monody, ie a melody with a harmonious accompaniment, arises with the same rhythm definition of several melodies, etc.). The compositions are created in a regular (tempered) 12-tone system, the aim is to enable refinement in the future for multitone microtonal systems.

Requirements

Music in a musical machine is based on so-called requirements. Each requirement includes an exact list and weights composition rules and enumeration, values and weights of parameters.

The requirements are of two types: a/ formal - independent of the octave position of the tones (eg harmonic coverage rule) b/ real - depends on octave position of tones (eg rule of dissonant encounters)

Compositional rules

In the future, it is possible to consider other rules - for example, the following 4 rules were originally considered, we couldn't define them to improve the sound...

Generally, it is possible to consider the (user) possibility to change the rule weights (eg in chess programs it is possible to set whether the computer should play more strategically or offensive, etc.) But it is practically easier to design only a few basic types, from which the user chooses - for example, see MusicalRulesType (StandardMusicalRules, SimpleHarmonicRules, MusicalImpulseRules). The rule weights have been estimated for each variant and then adjusted afterwards when they led to obvious mistakes in the resulting composition.

Evaluation of requirements

Before the processing of each line to the prepared requirements (with compositional rules) complete the requirements (formal and real) for the course of the melody.

The set of tones from which it is selected always corresponds to a certain modality (HarmonicModality). The first thing is to find out the modality that controls the place (tact). Here it is possible to proceed in several ways - types of "modification" HarmonicModalizationType (Consecutive, Forced, Chromatic).

Subsequent (consecutive) modification is always based on harmonic structures that appear in a given bar (measure) or immediately before it. The forced modalization is based on the given modality, which is forced into the composition or its part, ie, for example, we can imagine a folk song performed in several different modalities (tones). Chromatic modification makes no limitations and thus leads to more complex music that is difficult to listen to.

Musical engine

Composing procedure

By definition, requirements (formal and real) containing the compositional rules are prepared.

Bars (MusicalBar) are prepared for a given music block (or its specific area). The harmony of the bars is taken over by the harmonic motifs identified in the musical changes of the harmonic line. Specified harmonic motifs come in bars in which harmonic musical changes have been defined.

When the bars (with harmony) are prepared, then program gradually go through them. For each measure, the states of the melodic and rhythmic lines determined by the defined changes are loaded or updated.

Depending on the rhythm requirements, each line in the bar (measure) is provided with a rhythm (the lines that do not sound in the bar are filled with a rest over the bar). When the rhythm is ready, harmonic clusters (HarmonicCluster) are created for that bar.

Melodic lines

Finally, the pitch and loudness are determined for each tone of each melody line. Melodic lines are created in the order of priority (ProgressPriority). Before the processing of each line to the prepared requirements (with compositional rules) complete the requirements (formal and real) for the course of the melody.

Generation is done by bars, first of all melodic lines and finally, harmonious lines are added. Harmonic minor voices usually follow the shortest possible path.

Finally, the pitch and loudness are determined for each tone of each melody line.

The music machine scans each tone sequentially - at each moment it is evaluated which tone best meets the requirements of compositional rules.

The option corresponding to the highest sum value is always chosen - ie where it is not possible to comply with all the rules, it is a certain compromise (the least evil). The rule weights are set in the definition of the music engine.

Tracing

Sometimes it is necessary to check what values the engine has chosen for certain tones. This is done by “tracing” - ie listing individual variants with characteristic values (quantified rules,…) - see TonePacket, DetailToneTracer, …

Harmonic bindings

We mentioned above, that harmonic minor voices usually follow the shortest possible path. This is ensured in the program by evaluating the links between the tones.. Music theory speak about so called "positive rules".

Positive rules

Positive rules (for harmonization and melodization practice) (Karel Janeček)



According distance of subsequent triads (roots of triads):