Translate

Monday, January 18, 2016

27. How a melody defines its chords? Software that is doing it. The meaning of non-uniquness of chords determination by a melody. Chords that cover a scale versus chords of a scale.


We may compare the harmonic method of musical composition, with the way that we shape sentences of meaning in our minds before we choose the exact words to speak  them. We need at first an analogy between the musical language and speaking language.

Here is a table of the analogy and correspondence of the levels of the musical language and Speaking languages



MUSICAL LANGUAGE
SPEAKING LANGUAGE
Note
Letter  of the alphabet
Interval (3 elementary melodic moves)
Syllables
Melodic moves or themes (5 basic  melodic patterns and Dolphin words as in post 101). Chords
Words that make a simple proposition (subject verb object) 


Full melody (propositions) . Chords progressions at a duration that may contain many melodic themes (Phrase).
Propositions . Phrases or sentences from a point to  a next point , that may contain many simple propositions 




We must remind here that

The emotional content of the harmony of the chord progressions is different and is not included in the emotional content of the sequence of notes of the melody. In other words the harmony is not summarizing only the emotions of the melody but is carrying and suggesting a sequence of emotions by itself. The emotions of the harmony and the emotions of the melody must of course be compatible. This is in accordance with the fact that for the same melody there more that one chord progressions that may fit to it. The best ways to compose a melody after a chord progression, or to find the chord progression of an existing melody, are ways that try to correspond almost identically the emotional patterns of the chord transitions with the emotional patterns of the melodic themes.  


See also post 75. 

If a melody is in an diatonic scale, there two  obvious and extreme ways  to define chords over it.

1) The maximal way: For every note of the chord we may define a chord within the diatonic scale with root this note or middle note of the chord (3rd) or upper note of the Chord (5th). The chord would be major, minor or diminished. As the melody moves inside the diatonic scale so does the chord too. It is a maximal way because it defines so many chords as the notes of the melody. The above is also the base of the 3-voices harmony in melodies (with 2nd and 3rd voice)
2) The minimal way. The three major chords of the diatonic scale at steps I, IV, V (e.g. for the C major scale are the major chords C, F, G) contain all the notes of the diatonic scale. So we may define as the chord of the note of the scale , the C chord if the note it is C, or E (1st two notes of the chord) , F chord  if  the note is  F, A   (1st two notes of the chord) , and G chord of the note is G, B, or D.  Even better we may take the power chords 1-5-1' at thesteps I , IV V, of the scale.
3) The intermediate ways.

Between these two extremes in 1) , 2)  there are plenty many other choices with an intermediate number of chords relative to the number of notes of the melody.  Especially if the melody (which is the most common case)  does not have its notes within a single diatonic scale.

GENERAL WAY TO FIND THE CHORDS OF A MELODY

1ST FREE WAY:

THE MAIN IDEA IS TO FIND A CHORD PROGRESSION THAT FITS TO THE MELODY. AND A PIECE OF MELODY FITS TO A CHORD IF AND ONLY IF THE PERCENTAGE OF (CHROMATIC) INTERVALS OF 2NDS SHAPED BY EACH NOTE OF THE MELODY WITH NOTES OF THE CHORDS ARE LESS COMPARED TO INTERVALS OF 3RD 4TH OR 5TH. OBVIOUSLY CHORD PROGRESSIONS FROM POWER CHORDS (P5) ARE THE EASIEST TO FIND THAT FIT A MELODY. (SEE ALSO POST 151 ABOUT EXTERNAL HARMONY OF  CHORD)


2ND MORE RESTRICTIVE WAY:
If the notes as notes of the melodic theme (a piece of the melody that we have not yet found its underlying chord yet) in total do not sound less time  (preferably >2/3 of the total time) compared to the total duration of the notes of the melodic theme that do not belong to the chord then we accept this chord as underlying chord. We may have also a slightly different and less strict rule:  If we divide all notes of this piece of melody to equal smaller duration  notes, and make a statistical histogram of the re-occurrence of their  pitch , then the triad of notes of maximum duration compared to the duration of any other  triad should correspond to the 3 notes of the underlying  chordObviously there is no requirement in the second version of the rule that the notes of this triad in total sound more than the total duration of all other notes that do not belong to the chord. Only that they sound more than any other triad.  A third variation of the previous rules involves also not only the time duration but the loudness of he notes in the obvious way. The previous rules , in particular the first one,  of course may determine more than one chord as underlying chord  or no chord at all! And we may chose with criteria of better quality chord progressions relative to the alternatives. Or if one particular chord progression and chord transition is more common in the particular style of music. We may also put a requirement of lest possible  number of underlying chords, which means that if for the previous melodic theme and previous chord, is so that its notes as notes of the melodic theme both current and previous  in total do not sound less (preferably >2/3 of the total time) compared to the total duration of the notes of the two melodic themes that do not belong to the previous chord then we extend the duration of the previous chord to the current melodic theme.


THE 3RD WAY: TWEAK THE 3 NEIGHBORING CHORDS 

This is similar with the stepwise glissando in harp , in panflute , in violin etc to find a note when improvising a  melody. Only that here we use a  stepwise glissando of chords. And there are 3  ways to do so, the chromatic, the melodic and the harmonic. In other words we apply a stepwise glissando on the roots of the chord and move them chromatically by steps of intervals of 2nd, or melodically by steps of intervals of 3rds or harmonically by steps of intervals 4ths  (or 5th). The most usual method is the harmonic method: we move the chords in sequence as in an arc of the wheel by 4ths. Once we find the closest chord we tweak to minor or major (sometimes diminished or augmented too) to find exactly the right chord. On this it helps much to perceive the universe of 12 notes as chromatica tonality as in post 263.



The pitch translation homomorphism between melodic themes and underlying chords.

When the melody is composed from little pieces called melodic themes M1, M2, M3 etc and each one of them or a small number of them (e.g. M1, M2)  , have the same underlying chord C1, then we have a particular simple and interesting relation between the chords C1, C2 , C3 and the melodic themes (M1, M2), (M3, M4) ,...etc. This relation is based on the pitch translations of the melodic themes and of the chords. Actually this is also a scheme of composition of melodies based on small melodic themes (see post 9), when the chord progression is given or pre-determined.

So let us say that the melodic themes (M1, M2), have underlying chord C1. Then as we have said there are only 3 possible chord-transition relations in a chord progression (see post 30 ): C2 will be either in resolution relation with C1 which means that the rood of C2 is a 4th lower or higher relative to the root of C1, or the root of C2 is an interval of  3rd  away from the root of C1 , or and interval  of 2nd away from the root of C1. Let us symbolize by tr4(), tr3(), tr2() , where tr() is from the word translation, of these three pitch shifts. Then we may also translate the melodic themes similarly
tr4(M1), tr4(M2), or tr3(M1), tr3(M2), or tr2(M1), tr2(M2), Then automatically the new translated melodic themes will have as appropriate underlying chord the C2. Actually in the case of intervals of 3rd or 5th, the melodic themes tr3(M1), tr3(M2)  or tr5(M1), tr5(M2) may as well as appropriate underlying chord the C1 again as the 3rd and 5th of the chord is a pitch translation that leads to a note again inside the chord. This is the reason we called this relation homomorphism and not isomorphic. In mathematics , and correspondence H is call homomorphism relative to some relations R, if the the objects H(x1), H(x2) are in relation R , if the objects x1, x2 are in relation R. Here H(M1)=C1 and H(tr(M2))=C2 and C2=trn(C1) that is are in distance of interval of n (=2,3,4 etc) if tr(M1) and M1 are in distance of interval of n. It may happen that H(x1)=H(x2). But if when x1 is different from x2 then always also H(x1) is different from H(x2) we say that H is an isomorphism. Here because it may happen that H(M1)=C1, and H(tr(M1))=C1 again the correspondence of melodic themes and chord is not 1-1, that is H is an homomorphism not an isomorphism in general. 
By continuing in this way translating in pitch the initial melodic themes M1, M2 according to the interval shifts of the roots of the chord progression an remaining inside a diatonic scale , we compose a melody (or simplicial sub-melody too, see post 9). Of course in order for the melody not to be too monotonous we may vary also the melodic themes from ascending to descending etc.

Here is a video of jazz improvisation which uses this idea. The chord progression id C, F, G, and the of pitch translations of the initial melodic themes are always intervals of 4th or 5th.  



The previous video in jazz improvisation music shows that in fact any of the 12 notes of the chromatic scale and not only the 3 or 4 notes of the chord can be chosen as the note of the simplicial sub-melody during a chord! And conversely that a melody may not have at any common note with the underlying chords while it sounds! 









1) The complementary chords in a 2-chords transition corresponds to the chromatic/diatonic melodic speed or density. 
2) The relative chords in a 2-chords transition corresponds to the middle harmonic melodic speed or density. 

3) The successive resolutional  chords in a 2-chords transition corresponds to the high harmonic melodic speed or density. 



By restricting the playing of the guitar on the 4 higher strings,or playing corresponding isosmorphically tuned to these 4-strings of the guitar instruments (like ukulele, Greek buzuki, etc) I discovered the remarkably simple DAE system, (see post 3) which handles all the major and minor chords as having only one of the 3-shapes of D (like open D major) A (like open A major) and E (like open E major). 

Approximately the 3 shapes have the next distribution on the fretboard


D4

E4
F4

G4

A4

B4
C5

D5
A3

B3
C4

D4

E4
F4

G4

A4
E3
F3

G3

A3

B3
C4

D4

E4

This distribution of the chord suggest also a way to play simultaneously melodies with chords: We play the melody on the strings D,G,B,E (higher 4)  and then at each note we try the roots maximal chordification (each note of the melody as root of a chord minor or major or dim7 or augmented  according to what that fits  in the scale), and then we simplify the chordification to less chords with rules that successive chords in resolution relation are better than in relative relation which in its turn is better than the complementary relation, so as to result in to a stable simple harmonic background. It is always also better to use chords on the fretboard that contain the note of the melody in the exact octave it is. So this defines that we do not play only open chords but chords distributed on the fretboard as in the above table. 




We remind here that except the melody itself we may have   HIGHER ORDER SIMPLICIAL SUBMELODIES. In other words except the 1st simplification of the melody, which is the 1st order simplicial submelody, we may have the 2nd order simplicial submelody, the 3rd order simplicial submelody, each one simpler that its previous. A path of grids from the complexity to simplicity. One of them should correspond of course to the complexity of the chord-progression, that is have one note for each chord of the chord progression. E.g. the starting ending notes of the meloduc themes may be a simplicial submelody while the centers of the melody a higher order simplicial submelody.

In a similar way, e may have 1ST AND HIGHER ORDER SIMPLICIAL CHORD SUB-PROGRESSIONS  to the chord progression of a melody. Each one simpler chord progression than its previous.

There mainly two correlations of a piece of a melody with a chord a) The local condition. This is the next: If we divide all notes of this piece of melody to equal smaller duration  notes, and make a statistical histogram of the re-occurrence of their  pitch , then the top 3 peaks of the histogram should correspond to the 3 notes of the chord. b) The global condition. This is the next: The local condition is overruled according to a quantitative weight of significance, if the previous chord defines with maximum transition probabilities (among a great sample of popular chord progressions)  a different chord (e.g. G7 resolves to C rather than Am or Em)

For the correlation of melodies with chords that fit to them, or conversely , melodies that can be improvised over a chord progression the next local concept is very significant: The melodic closure of a chord: This is defined as the closed interval of notes from all the 12-tone (chromatic) scale) with lower end the lowest note of the chord, and highest end the highest note of the chord. The chord is assumed within an octave, and normal positions, 1st inversion, and 2nd inversion have different closures, but e.g. the C major and C minor have the same closure, nevertheless the do not belong both to the same diatonic scale.   It holds the next interesting theorem. If we define randomly a melody within a the closure of a chord  in normal position  and no other note outside it, with uniform probability of occurrence of any of the notes of the closure, then according to the local condition above the only chord  in normal position  from the chords of the diatonic scale that would fit this melody is the one with this closure!.Or more generally of we  define  as probabilities of sounding a note on all the octave an equal value for all notes    except at the notes of the chord X where we have as probability the double this value (e.g. sound each note of the octave once but the notes of the chord twice) then any such random melody with this probability structure will have as its fitting underlying chord the chord X. 

See also the concept of Courtyard scale of a  chord in post 93

The next software, derives the chords, (one chord per measure or number of consecutive measures) by finding the notes of the melody within this (or these) measure(s) that spend more time as notes of the  chord. This is the vertical method. In addition it has stored transition profanities of chords from a data base of songs, and the final chosen chord is the one with the highest statistical frequency. This is the horizontal method. With a user defined weight among the vertical and horizontal method a final chord is chosen. The links below contain also the scientific publications that explain the details of the algorithm. 

http://research.microsoft.com/en-us/um/redmond/projects/songsmith/


http://research.microsoft.com/en-us/um/people/dan/mysong/





Here is a video showing a practical way to figure out which scales are define by a chord progression. Strictly speaking there is an algorithm that could be programmed in a software program that you give the chord progression and it defines the samalest set of scales that contain these chords. 



We may define that a set C(S)  of chords covers a scale S if and only if each note x of the scale S belongs also in at least one chord c of the set C(S). For example for the diatonic C  major scale , the set  of chords G, C, F cover the scale. The same for the set of all major and minor chords with roots on any of the possible notes of the 12-tone chromatic scale.  As a contrast the chords of C major scale are the C, Dm, Em, F, G, Am Bdim. The concept of sets of chords that cover a scale S , is useful in finding chords for a melody with notes in the scale S. This may lead for example in using many more harmonically rich chords for instance for the Arabic scale Hijaz, while strictly speaking the chords of the scale Hijaz may not be harmonically rich. 

In a similar way we may define a set D(S) of 2 or more diatonic scales that cover an exotic scale S. This means that a  note of the exotic scale S  is also a note of at least one of the diatonic scales of D(S). Thus the chords of the diatonic scales of D(S) also cover the exotic scale S. In this way although the chords of the exotic scale S may be weird we can still play, a melody in the scale S, backed with classical chords those of the diatonic scales of D(S). This is not unusual in folk music.

A very useful remark for improvisation of melody within a particular chord is the next.

Suppose we are at a note y1 of the melody which fits the underlying chord with notes x1x2x3 (whatever that may mean), then depending on the particular position of y1 relative to the x1x2x3, a shift by an interval of 3rd, 4th, 5th, and 6th wil lead to a note y2 that will again fit the chord!. This is because the relative positions of the notes x1x2x3 of the chord are intervals of major, minor 3rd and pure 5th, and their complementary intervals relative to the octave are minor or major 6th, and pure 4th 


Summarizing in  simplistic way the correspondence of melodic pitch dynamics and the 4-basic emotions in music (joy, sadness, anxiety, serenity) we have 
1) Up pitch moves correspond to joy
2) Down pitch moves to sadness
3) Small pitch intervals of 1 or 2 semitones (chromatic or interval of 2nd) correspond to anxiety

4) Large pitch intervals (e.g. 4th, 5th octave etc) correspond to harmony and serenity. 

Some instructive remarks in the composition of the melody based on the chord progression in other words in the reverse process compared to first the melody then the chords, are the next

1) In the part of the chord progression with minor chords, utilize descending melodic moves so that sadness from melody and sadness from harmony fit.Similarly ascending melodic moves for  major chords.
2) In the sad melody parts of the melody (and minor chords) utilize rhythmic patterns that start with faster notes and end with slower notes, and the reverse for the happy part (and major chords).
3) In a triad or 7 nth 4-notes chord the most characteristic notes are the middle 2nd note (in 1-3-5 interval notation  is the 3) and the 7 nth (if it exists). So for the anxiety part of the melodic moves we may utilize 1-semitone trills around these two notes, or waving with 1 or 2 semitones steps and notes outside the chord in the interval of minor 3rd (3 semitones) of the chord. Alternatively instead of trill or small amplitude waves we may utilize chromatic monotone scaling by steps of 1 semitone , or scaling with steps by intervals of 2nd of the scale,  that go from these previous notes of the chord to the same such notes in the next octave. But always make sure that the notes of the chord sound in the average longer, than the notes of these anxiety transition moves with notes outside the chord. 
4) Alternate up (happy) and down (sad) pitch moves , or chromatic moves (anxiety), with harmonic (on chord notes) moves (serenity-harmony).
5) Utilize at least 2 octaves, or even 3 for the melodic moves repeating the notes of the underlying chord on the next octaves , so there is sufficient space for melodic moves, to express with sufficiency the emotions.
6) For the duality of emotions anxiety-serenity, it may be utilized also harmonic waves or monotone scaling over 2 octaves at least,  on the notes of the chord, but also chromatic trill wave over the notes of this wave or scaling (modulated wave on wave or move) and then return to the pure harmonic wave or scaling on the notes of the chord.
7) A chromatic wave by 1-semitones steps or all notes of the scale (steps by intervals of 2nd) that goes up and down at least 2 octaves, corresponds to a chord sub-progression of the song , of our choice that utilizes almost all the chords of the scale!


DEFAULT MELODIES  FOR A CHORD PROGRESSION.
Given a  chord progression it is direct how to create a melody that fits the chords, with the following rules
1) During  each chord, the entry note of the simplicial submelody , is the middle note of the chord.
2) During  each chord, the exit note of the simplicial submelody (two notes per chord here), for major chords (including 7nth chords and extensions) is the upper note of the chord, for minor, diminished and augmented chords it is the lower note of the chord. 
3) During the chord the melody follows an harmonic theme in one or more octaves span, in other words from notes of the chords, and is walking the chord by a spike, straight scaling or waving (these are parameters for the composer or improviser to choose) from middle and down to up (joy) if the chord is major, or from middle and upper to down (sadness) if it is minor, diminished or augmented. Alternatively  any descending , ascending or waving sequence of notes at diatonic speed such that the odd or even number of them is exactly the notes of the chord (extended probably by 7nth or 6th) and these motes sound e.g. 3 times more than the notes of the rest of the scaling is a melody that fits the particular chord! Irish melodies do it often. If the chord is simply major or minor we may enhance its harmony by extending it with its upper and lower relatives thus  by an interval of 3rd at the highest note and up , or at the lowest note and lower (in normal position). In other words making it a chord with 6th and/or 7nth. 
Another characteristic of the happy and joyful melodies is to define two notes (or interval) for the simplicial sub-melody for each chord so that in over all the melody is maximally harmonic (see post 40) and we  may use almost exclusively  the maximum large intervals (within a scale) that exist in the chords of the song. And this would be intervals of 8th, 6th (for triad-chords) , 5th and 4th. In other words we use almost exclusively the maximum harmonic melodic  speed that the chords allow (see post 68). 
This idea of maximum harmonic speed in melodies is also an idea that can give pretty directly improvisation melodies over a chord progression! This is good for happy melodies. It directly defines improvisational beautiful melodies from the chord progression,  because the maximum intervals of a chord are unique or very few for each chord! In fact a single large such interval from each chord can define the melodic-rhythmic pattern for each chord! 
The standard preference is to use 
a1) For  a major chord x1-x2-x3, the 1st x1-3rd x2   notes interval of pure 5th (7 semitones), or the 1st nx1-2nd x2 notes interval of major 3rd (4 semitones)
a2) For  a minor chord x1-x2-x3the 1st x1-3rd x2   notes interval of pure 5th (7 semitones), or the 1st x1-2nd x2 notes interval of minor 3rd (3 semitones)



a3) For  a dominant 7th and major 7th chord x1-x2-x3-x4, the 1st x1-3rd x2   notes interval of pure 5th (7 semitones), or  the 1st x1-4th x4   notes interval of minor 7th (8 semitones), or of  major 7th (9 semitones). 
An interesting case of simplicial submelody is  the first choice  always  (interval of 5th or 4th). 
Or we may allow this interval of 4th or 5h of each chord sound 2/3 of the time of the chord sounding and 1/3 of the time the other middle x2 note for minor or major  , or 7th note of the 7th chords.
 Still another case is the minimal harmonic simplicial submelody (but always with notes of the chords) where we take always the 2nd choice (the x1-x2 interval of 3rd, or x1-x4 interval of 7th) where this sounds 2/3 of the time and 1/3 of the time the 3rd note of the chord. This simplicial submelody gives emphasis to the character of each chord, that is being minor , major or 7th etc. 
But another more maximal  harmonic  method is based on the next rules
b1) For each chord the simplicial submelody consists of at least two notes one entry and one exit (that may though coincide)
b2) Complementary chords (e.g. Cmajor, Dminor) can transition with intervals of 5 or 7 semitones (e.g. exit note of Cmajor is the c, and entry note of Dminor is the f).
b3) Successive chords in the cycle of 4ths or 5ths, and relative chords have common notes, this the exit note of the first chord and the entry note of the 2nd chord are identical.
b4) If the entry note of the a chord and its exit  note is an interval of minor 3rd  (3 semitones) we may add two more notes during the chord which is twice the 3rd note of the chord, but at one octave distance, and convert the minor 3rd interval to major 3rd (4 semitones) which has higher harmonic score (see post 40). E.g. G7-->C-->E7 , entry of C=g3, exit of C=e2, so we add c2, c3, and the simplicial submelody goes like this g3-c2-c3-e2, duringthe chord C. We converted the minor 3rd interval g-e, to a major 3rd c-e. 
b5) It is prefered that intervals of 1,2,3,4 semitones are converted to their complemntary of 11,10,9,8 semitones, by changing octave.
The so derived simplicial submelody singles less melody than the chord progression itself!
E.g. for the Chord progression Am->F->G7->C->G7->C->G7->C->E7->Am, the sumblicial submelody with these rules would be a3-a2a2-f2f2-g3g3-g3g3-g3g3-g3g3-g3g3-c2c3e2e2-e3e3-a3.
This simplicial submelody can be the centers of  full melody over this chord progression

4) At chord transitions x->y , the melody utilizes a dense melodic move (anxiety), with steps from 1 or 2 semitones, and within a scale (including the chromatic 12-notes scale) from the exit note of x of to the entry note of y , of the simplicial submelody.
5) As more general alternative to the above rules 1)-4) , we may define melodic moves not for each chord but for each chord-transition, and preferably for the        X7-->x+1 type of transitions (see the symbolism of post 34) e.g. E7-->Am.
Then the chord X7 has only one note x1 for simplicial submelody  the starting note of the melodic move, and the end note x2 of the melodic move is the next simlicial submelody note and one note of the chord x+1 not common with the chord X7. If the latter note x2 is not the root of x+1, it is created a tension that has to be resolved later where x2 would be the root of x+1. In between the x1 and x2, the rule is that at least 2/3 of the notes belong to the underlying chord, and this can be achieved by repeating notes of the underlying chord if necessary. The move x1->x2 may involve  each of the chords X7, x+1 , twice in two octaves each instead of once in one octave only, which may create very impressive melodic effects. This gives an even better opportunity to use in the melodic move, intervals of 8th, 4th and 5th (high harmonic speed, see post 68) , that have higher harmonic score than the other intervals (see post 40). The at most 1/3 of the total duration of the move x1->x2 ,of notes that play with underlying the 1st chord but may be outside the starting chord, might be unusually at chromatic and diatonic speed (see post 68), and sometimes might belong to the next chord or even to none of the two chords. The chromatic or diatonic speed applies usually when approaching the ending note of the melodic move.  The melodic moves x1-->x2 can be called chord-transition melodic moves and must have an element of repetition in length and rhythm. In the transitional Irish melodies that utilize 2-3 only major chords, while the melodic moves are 4-5 or 6-7 , but also in the traditional Greek music of the Aegean Islands, the starting and ending point of the melodic move is during the duration of a single chord and are notes of the chord! But still the rule 2/3 -1/3 for notes internal and external to the chord still holds, and the starting and ending notes of the melodic move may define the simplicial submelody.
6) The harmonic move   lasts longer than the transitional dense (chromatic or diatonic harmonic speed) melodic move , as the latter  takes less than 30% of the duration of x, and y.

7) From the rule of local fitness of a melody to a  chord  progression , such a default melody will fit the chord progression.



In the example below the chord progression is Am E7 Am E7 Am E7 Am E7 Am A7 Dm G7 C F E7 Am and the centers of the melody are correspondingly for each of the above chords the  E E E E E  B A B A A F G E F D A . The melody-moves consist of 10 notes ,the first 9 belong to the first chord and the last 10th to the next. All the moves are on the chord transitions of the form X->(x+1) in the symbolism of the cycle of 24 chords (see post  34). E.g. E7->Am, or Am->E7, or A7->Dm, or G7->C. An exceptions is the transition F->E7.  The notes that belong to the chord for each of these moves are 6 from the 9, that is 2/3 of the notes. They achieve it ,as we said , by repeating notes of the chord. And even in the transition F->E7 the notes hat do not belong to the chord F, while F sounds , do belong to the next chord E7 and so they prepare the ear for the next chord. The melody has all the 4 harmonic speeds (see post 68).  They start (ignoring the repeating notes) from the root A of Am and end to the root E of E7,they go back and forth, then from the root A of Am go to the dominant B of E7 and back to the root A of Am. Then they repeat. Then from the root A of Am which is also of A7, they go to the middle note F of Dm. Then from the root G of G7 to the middle E of C. Then from the root of F to the chord F to the 4th note (7th) D of E7, and close back to the root A of Am.  Starting from the root of X7 and ending in the middle (2nd note)  or dominant (3rd note) of (x+1), (e.g. starting at a of A7 and ending at f of Dm) creates a tension, which resolves at the end of the cycle of 16 moves by ending at the root of minor chord (x+1) (here at a of Am).

Here is the result.




When a melodic move is at middle (intervals of 3rd) or high (intervals of 8th, 5th, 4th)  harmonic speed , it is quite direct to derive its chords, as chords and their inversions consists of intervals of 3rd, 4th, 5th and 8th. Example of beautiful, improvisation melodies, in all harmonic speeds, but mainly  in  the middle harmonic speed is the violin improvisation of Stephan Grapelli. 
E.g. https://www.youtube.com/watch?v=EfolUmLTRzM

https://www.youtube.com/watch?v=P_lrTmLknNA

About Stephane Grapelli, the next link writes 
(.........His improvisational style was very melodic, mostly using diatonic scales based around the tonal centre. He constantly used phrases from the major blues scale, with flattened thirds and fifths. He drew on a huge stockpile of riffs and melodic motifs, which when you’ve listened to enough of his recordings become very recognisable. There are certain “trademark” techniques he used repeatedly, such as playing a series of third-position harmonics; playing runs in double-stopped fifths across two strings, and playing left-hand pizzicato across the open strings at the start or end of a phrase or section. He made frequent use of repeated triplets, and often played phrases which climbed dizzyingly to the very top of the neck, whilst always maintaining perfect intonation.
His tone, apart from when deliberately playing very softly, was bright, warm and clean. Although he would mostly swing, with great accuracy and precision, he also made very effective use of rubato, gliding lazily across the beats and the barlines...........)


(......Two events were to bring him back to prominence; the first was an appearance in 1971 on the Parkinson Show with classical violin virtuoso Yehudi Menuhin; the idea was to put together two musical opposites to see how they would make out. In fact it was a huge success with the public, and lead to a series of further appearances and six albums. The partnership is still talked about today. Among jazz musicians there is a tendency to sneer at Menuhin’s less than perfect attempt to swing (all his solos were written out and played note-for note, whilst Grappelli, of course, could relax and was completely in his element.) It has to be said that as a meeting of two styles, the territory was very much Grappelli’s, and Menhuin was surely very brave in playing completely outside his own field. The partnership gave a huge boost to Grappelli’s flagging popularity, and introduced him to a huge middle class art- loving public who may previously have had little interest in jazz, let alone jazz violin.....)

(......Stephane Grappelli’s playing style can best be described as elegant, relaxed and flowing. He produced a constant stream of perfectly executed melodic phrases, often at very high speed and with a minimum of effort. He rarely practiced, apart from when he was rehearsing with a band, and said of his performances “you play better when you’re not thinking of what you’re doing”......)

http://www.fiddlingaround.co.uk/jazz/stephane%20grappelli.html



Analysis of one of his improvisations
http://www.sokillingman.com/transcriptions/stephane-grappelli-after-youve-gone/

But even if a melodic move is at the diatonic speed for  long enough, e.g. for a whole octave, then we may derive easily an underlying chord progression by alternating two complementary chords (see post 66) , or by alternating two  chords in resolutional relation, or even by putting in some sequence all the chords of a diatonic scale (diatonic chord progression).


GENERAL REMARKS ABOUT MELODY-CHORD CORRELATION 
0) When a melody is created without reference to any chord-progression (see e.g. post 82 about INDEPENDENT MELODIES ), then an statistical profile with high percentages of intervals of 5ths, 4ths, and 3rds compared to 2nds is sufficient to make it an beautiful harmonic melody. But if there is already a chord progression, and we improvise with a melody on it, 
1) then during the time interval that a chord is sounding, we may want to have notes of the melody that include at least one note of the chord and in overall the time that notes of the melody that belong to the chord ,sound, is longer that the total time that the rest of the notes not in the chord is sounding during the chord. This is a quite strong rule. 
2) A weaker rule is simply the requirement that the notes of the melody during the sounding of the chord, contain  notes of the sounding chord, and probably that compared to their neighboring notes, the notes in the melody of the chord, sound longer during the sounding of the underlying chord.
3) If we abolish even this rule then we have an independent melody parallel to an independent chord progression, which is entirely acceptable in Jazz. In an independent melody, from the chord progression, we feel the harmony of the chord progression, but we apply statistically all , some or none of the previous rules to some or of the chords.