music theory – increpare games https://www.increpare.com let's try something out here... Fri, 18 May 2018 22:16:47 +0000 en-US hourly 1 https://wordpress.org/?v=4.8.2 Lerdahl, part 2 https://www.increpare.com/2008/11/lerdahl-part-2/ https://www.increpare.com/2008/11/lerdahl-part-2/#comments Fri, 21 Nov 2008 02:20:23 +0000 http://www.maths.tcd.ie/~icecube/?p=835 This is a sequel to this post on Lerdahl’s GTTM.

Okay…apologies for the delay…I was busy, but also was uncretain whether I understood the material myself, that stopped me from saying more. Additional disclaimer: I’ve tried my best to pull out all the melody and counterpoint related content of the theory to leave things chordal. I’ve savaged the original theory in the process. Apologies to all affected by my act of gross violence.

Prolongation Trees

Okay, so what is a prolongation tree? They look like this:

prolongation1-1.gif

So basically it looks like a time-span reduction with three different types of vertices.

The lines represent chords, and the coloured vertices1 between them tell you roughly what the type of the progression is.

strongprolongation.gif

An aquamarine one means that there is no change between the chords represented by the two branches essentially repeats itself. This is called a strong prolongation. Given two chords that are the same repeated, the initial one is the dominant one, so aqua vertices almost always branch to the right (except sometimes in the case of up-beats and the like).

In the first diagram, we can see that chords 1 and 3 must be the same.

strongprolongationgifweakprolongati.gif

A blue vertex represents a chord progression where there’s only a little difference between the two, say a change in inversion, possibly the addition of a note to the chord2. This is called a weak prolongation.

In the diagram, we can see that chords 1 and 2 must be only slight modifications of eachother.

progression.gif

All other forms of chord progressions are just given boring old black vertex, and called progressions.

Interpreting these in terms of relaxion and tension-building, we have the following diagram

lefttoright.gif

Well-formedness and Suggested Shapes

What sort of trees are allowed?

Firstly the trees must be planar, so shapes like the following are not allowed:

notallowed.gif

Normative Prolongational Structures

Lerdahl considers the following pattern to be more or less a good ‘top level’ for trees, and calls it his prolongation basic form (with the suggested chords at the bottom):

basicform.gif

Note that this doesn’t mean that there’s a I-V-I progression in the piece necessarily, it means that at the highest level or oranisation, The piece is oriented around the sequence of chords I-V-I.

Lots of pieces he analyses have strong prolongations at the top vertex instead of weak ones: you can take your pick I guess.

Two slightly more elaborate forms he gives that might serve as useful skletons are:

normativeblah.gif

Either of these can be called the normative prolongational structure. The first has a minimal tensing-relaxing pattern, the second has a repetition of the opening)

Before I describe his two other guidelines4, I should say that the context in which I’m presenting them is the one where you are generating a prolongation tree from the top down, and trying to decide what additional branches to add.

For instance, say I’ve decided already on the prolongation tree below in back, and am trying to decide where I should attach a new branch, c.

allowable-1.gif

The green lines represent allowable attachments, the red lines ones that are simply not (because I’m trying to add branches in a hierarchical manner, I’ve already essentially decided that either b or d must dominate c).

The Balance Constraint

If you’re adding brances that are framed3 by a weak prolongation, prefer to have the same number attached to each branch.

balanceconstraint.gif

The Recursion Constraint

This is a rule advocating alternate left/right branching of progressions as opposed to repeated branchings in the same direction, though allowing for repeated branching in the same direction provided progressions alternate with prolongations.

In the following diagram, green branches are good, red are bad.

recursion.gif

Here’s an illustration from the book

bookimg.png

Interaction Principle

Say I am looking to add a branch at c to the following

interaction1.gif

and to attach it like this:

interaction2gif.gif

The recursion constraint says that if the chord I put at c is the same as the one at a then I must rearrange the tree and put in an explicit strong prolongation:

interaction3.gif

This is the only way that adding a new branch is allowed to interfere with the existing branches of the tree. Though it’s called the recursion constraint, it isn’t to be applied recursively.

I guess, if you were trying to add chords to given tree (which is the application I have in my mind here: a program generates a tree, then generates a chord sequences from that tree, then generates some music with that chord sequence), you want to avoid this happening.

Notes

It’s not necessary (or necessarily advisable) that one construct a single tree encompassing an entire piece, one could have a group of them, one for each phrase, or section. If your pieces doesn’t have harmonic changes every beat, however, a single tree could suffice for, say, a 16-bar section.

1The blue vertices should be notated with black circles, and the aquamarine ones with similarly-sized black dots, but I can’t easily draw them at the moment for some stupid reason.

2In the original a weak prolongation is used when the chord stays the same but either the melody or the bass change a note. It might be worth testing my suggestion though.

3Note the word ‘framed’, the balance constraint doesn’t say anything about branches that aren’t directly enclosed by the prolongation.

4These are not strict rules, but I think for a basic generative model it’s appropriate to enforce them strictly.


Okay, I’m tired again. Have to stop. I’ve hope given enough, and in unambiguous enough a manner, that you should at be able to generate grammatically correct prolongation trees (there’s still going to be a lot of choice/randomness involved in the generation, it’s something that should be possible to refine easily enough if you find it lacking). Filling them out shouldn’t be too hard in principle…I’ve sort of hinted at how to do it already…but this is enough for one post…


Duplicated from here. The content diverges somewhat from Lerdahl.

]]>
https://www.increpare.com/2008/11/lerdahl-part-2/feed/ 1
Lerdahl, part 1 https://www.increpare.com/2008/11/lerdahl-part-1/ https://www.increpare.com/2008/11/lerdahl-part-1/#comments Tue, 04 Nov 2008 12:22:44 +0000 http://www.maths.tcd.ie/~icecube/?p=785 (serialized from this tigsource thread)

I couldn’t find any nice stuff on-line, but I’ve been meaning to properly go through this stuff myself for a while, so I’m happy to have the excuse to learn something about it (Disclaimer: all of what I’m saying is a filtered version of what Lerdahl says in his book, both through my misunderstandings, and my understandings of what might be useful to Muku in his PG music program (This is primarily a response to a request made by him for info on this stuff, but of course I’d love if other people were to chip in and comment)).

TIME-SPAN REDUCTION

So if we have two chords, A and B, say, in progression, Lerdahl puts them into a special type of tree according to which seems to be the stronger of the two, (“a right branch signifies subordination to a previous event, a left branch to a succeeding event”).

diagram3.png

Given a sequence of chords we can iterate this procedure (which I’ll outline in more detail later), using the prominent chords we had initially as the basis for a second level of calculations. One can end up, from a progression of chords A,B,C,D,E (not notes, just letters that could be any chords!) with a tree such as the following

diagram4.png

“The most stable event in a segment is its ‘head’, and other events in the unit are elaborations of this head. Each head goes on to the next larger segment for comparison against another head, up to the level of the whole piece”

This is called a time-span reduction of the original chord sequence. You can ‘read’ it roughly in terms of tension: because A dominates B and B dominates C, we have a slight relaxation for the first three chords before D introduces us to the final chord, E. Looking it at a higher level of the tree, we could say that the whole piece is structured around the two chords A and E, around which the others are elaborations.

Each level of the tree looks at the progression on a particular time-span (in this case, B and C together would last as long as A). This photo of an example from the book might make it clear to those who can read score:

scoreshot.jpg

Actually, here’s the whole page: the original piece is at the top level, and the Three bottom lines represent ‘outlines’ of the piece at various levels of the tree:

scoreshot2001.jpg

Obvious questions the first: how do you compute which of two given chords in a pair is stronger than the other?

Brief answer (I can give a formula later): you look at the two chords, try and associate an appropriate scale to them, and see which of the two is more closely related to the tonic chord of that scale. (This is according to his model anyway: it doesn’t seem like a bad idea).

Obvious question the second: how might this be useful for generating music? Well, the tasty stuff happens not with time-span trees but rather with prolongation trees…which are like time-span trees, but they store more harmonic information…which come next…he gives a (simple!) grammar as to what tree-structures are more ‘musically reasonable’ than others. Using these rules, you could generate a tree pretty easily, and then populate it with various chords that are subordinated to eachother in the appropriate manners, which should, ideally, give you some sort of nice large-scale harmonic structure.

So…anyone any comments or queries? This isn’t a tutorial, so I didn’t aim for too much rigor, just enough to get a discussion going ;)

(I should be able to say enough about prolongational structures in one post that it’ll be possible to try set up a prototype. If it’s wanted).

]]>
https://www.increpare.com/2008/11/lerdahl-part-1/feed/ 1
GTTM-based Chord Progression Generator https://www.increpare.com/2008/11/lerdahl-based-chord-progression-generator/ Sun, 02 Nov 2008 22:23:05 +0000 http://www.maths.tcd.ie/~icecube/?p=801 I’ll be posting some articles about the theory of Lerdahl very very soon. In anticipation of them (and to put something up so I can submit it to the Haskell Activity Report), here’s my implementation of a toy-model based roughly around his theory. It’s restricted to the process of chord generation.

Here‘s a simple playing by me of a chord-sequence that it produced. Here‘s a midi example that it produced by itself when I had it more developed.

There’s still a reasonable amount of work to be done on it, but it’s at a stage where it’s presentable.

Anyway, the current version of the haskell source code is here. Hopefully I’ll have more developed versions up in the future.

]]>
In which the hero sketches something, for he hath not the strength to venture, unbidden, into more detail. Gerbes? He thinks not. https://www.increpare.com/2007/08/in-which-the-hero-sketches-something-for-he-hath-not-the-strength-to-venture-unbidden-into-more-detail-gerbes-he-thinks-not/ Tue, 14 Aug 2007 08:31:26 +0000 http://www.maths.tcd.ie/~icecube/2007/08/in-which-the-hero-sketches-something-for-he-hath-not-the-strength-to-venture-unbidden-into-more-detail-gerbes-he-thinks-not/ Hmm. This is going to be harder than I had initially thought now that I think of it. Basically, given three melodies that work in counterpoint they are written on three staves, one above the other. And we have the identity that the interval between the lower and middle voice added to the interval between the middle and upper voice will give the interval between the lower and upper voice. And we have rules that relate how these voices should interact with eachother.

However, one can still apply most of the rules quite well if we make things a little bit abstract and no longer require the above relationship [a,b]+[b,c]=[a,c] to hold, but rather that it hold only up to a certain constant interval I.

And what’s the sense in this? Well with this you still have three melodies, only now instead of all three being contrapuntally amenable, we have that any two of them are. I haven’t seen this expounded elsewhere, and given how practical it seems I thought I’d mention it here.

And why the devil did I want to mix up Fuchs with cohomology? Well, I was trying to figure out an easy example of a Gerbe :) (I failed, as it happened, but it’s quite teasingly close!).

And why this rambley ramble here as opposed to something more deliberate? Because I’ve been meaning to post this since November last year, that’s why. So this means I get to relax about it now. Chill, you know? And if anybody should wish for any explication I would be Only Too Happy to provide it.

]]>
Consonance-preserving maps. https://www.increpare.com/2007/06/consonance-preserving-maps/ Mon, 11 Jun 2007 19:19:44 +0000 http://www.maths.tcd.ie/~icecube/2007/06/consonance-preserving-maps/ Grrr. Baaad program. But I’m putting it up anyway, because it’s not *that* bad.

Basically, say we had a scale, and a gradus suavitatus on that, a measure of consonance, so that given any two intervals, you can say if one is more consonant than the other. Now given two scales, it might be a worthwhile thing to look for things that preserve relative consonance; that is to say, a function f from one scale to another will have to satisfy the rule a>b => f(a)>f(b).

So, I wrote a program to do it. No interface yet, it’s to be run from within ghci; specific details of how to use it are given (in a very rambling sort of way) at the top of the source code. It seemed like it might be most useful in looking for interesting transformations of melodic motives that have a small number of notes. However, I can’t say I have been able to do anything useful with it, alas.

For an example of the program’s output, see this file:

Harmony-preserving maps example ( ps | pdf ).

For the code itself, here’s the source file:

Harmony Preserving Maps Generator V0.1 ( hs )

So yeah. Out.

]]>
A quick tutorial, and a piece https://www.increpare.com/2007/06/a-quick-tutorial-and-a-piece/ https://www.increpare.com/2007/06/a-quick-tutorial-and-a-piece/#comments Sat, 09 Jun 2007 21:31:53 +0000 http://www.maths.tcd.ie/~icecube/2007/06/a-quick-tutorial-and-a-piece/ So, I link two things here; firstly a sort-of tutorial for the counterpoint analysis program (more a worked example):

Counterpoint Analysis Program Tutorial/Fugue in Eb ( PS | PDF )

It should make the program make rather a lot more sense. Oh, and for the record, I don’t dislike the piece as much now as I did when I was writing the tutorial.

and, secondly, a rather dull affair:

Waking ( PS | PDF )

Well, that’s it for now. Have another compositional tool I’ve just finished, but want to see if I can do anything with it before putting it up.

]]>
https://www.increpare.com/2007/06/a-quick-tutorial-and-a-piece/feed/ 1
Counterpoint Analysis Program https://www.increpare.com/2007/06/counterpoint-analysis-program/ https://www.increpare.com/2007/06/counterpoint-analysis-program/#comments Fri, 01 Jun 2007 17:37:32 +0000 http://www.maths.tcd.ie/~icecube/music/counterpoint-analysis-program/ Counterpoint Analysis Program

V0.1 as of June 01 2007

So, this is a program that, when you input various melodies, will attempt to find contrapuntal relationships between them. I use something like a slightly weakened version of the 1st species counterpoint rules of Fuchs for this. As you may guess from the version number, this program is chiefly for my own use. However, I think it’s usable enough that it’s conceivable that other people might also use it. Oh, disclaimer: it doesn’t always (or even mostly) give great counterpoint examples, but that wasn’t so much the motivation; I wrote it because I’m never sure when writing fugues that I’m not missing some particular combination of themes that sounds especially nice; with this, I get straight away a bunch of combinations to play about with; many which I wouldn’t have seen without it I think (of course, I won’t limit myself to what this program outputs, but it’s a very good starting point I think), this makes it useful as a compositional tool for me.

No, no no, don’t expect any pictures (yet); it’s a console program (so far), so! And please, if you’ve anything to say about it, don’t hesitate to say it, either here or via email – I’m unlikely to do any work on it otherwise (as it fulfils my personal needs rather well in its current form).

Download Zip – Contains windows binaries, basic documentation, and Haskell source (should you wish to recompile it on a different platform).

Worked Example

]]>
https://www.increpare.com/2007/06/counterpoint-analysis-program/feed/ 2
My favourite calculation: Combination tones https://www.increpare.com/2007/02/my-favourite-calculation-combination-tones/ Wed, 21 Feb 2007 19:55:46 +0000 http://www.maths.tcd.ie/~icecube/2007/02/my-favourite-calculation-combination-tones/ Hmm, so in the interest of subscribing to this mathematical carnival what’s doing the rounds now, I’m writing something specifically mathematical in nature, my favourite elementary derivation. I’m trying to make it understandable and brief – if anyone is having trouble following, I can help in the comments.

Okay, so lets say we’re hearing a signal given by f(t); let’s assume it’s periodic. Now, to monitor what we hear, we have to view this as a sum of sine waves

f=a*sin(t)+b*sin(2t)+c*sin(3t)+ …

so a,b,c represent the frequencies we hear of frequency 1,2,3, etc, and the bigger the coefficient the bigger the amplitude.

Lets look at two really simple sounds, pure sine waves of different frequencies sin(at), and sin(bt). SO, they each have exactly one frequency present.

Now, so what if there were some non-linearity of our hearing system. That is what if, when someone plays f=sin(at)+sin(bt), we don’t actually hear this, but rather something more complicated.

So, the simplest way of such a thing being non-trivial is to introduce a quadratic non-linearity (ignoring coefficients…we’re thinking that because “all” functions can be taylor expanded as f(t)+f(t)2/2+f(t)3/3!+…, the next best thing to having just f(t) is to having the first two terms).

So, anyway, now when someone plays a signal f(t), we don’t hear f(t), but rather f(t)+f(t)2

So, what results from this? Well, we have to break down f(t)+f(t)2 to being a sum of sine waves first.

f(t)+f(t)2=sin(at)+sin(bt)+ (sin(at)+sin(bt))2
=sin(at)+sin(bt)+sin(at)2+sin(bt)2+2sin(at)sin(bt)

looking up trig tables and decomposing further we get (ignoring coefficients)

=sin(at)+sin(bt)+cos(2a)+cos(2b)+sin(a+b)+sin(a-b)

Ah, so look at this. We might be led to deduce from this that, if non-linearities were present, when someone plays two frequencies at the time, we will also perceive sounds playing at double either frequency, their sum, and their difference.

Now, the multiples of a and b can be reasonably expected to be masked by overtones (though it is possible to bring them out), but the difference (and, to a lesser extent, the sum), on the other hand, can be controlled very easily, just by bringing the two source sounds closer together or further apart. And, indeed, we can quite easily hear them.* Which is darnedly neat.

I like this calculation so very, very much because it’s surprisingly fruitful; whenever I feel like I’m loosing my faith in the power of Taylor expansions, I go through this derivation again.

The phenomenon was first noted by Tartini, the derivation was by Helmholtz, and these extra tones are sometimes called Tartini tones or, more commonly combination tones.

What’s also interesting, by the by, is that these effects are actually quadratic: I remember, the first time I heard an example (they can be found on the interweb quite easily, here for instance), I was listening to them with earphones, and the strength of the combination tone totally overwhelmed the two base ones. But, when I played it on speakers, it was much weaker relative to these tones, and if I went too far away, I couldn’t hear it at all.

*okay; this is a lie, actually the third order terms are the easiest to hear, corresponding to things like 2a-b…and there’s an explanation for this (check out Dave Benson’s notes if you want to know more).

]]>
Modulations in Music; an analysis of the Mazzola/Muzzulini approach. [unfinished/abandoned] https://www.increpare.com/2007/01/modulations-in-music-an-analysis-of-the-mazzolamuzzulini-approach/ Thu, 04 Jan 2007 00:31:23 +0000 http://www.maths.tcd.ie/~icecube/?p=560 [I just saw this lying about in my drafts folder. I figure I’d backdate it and stick it up, even though it’s not finished (I have no current intention of finishing it nor desire to do so)].

Introduction

Schoenberg always envisioned modulation as a four-part process

1) You establish what key you’re going to be leaving.
2) You use only notes common to both, so as to neutralize the old tonality.
3) You enter your new key.
4) You cadence in your new key.

There is a paper by D. Muzzulini [1] which attempts to give a mathematical refinement of this model, claiming still that it agrees with Schoenberg’s original conception in all of the examples in his book [2].

His refinement involves what notes of the new scale you are allowed to use in stage 3. I will define a slightly dumbed-down version of it in the first section, and then try to fit it within a much weaker framework involving iterated transformations which seems to me to be somehow more intrinsically musical, though I do not pretend that the ideas herein are either a) original or b) have any historical justifications. I will finish up by saying in what way a weakened version of Mazzola’s system can be situated within this framework.

Now down to business.

Mazzola’s Model

Recipe:
Two scales, S and T say, that differ by a translation.
A translation/inversion f that maps S bijectively onto T.
A cadential set* c of S

*a cadential set for S is some minimal subset that is in only S and no other scale related to S by translation.

The quantum Q, if any one exists, is defined as being the minimal set with the following requirements:

A) f:QQ bijectively.
B) cQ.
C) QT has no translational/inversional symmetries.
D) Every note of QT is harmonizable with some chord in QT.

The of this is that the notes that we can use in stage 3 are, according to him, give by the set QT.

His evidence for this approach is that, according to him Schoenberg many, many examples of modulations, given in [3], all conform to his approach. Of course, Schoenberg never talks about modulation in this way, doing in mainly be considerations of voice leading – certainly never being too interested in T/I transformations between scale types. And he doesn’t make any efforts to musically justify his axioms, so boo-urns to him for that.

An Iterated Transformation Model

Now, in this model, I’m going to leave the manner of establishing the old and the new key out; the parts of the modulation I’m interested in will look like

1) You’re in your old key
2) You use only notes common to both, so as to neutralize the old tonality.
3) You’re in your new key.

Essentially, all I’m going to do is choose some translation f, and some subset of notes Q of S such that under repeated applications off Q goes through each of the stages above.

Say we have that Q is in S, f(Q) is in ST, and ff(Q) is in T. There are few different ways of using this to modulate. We could just take these to be background scales which we might restrict ourselves to the images of Q, using them as chords or scales to which we are temporarily constrained in moving (Ex. 1) or, more strongly; we could have some melody/pattern played initially in Q, and then apply the transformation to this pattern until we end up in our new key (Ex. 2); or we could just play Q and its transpositions as block chords directly (Ex. 3), or in various inversions (Ex. 4).

General Iterated Transformation Structures

So I can see a few differen other ways that one might be able to do the same sort of stuff. If you can get the first few images of Q to be in the initial key, so that you can emphasize the transposition pattern enough, you might want to skip the transition phase giving a 2-phase transition (Ex. 5), or break out of the two scales entirely (Ex. 6, 7).

I’d call the last situation an extrinsic transport between two tonalities, as opposed to the original idea, in which the transport was somehow intrinsic to the two scales.

More saliently for Muzzulini’s theory, it might make sense, if there aren’t too many notes missing from S or T, to restrict one’s self to working (maybe once one has entered the neutral phase) with the intersection of the images with T (Ex 8).

[
here I sort of trailed off … here were the things I told myself I would have added had I finished this properly:

3-phase modulation
intrinsic/extrinsic/hybrid modulation
EXAMPLES!
Code!
]

——————
[1] Mazzola G. et al., The Topos of Music, Birkhaueser 2002
[2] Muzzulini D., Musical Modulation by Symmetries. Journal for Music Theory 1995
[3] Schoenberg A., Harmonielehre (1911). Universal Edition, Wien 1966.

]]>
Maths & Music Talk https://www.increpare.com/2006/07/maths-music-talk/ Sat, 15 Jul 2006 21:22:39 +0000 http://www.maths.tcd.ie/~icecube/music/maths-music-talk/ On the 7th April 2005, I gave for the Maths Society a talk with the above title. Below I link to two files, one a rough outline of what I talked about, the other a relatively detailed bibliography describing some good books in a few diverse areas related to music theory.

Outline [ PDF ] [ PS ]

Bibliography [ PDF ] [ PS ]

]]>