Harmony and counterpoint

Modulations and surroundings

41 replies 5,405 views

Started by

Bianca

Member

Member

Opening post by Bianca

Posts
510
City
Torino

I am trying in my spare time to develop an algorithm for the creation of modulating sequences, i.e., to identify, given a starting key and an arrival key, one or more successions of chords that respect certain criteria. Regardless of the usefulness of the thing, does anyone happen to know if similar ones already exist, so at least I avoid wasting time? I did a brief search but didn't find much.
If this is of interest, and if it obviously works, I will be happy to share the results. Any contribution and suggestion will be welcome.

For now, a very rough version, for modulation from C to E (in fact, the idea came to me starting from this post http://www.pianoconcerto.it/forum/index.php?/topic/3600-modulazione-al-terzo-grado-maggiore/), produces the following results for me (I use English notation for convenience, because the notes are indicated by a single character):

>Starting and arrival key [q to exit the program]:

>Cmaj Emaj

>Enter maximum modulation length :

>10

> Enter cadence type: ['a' V, 'b' IV-V, 'c' V-IV, 'e' II-VII', 'f' VI-VII, 'g' III-VI, 'h' III-IV, 'd' default]

>a

>search time elapsed: 2 - Sequences found 1

>Cmaj Gmaj Dmaj Amaj Emaj

>Starting and arrival key [q to exit the program]:

>Cmaj Emaj

>Enter maximum modulation length :

>10

> Enter cadence type: ['a' V, 'b' IV-V, 'c' V-IV, 'e' II-VII', 'f' VI-VII, 'g' III-VI, 'h' III-IV, 'd' default]

>b

>search time elapsed: 1 - Sequences found 2

>Cmaj Gmaj Dmaj Amaj Emaj

>Cmaj Fmaj A#maj D#maj G#maj C#maj F#maj Bmaj Emaj

>Starting and arrival key [q to exit the program]:

>Cmaj Emaj

>Enter maximum modulation length :

>10

> Enter cadence type: ['a' V, 'b' IV-V, 'c' V-IV, 'e' II-VII', 'f' VI-VII, 'g' III-VI, 'h' III-IV, 'd' default]

>d

>search time elapsed: 8 - Sequences found 5

>Cmaj Gmaj Dmaj Amaj Emaj

>Cmaj Fmaj A#maj D#maj G#maj C#maj F#maj Bmaj Emaj

>Cmaj Dmin Amin Emin Bmin F#min C#min G#min D#min Bmaj Emaj

>Cmaj Emin Bmin F#min C#min G#min D#min A#min F#maj Bmaj Emaj

>Cmaj Amin Emin Bmin F#min C#min G#min D#min F#maj Bmaj Emaj

>Starting and arrival key [q to exit the program]:

>Enter cadence type: ['a' V, 'b' IV-V, 'c' V-IV, 'e' II-VII', 'f' VI-VII, 'g' III-VI, 'h' III-IV, 'd' default]

>f

>search time elapsed: 1 - Sequences found 1

>Cmaj Amin Gmaj Emin Dmaj Bmin Amaj F#min Emaj

>Starting and arrival key [q to exit the program]:

>q

Moderator

Reply 2 by Frank

Posts
3,838
City
-

For now I have no news (I will inform myself), but with open music it doesn't take you long to create an algorithm.

Member

Reply 3 by Bianca

Posts
510
City
Torino
Frank wrote:

For now I have no news (I will find out), but with open music it doesn't take long to create an algorithm.

Thank you Frank. The problem is not so much the language used to implement the algorithm (OM is perfectly fine, but so is any other language), as much as establishing the logic with which it must function.

For now, what I have done seems to work quite well within its scope. It is only necessary to limit the possible results; otherwise, you have to wait too long. What I sent above is a listing of the program execution. It works with all keys.

Moderator

Reply 4 by Frank

Posts
3,838
City
-

From my point of view, an algorithm would strip tonality of its most interesting characteristic: unpredictability… in the sense that it is the deviation from the rule (which for the algorithm is the rule) that makes the difference.

It's just that the principle of complete randomness of sequences cannot be introduced into a tonal discourse, so deviations must also have an artistic sense… so …if the purpose of the algorithm were to propose "type" paths (always the same regardless of transposition) given a starting point and an ending point, then it makes sense, but then I didn't understand the "establishing the logic with which it must function"... practically, it would involve applying the "rules" of tonality (accepting the limitations I previously described).

Another point that I didn't quite understand is the one relating to "limiting the possible results otherwise you have to wait too long”... in the meantime, what are you waiting for, the sound result?

Member

Reply 5 by Bianca

Posts
510
City
Torino

of course, I completely agree, in fact I would never use one of those results as they are. On the other hand, when I write music myself, I never think about doing, for example, a modulation or a cadence, following tonal rules to the millimeter. However, I don't see it as a "derogation from the rule" (but that is another matter). On the other hand, even if we want to see it that way, derogations would only exist as such because rules exist, and there is no escaping that.

Regarding the algorithm, this does not propose random paths at all, but is rather a didactic path. The goal is precisely to propose "typical" paths, and the basic logic for now is simply an extension of the methods of modulation to common chords (which I assume is well known). The idea came to me, as I was saying, from the post that asked how to modulate to the major third degree. The very fact that questions of this type can be posed answers itself to the perplexity you raise. One generally does not reach the major third degree using modulation via common chords (because it is not quite immediate). Generally, this method is used for the V or IV degree, which have 4 common chords with the I. To get to the III major, one has to take a few "detours." From there (due to professional bias), I said to myself, well, let's make a nice graph and see how we get there.

That's that. I searched a bit online and realized that there are plenty of similar requests. I believe these types of problems are very frequent in popular music, where progressions and modulations are quite standardized, but at the end of the day, even at a purely theoretical level, it never hurts to deepen one's awareness.

I forgot to answer your last question. The sound result has nothing to do with it. The possible sequences of the described genre can also be very numerous and perhaps differ by only one chord out of fifty, so it is good to instruct the procedure to select significant results (which, as usual, is one of the most complex parts of this type of algorithm).

Member

Reply 6 by micamahler

Posts
428
City
Val Maira

I don't know if it's in here, but take a look at

http://www.bachproject.net/

However, your question (if I understood it correctly) seems to contradict itself in a certain sense: you want something logical but at the same time something that stands out? But logic does not determine what is meaningful "to you"; it determines what is possible to do according to a certain path. If you then find one result better than another, it is your opinion, not logic...

As far as the time the program takes goes, perhaps there is a simpler way to do it? In all cases following C, for example, I would do them as C + x; maybe you'll save something

http://www.bachproject.net/

Moderator

Reply 7 by Frank

Posts
3,838
City
-
Bianca wrote:

However, I do not see it as an "exception to the rule" (but that is another matter). On the other hand, even if we want to see it that way, exceptions would only exist as such because rules exist, and there is no escaping this.

See it however you want, I meant that you can only insert what is classified. Even hypothetical chords could hardly be contemplated (or rather, at what cost? And with what benefits?), not to mention modern tonality, more expanded where the strictly tonal context is very "aleatory"... so beginning and end are what there is in between, which is a world (also in terms of the number of superimposed thirds and relative part-writing).

This obviously does not invalidate your intentions, but it can be limited to the classified and not to the classifiable.

That being said, I may agree with MicaMahler on do+x, but I would approach the subject in a completely different way from the issue (in general); it would be very long to explain via post. All the more so because the program to do this I already did when I was little to improvise the classic harmonic progression... obviously, with the means of that time. We can talk about it with due calmness, perhaps I will prepare some patches to share

Member

Reply 8 by Bianca

Posts
510
City
Torino
micamahler wrote:

Non ho capito bene a quale domanda ti riferisci, comunque io non voglio qualcosa di logico che si contraddistingua (a parte il fatto che di questi tempi fare qualcosa di logico è già un modo di contraddistinguersi ). Ho solo scritto un metodo che "risolve" le modulazioni da una chiave ad un altra usando il metodo degli accordi comuni. Per un umano non è nulla di trascendentale (a parte chiavi distanti), il difficile è farlo fare ad un algoritmo

Il programma allo stato attuale ci mette qualche millisecondo.

Ps: forse ho capito ... significativo per esempio intendo che non mi tiri fuori una modulazione di 125 accordi, oppure che usi solo cadenze di tipo comune (che so, I-IV-V, ecc..) come si può vedere dalle opzioni di scelta che fornisce il listato...

Grazie, sembra interessante, devo guardarlo con calma.

>

Però la tua domanda ( se l'ho capita bene) in un certo senso sembra contraddirsi: tu vuoi qualcosa di logico ma al contempo che si contraddistingua? Ma la logica non determina ciò che per "te" è significativo, determina ciò che è possibile fare secondo un certo percorso. Se poi tu trovi un risultato migliore di un altro, è una tua opinione, non è logica...

Per quel che riguarda il tempo che ci mette il programma, forse c'è un modo più semplice per farlo? Io tutti i casi successivi a Do ad esempio li farei come DO + x, magari risparmi qualche cosa

http://www.bachproject.net/

Member

Reply 9 by micamahler

Posts
428
City
Val Maira

Exactly, so it's you who determines what is significant; you should give it a mountain of if ( and in the end it will do Bianca's cadence)

Member

Reply 10 by Bianca

Posts
510
City
Torino
Frank wrote:

See it however you want, I meant that you can only insert the classified. Even hypothetical chords would be difficult to contemplate (or rather, at what cost? And with what benefits?), without considering modern tonality, more expanded where the strictly tonal context is very "aleatory"... so beginning and end are what there is, and in between is a world (also in terms of the number of superimposed thirds and relative part-writing).

This obviously does not invalidate your intentions, but it can be limited to the classified and not to the classifiable.

That being said, I can agree with MicaMahler on do+x, but I would approach the subject in a completely different way from the issue (in general); it would be very long to explain via post. All the more so because the program to do this I already did when I was little to improvise the classic harmonic progression... obviously, with the means of that time. We can talk about it with due calmness, maybe I'll prepare some patches to share.

Ok! That is exactly what interests me!

To clarify that this stuff isn't a composer or an improviser.

My question was precisely whether anyone is aware of algorithms like that

Member

Reply 11 by Bianca

Posts
510
City
Torino
micamahler wrote:

Exactly, so it's you who determines what is significant; you should give it a mountain of if ( and in the end it will do Bianca's cadence )

I don't ask for much

the cadences I have planned so far are:

I V

I vi ii V

I IV

I vi IV V

I vi

I vi ii vii

I vi IV vii

I IV V

I ii V

I vi V

On the other hand, cadences can also be represented on a graph...

Moderator

Reply 12 by Frank

Posts
3,838
City
-
Bianca wrote:

My question was exactly whether anyone is aware of algorithms like this

Anyone who improvises uses it (even if they don't know it)... the fact is that you want to "digitize" this algorithm, for which a short path is to have you describe (or better, learn) the logical processes that allow such a process.

If we think only of harmony strictly speaking, it is about sets of starting and ending points with more or less articulated and varied paths. Clearly, the complete process must also contemplate melody and meter, but those are complications for the purposes of your exercise.

Member

Reply 13 by geppino12575

Posts
282
City
Nola

There are modulation "algorithms"; I should see about retrieving the notes my teacher gave me back then; all modulation possibilities were provided, grouped by algorithm, for example: with the procedure known as chromatic contrary motion, one can modulate to the upper semitone, the lower semitone, and the tritone; with the enharmonic equivalent of the diminished seventh, one can modulate practically to all keys; with the enharmonic equivalent of the dominant seventh, one can modulate to I don't know what......etc.. etc...I don't know if this is what was needed....if this is it, maybe I could explicate some of these algorithms.

Member

Reply 14 by Bianca

Posts
510
City
Torino
Frank wrote:

Anyone who improvises uses it (even if they don't know it)... the fact is that you want to "digitize" this algorithm, for which a short path would be having it describe (or better yet, learn) the logical processes that allow such a process.

If we think only of harmony step by step, it is a matter of starting and ending points with more or less articulated and varied paths. Clearly, the complete process must also contemplate melody and meter, but these are complications for the purposes of your exercise.

exactly!

having written the algorithm (at least in part) I had to precisely encode / generalize a series of processes that are usually studied in another way. This is what I meant before when I spoke about a didactic path. I understand that in a conservatory perhaps one cannot teach graph theory, recursive functions, or refutation trees in depth, but a taste of them wouldn't hurt either...

Member

Reply 15 by Bianca

Posts
510
City
Torino
geppino12575 wrote:

There exist modulation "algorithms"; I should see about retrieving the notes my teacher gave me back then; all modulation possibilities were provided, grouped by algorithm, for example: with the procedure known as chromatic contrary motion, one can modulate to the upper semitone, the lower semitone, and the tritone; with the enharmonic equivalent of the diminished seventh, one can modulate practically to all keys; with the enharmonic equivalent of the dominant seventh, one can modulate to, I don't know, whatever... etc.. etc... I don't know if this is what was needed....if this is it, maybe I could explicate some of these algorithms.

thanks geppino, it would be very useful for me to also compare with what I have done and integrate.

Moderator

Reply 17 by Frank

Posts
3,838
City
-
Bianca wrote:

I understand that in a conservatory perhaps one cannot teach graph theory, recursive functions, or refutation trees in depth, but a taste of them wouldn't hurt anyway...

And indeed, even from the three-year programs, mandatory courses on Open Music are already provided. In general, I would say that 55-hour courses are a bit more than just a taste. More than anything, the objectives are different; the part that interests you is generally included in subjects of an improvisational nature—to be clear, I also have various schemes and notes that are not very different (I think) from Geppino's. Generally, algorithmic composition courses delve into slightly more demanding functions that go beyond processing that is already possible extemporaneously (without taking anything away from this noble art).

Member

Reply 18 by Bianca

Posts
510
City
Torino
geppino12575 wrote:

http://quinteparallele.altervista.org/Quinte_Parallele/Appunti_files/modulazioni.pdf

I found this, I haven't read it in its entirety and it seems to me that it doesn't cover all the possibilities, but it is a good starting point....

thanks geppino, but what seems to be missing to me is precisely some mention of the algorithms necessary to generalize the basic theory. If you find something anyway, let me know.

http://quinteparallele.altervista.org/Quinte_Parallele/Appunti_files/modulazioni.pdf

Member

Reply 19 by Bianca

Posts
510
City
Torino
Frank wrote:

And indeed, as early as the three-year programs, mandatory courses on Open Music are already provided. In general, I would say that 55-hour courses are a bit more than just a taste. More than anything, the objectives are different; the part that interests you is generally included in subjects of an improvisational nature—to be clear, I also have various schemes and notes that are not very different (I think) from Geppino's. Generally, algorithmic composition courses delve into slightly more demanding functions that go beyond processing that is already possible extemporaneously (without taking anything away from this noble art).

effectively, for me, improvisation has always had a great fascination...

Member

Reply 20 by geppino12575

Posts
282
City
Nola

I didn't understand what is meant by "algorithm".... perhaps it is better to give some examples. Let's take Bianca's initial example: modulating from C major to E major.

One of the chord sequences (or techniques or "algorithms" if you will...) to connect these two distant keys is the enharmonic change of the dominant seventh.

1) Start from C major

2) transform the chord on the I degree into a dominant chord (C E G Bb)

3) enharmonically change the seventh so that it becomes an altered sixth (C E G A#). The moment the enharmonic change occurs, we have already moved to the new key; from now on, we will reason in E.

4) the VI alt chord resolves to the V degree harmonized with 4,6 (i.e., II rev) (B D# F# B), note the A# resolving to B

5) V degree in 3,5 (B D# F#), eventually with the seventh

6) resolution to the E major chord (I degree of the new key).

This is the algorithm, understood as a process for solving a specific question; now, to generalize, we can say that with this technique of the enharmonic change of the dominant seventh, one can modulate to keys that are a major third, a major sixth, a semitone lower, and some other keys away (I don't remember all the possibilities precisely right now).

What more is there to know...?

Log in to participate