Translate

Showing posts with label 510. THE HUMAN-INSTRUMENT INTERACTIVE CONTRAPUNCTAL ALGORITHM THAT PRODUCES ALL POSSIBLE CHORD-HARMONIZATIONS OF A MELODY.. Show all posts
Showing posts with label 510. THE HUMAN-INSTRUMENT INTERACTIVE CONTRAPUNCTAL ALGORITHM THAT PRODUCES ALL POSSIBLE CHORD-HARMONIZATIONS OF A MELODY.. Show all posts

Thursday, November 19, 2026

510. THE HUMAN-INSTRUMENT INTERACTIVE CONTRAPUNCTAL ALGORITHM THAT PRODUCES ALL POSSIBLE CHORD-HARMONIZATIONS OF A MELODY.

The algorithm is half combinatorial (mechanical deterministic) on the notes and half human-preference-based (non-mechanical deterministic), with rules that their variation allows chord harmonizations that range from minimalist to maximalistic results on the number of chords. 

It is called contrapunctal, because it is highly relevant to counterpoint music: Given a melody, when applying counterpoint to create 3 voices, we have automatically also created a chord progression that accompanies the melody. Conversely, given a melody, if we harmonize it with an accompanying chord progression, we automatically have also created in a minimal way a counterpoint of 3 voices. In addition, when we compose a chord progression, automatically we have composed a basic form (1st species) of counterpoint . 

The mechanically deterministic part of the algorithm, is based on the mathematical theorem that any note of a diatonic scale belongs to three (3 or 4 notes) chords of the diatonic scale, one that has it as the root, one that has it as a middle note and one tha thas it as an upper end note. If we do not know which is the diatonic scale, and we may only assume that we are in the universe of the 12 notes (maximal or full chromatic scale of 12 notes), then this theorem is different. It says that each note belongs to 6 chords. Two chords have it as their root (one major or minor), two have it as their middle note (one major, one minor), and two that have it as their upper-end note. We assume, of course, the chords in normal position of voicing, and we include only major or minor chords. 

STEP 1: We may start with all the notes of the melody x1,x2,...xn, or start with only the notes y1,y2,...,yn  that have not very short duration and could be called the simplicial submelody of the melody. Of course this is easier if we have the melody written in a pentagram or in piano roll. 

STEP 2: At first we listen to the melody or its simplicial submelody ,  to get a musical feeling. Then we proceed as follows: we try the 3 (or 6)  chords that y1 belongs , and by our feeling we chose one Ch1. Some of the candidate chords are major, and some are minor. We follow our feeling. There is a standard restriction of this algorithm that among the 6 chords  c1,c2,c3 that contain the note y1, we prefer the 2 chord that has y1 as their middle note (neither tonal, neither the dominant). We prefer the middle note because it characterizes minors and majors, so it is a characteristic note.  But of course this must be compatible with the rule of the least number of new chords compared to the already used, which in general has priority. E.g. if we already chose E minor for the note g, at a later step, at a note e, we should prefer the Em as it is an old chord rather than C major, which has e as its middle. . 

STEP 3 We repeat it for note y2. If we find a chord that is the Ch1, or a previously used chord for the note y2 we prefer it if we seek a minimal chord progression. But if we are seeking for a maximally different chords , in the chord progression, we chose a chord Ch2, not used before for the note y2. The difference of repeating previously used chords for the same note or using new chords or mixing both gives  all the spectrum between the minimal number (usually 3 chords) and maximal number (7 chords) for the diatonic melody. 

STEP 4 : After finishing all the notes y1,...,yn, and the finding-composing of the chord progression Ch1,....Chn, we try it for the melody, and usually we may omit some chords, so that , finally not all notes ofthe melody x1,x2,...xn are inside the underlying chords (passing notes). The passing notes usually should not be more than 50% of the total duration. (Still in Bach's counterpoint, the passing notes that are in dissonance with teh underlying chords may be 50%-75% of the total time!) We may also alter some chords to one of the other two possible choices so that, in total, the chords are a minimal number. But this is only if we seek minimal chord progressions. If we seek maximal chord progressions, we must do the oposite. The same notes in that case are preferred to have different chords. The minimal chord progressions will usually be 1 or 2 chords, the intermediate 4-5, and the maximal chord progressions will by 7 chords.