17 October 2013

Medieval Music, Digitally Reconstructed

In spring 2012, MIT established a new Center for Art, Science, and Technology (CAST) sponsored by a grant from the Mellon Foundation.  For the past year, CAST has been sponsoring wonderful concerts, shows, and exhibitions related to the now-fundamental interconnectivity between the creation and performance of art and the worlds of science, engineering, and technology. I'm proud to say that CAST's mandate also extends to the study of art, including music and musicology, and that they've chosen to feature my work in a great article, "Medieval Music, Digitally Reconstructed," written by Anya Ventura.  As always, I thank the NEH, Digging into Data partners, and the Seaver Institute, and MIT for their support of my work.


15 October 2013

OpenCourseWare

Along with my institution, MIT, I am a firm believer in using technology to make our teaching and learning tools available freely or cheaply to everyone who wants to learn. Look in this space in the coming months for some new initiatives that I'll be taking, but one of the oldest digital learning spaces is still one of the most complete and best, and that's MIT's OpenCourseWare. OCW publishes syllabi, teaching notes, assignments (often including student answers), and, for larger classes, lectures and other materials. I have worked with OCW to put my Early Music, 1900-1960, and Computational Musicology classes online. They also host some extraordinary panel discussions, such as the forum on Musical Time.

OCW has recently written a wonderful article about me and why I believe OCW is doing a great thing for the world. Please take some time to read it if you'd like.

14 October 2013

Advanced dotting...

In my notation seminar, we were talking last Friday about "Crumb dots". These are George Crumb's idiosyncratic notation where dots are placed on either side of a note, such as . ♩ . which is worth the length of a quarter note tied to a sixteenth note. I think the logic is that it's a double-dotted quarter note where the second dot instead subtracts instead of adds.  In any case, it's worth 1.25 quarter notes in length.



We also talked in the seminar earlier in the semester about medieval "dot groups."  These are not symbols found in actual medieval music, but things that are really useful for transcribing medieval music, where 9/8, 9/16, 9/4, 9/2, etc. are commonly implied meters.  There is no single note that can fill up a measure of 9/X where X is a power of two.  So we tend to use things such as a dotted quarter note tied to a dotted eighth note ( ♩. ⁀♪. ) for 9/16, and so on. But consider that that figure comprises two notes, the second of which is half the length of the first, and they are tied together.  That is the basic definition of a dotted note: a dotted half note is a half note tied to the note half the length of a half note, or a quarter.  So what ♩. ⁀♪. needs is a way of "dotting" a dotted quarter note, or  ( ♩. ) . ––note that this note has a different length than a double-dotted quarter note (which is worth 7/16, not 9/16) and this "dotted-dotted-quarter note" is worth more than a half note.  When it is used, it is usually written with two dots vertically aligned: ♩:



Formulas and Extensions to negative numbers

Working out the length of notes with multiple dots can be hard work.  In this screen capture from the "Reimagined" Battlestar Galactica, Kara "Starbuck" Thrace doesn't get it right even though the fate of humanity rests on her deciphering the secrets of a mysterious melody:

The third line should have two 32nd notes, not 16ths, and the fourth line should have triplet 64th notes.

So, let's get back to the basics. How long is a note with d dots? Let's see.  If a quarter note gets the beat then:

♩ = 1 beat
♩. = 1.5 beats
♩.. = 1.75 beats
♩... = 1.875 beats

and so on to

lim (d→∞) = 2

So, what's the pattern?

1
1 + 1/2
1 + 3/4
1 + 7/8
1 + (n – 1)/n

Where n = 2d

Given that, we can work out that –1 dots is:  1 + (2–1– 1) / 2–1 or 1 + (–½) / ½ or 1 – 1 or 0. So a note with negative 1 dots has no length.

For d = –2 we get –2 beats.  I don't know what that would mean.  I suppose play the note backwards beginning two beats before it should start?  (David Lewin has written about the uselessness of negative note lengths).

Just to round it all out:

d = –3, implies duration –6 beats.
d = –4, implies duration –14 beats.
d = –5, implies duration –30 beats.

or for any negative d, duration = – (2|d| – 2).

[This section added 15 August 2015]:
Note also that the fraction of the preceding duration added by each dot is as follows:

One dot: 3:2
Two dots: 7:6
Three dots: 15:14
Four dots: 31:30

So the numerators follow the series of Mersenne numbers while the denominators are always one less.  The general formula this is:

(2numDots + 1– 1) : (2numDots + 1– 2)

Look what happens though if d (numDots) is zero:

(21– 1) : (21– 2)  = 1 : 0

Thus a note with no dots is 1:0 or infinitely longer than what preceded it in the dot series. One way of looking at this is that a plain note receives all of its duration not from its shape or number of flags, but from the fact that it has no dots; if it lacked no dots then it would have no duration. :-)  I told this theory to Noam Elkies and he said that I was dotty.

Anyhow, back to other weird numbers of dots. [end added section]

Non-integer dots

Fractional dots create irrational durations, a more useful concept than negative durations. Conlon Nancarrow[*]  has used these durations in some of his pieces, such as one where two canonic lines are set against each other with tempi in the ratio of √2 to 2.  After the first note of the piece, no two notes will ever coincide no matter how long the piece lasts.   There's no way to notate anything like this in normal notation, but with fractional dots, we can do this.  If n = 2d and beats = 1 + (n – 1)/n then a note with 1/2 dot has n =  2½ or √2, so a half-dotted quarter lasts 1 + (√2 - 1)/√2 beats, or approximately 1.29 beats.  With this knowledge we can create many irrational lengths for notes just by giving fractional dots. (Though not all irrational lengths.  For instance Nancarrow's "Transcendental Etude" puts two canonic lines against each other with tempi in the ratio of e to π.  Fractional dots could not notate this).

But before trying to figure those out (an exercise for the reader...), there are still lots of rational number lengths that cannot be notated with fractional (i.e. rational number) dots.  Is there a way to get any other rational length instead of just the ones based on powers of 2 that are standard? Can we, for instance, notate a triplet only with partial or negative or partial negative dots? Yes, we can, by making the number of dots a logarithm!  For instance, to get a note that is 5/3 the basic length, we set the number of dots to log2(3). That's a triplet half note. To get a triplet quarter, we subtract two dots from that, or (log2(3) – 2) dots. Or for a quintuplet, use (log2(5) – log2(3) – 1) dots.

Trying to come up with a way of notating this makes me understand why someone decided that a triplet mark was simpler. But since it is not too hard to prove that any nested tuplet can be written as a single tuplet, we find that any rational duration can be notated as a single note with different numbers of, possibly irrational, dots.  Something for the new complexity school to pursue next.  Or hopefully not.

[*] an earlier version of this post referred to "Colon Nancarrow" who is neither a piece of punctuation nor a part of the digestive tract.  He is also not the same as Loren Nancarrow, a really great weatherman in San Diego, that I've always wanted an excuse to make a shoutout to in a Conlon Nancarrow post.

08 October 2013

Testing ability to render music in Blogger

Update: January 2026 -- I've disabled the embedding of music21j (formerly hosted at MIT) so this no longer works... The following score was written as: <div class="music21 tinyNotation">c4 d8 e8 f2</div>
c4 d8 e8 f2
and then rendered automatically via some plugins I have.
Here's another one. You can click either of them to hear them:
3/4 d8. f#16 e8 f g a c'#2. d'2.
Hope to be able to release this soon.
This might not work after a bit -- the loading is too slow and I might move the source code... Thanks to the folks at Vexflow and MIDI.js for the idea.

18 December 2012

Addition and Multiplication of Intervals

I was emailing back and forth with a student research assistant about some algebraic properties of adding, subtracting, multiplying, and dividing intervals, and I thought that I might share the email (in slightly revised form) with the Net. I would be very surprised if this hasn't been written up already by someone else, but the only things I could find quickly about interval multiplication was all in the 12-tone/serial usage, which is less interesting to me today.

An interval is just a ratio (fraction), so the octave is 2:1. That ratio could apply to frequency (a note an octave up has a frequency twice that of the lower note), or the reciprocal gives the string length (so a string half the length of another is an octave higher than the longer string) or length from mouthpiece to first open tone hole, etc.

The octave is always 2:1. The other interval ratios depend on what temperament we’re talking about. In equal temperament, all other ascending intervals are integer exponents of L, where L is a the 12th root of 2 (I’m using L because it’s the 12th letter). So a major third (4 semitones) is L4 or the cube-root-of 2. In other temperaments, the ratios are integer ratios, but they’re not standardized. So a major third can be either 5:4 or 81:64 (I like the latter, also called a ditone, for reasons below). You just have to memorize them all. But once you have P5 as 3:2 and major second as 9:8, you can basically derive the rest.

When we add intervals, what we’re actually doing is multiplying ratios. So P5 + P4 = 3/2 * 4/3 = 2/1 = P8. When we subtract intervals we’re dividing ratios, which is multiplying by the reciprocal, so P5 – P4 = 3/2 * 3/4 = 9/8 = M2. And P8 – P5 = 2/1 * 2/3 = 4/3 = P4. Since multiplication of ratios is commutative, then addition of intervals is also commutative. The generic interval (the "5" in "P5") of the sum of ascending intervals is always the sum of the two generic intervals minus 1. For descending intervals or a mix or if adding multiple intervals at once, take each generic interval and subtract 1 from the absolute value and then restore the sign. In the end add one to the absolute value of the result and then restore the sign. If it was 0 before, make it positive, since we only have P1 for a unison, never P-1. (Though how we should actually designate the sign for d1 or dd1, is unclear, maybe it should be d-1? but then it's not analogous to dd2, such as between E# and Fb, where the generic interval is definitely ascending -- in programming this possibility is always one of those cases that bites you in the ass later later, where you have an ascending diatonic interval that is a descending chromatic interval, so if you mix ascending tests for generic intervals with > 0 tests for chromatic intervals, you'll get inconsistent results depending on which form of the interval you're looking at.)

Getting back to the main subject. So what does it mean to multiply an interval by an integer? M2 * 2 = ? Well, what’s M2 + M2 = 9/8 * 9/8 = 81/64 = M3. So M2 * 3 = M2 + M2 + M2 = 9/8 * 9/8 * 9/8 = A4/Tritone (729/512), and so M2 * 3 = (9/8)3, so when we multiply an interval by a number it’s like taking the ratio to a power.

Since exponentiation is not commutative, 2 * P5 would be different than P5 * 2; 2 * P5 = 2(3/2) = 2 radical 2, while P5 * 2 = (3/2)2 = 9/4 which is a M9 (P8 + M2 = 9/8 * 2/1). However, we are defining our own algebraic system, so we could define * as always placing the integer in the exponent and thus make this commutative. HS and early college math doesn’t talk much about defining our own algebras, but we do it all the time. (Otherwise we couldn’t define 11:00 + 3 hours = 2:00, etc.)

So, does it make any sense to multiply intervals? What would M3 * P5 be? Well, if we convert it to ratios, then it’d be (81/64)(3/2), or (9/8)3, or 729/512, which we defined as an Augmented 4th. Most ratios * other ratios though will create irrational ratios, which we don’t like unless we’re in Equal Temperament (“irrational ratio” is an oxymoron if you think about it). In equal temperament though we’d end up with irrational numbers raised to irrational exponents. Your calculator will calculate these things, by substituting in the nearest rational number, and in fact to take a number to an irrational ratio, you need to find the limit of the ratio of the base to the closest smaller rational number exponent with the base of the closest larger rational number exponent. (btw—did you ever notice that any negative number to an irrational power is undefined? because it depends on whether the irrational number can be expressed as a ratio with an even or odd denominator, and irrational numbers are not ratios. Fortunately, we don’t need to deal with negative ratios in music).

A nice property of defining multiplication of intervals as a form of exponentiation is that descending intervals (whose ratios are positive but < 1) can also be used. I like M3 * P–8, or major third times descending perfect octave; or (81/64)(1/2) power, or 9/8, or M2.

Consider what multiplying by an interval by an interval might be used for. M2 * P8 = (9/8)(2/1) = 81/64 = M3. So a M2 occupies the same proportion of the harmonic space of one octave as a M3 does for two octaves. This process (multiplying an interval by P5) could be used to convert intervals in standard, octave repeating, space into Bohlen-Pierce space which is based on the P12. Or it can translate the ratios produced by fingering patterns in the lower vs. upper register of the flute (based on P8) into the ratio you’d get on the clarinet (based on P12).

Also notice that multiplying any interval (ascending or descending) by a descending perfect infinity (P-∞) (or the limit as the number of descending octaves increases without bound) condenses the available interval space to nothing. So every interval becomes a unison. E.g., P4 * P-∞ = (4/3)(1/(2∞)) = (4/3)(1/∞) = (4/3)0 = 1 (since any non-zero number to the zeroth power = 1) and 1 = 1:1 = P1.

The question of what diatonic intervals result from any addition or multiplication isn’t something I’ve touched on here. It’s easy to figure out what the generic interval under addition will be as I described above. The specifier (major, minor, augmented, diminished, perfect, etc.) is harder to determine. I’ll leave that as an exercise – it’s messy and I solved it a while back, but I can’t remember the exact solution right now. Under multiplication of an interval with an integer, it’ll be easy to solve what the diatonic interval will be, without converting to ratios, once you’ve solved the previous problem. But for multiplication of an interval by another interval the math becomes harder. The first question to solve there is, is the answer dependent on the temperament system chosen, or can it be generalized for any temperament?

Btw, raising intervals to the power of other intervals is just silly. So say I. :-)