back to list

Complexity Formulae

🔗Dave Keenan <d.keenan@xx.xxx.xxx>

3/8/1999 10:09:36 AM

!!!!!!!!! THEORY WARNING !!!!!!!!!!!

Dear tuning folk,

I'd like to back up a little here. Here's my view on what we are trying to
do in this thread.

First a reminder that what we are talking about here is just a small part
of the attempt to mathematically model what we hear when several notes are
played together. We know our models will always be inadequate, not least
because people don't agree about what they hear. But there are various
reasons to persist, and various tradeoffs available between the accuracy of
a model and its user-friendliness.

We want to reduce any chord to a (hopefully short) list of numbers. But not
just any bunch of numbers, that's easy. Numbers such that chords that sound
similar in some way have numbers that are close together. Each number
should approximate a "dimension" of our perceptual space. We've easily
agreed to factor out loudness and pitch as the most salient dimensions and
can, and have been, ignoring them in this discussion.

There are plenty of dimensions left, and we could take them as
prime-affects such as Carl Lumma's
3=openess
5=sweetness
7=florescent lightingness,
and go on from there. But in this discussion we are attempting to first
factor out what seems to many to be the next most salient dimension,
consonance/dissonance. Joe Monzo wants to call this dimension "sonance", to
make it clear that these are two polarities of the same dimension, but then
I don't know what increasing numbers mean. It seems mathematically simpler
to give the lowest value to the most consonant "chord", i.e. a single note
(or silence?), so I want increasing numbers to model increasing *dissonance*.

We are also, at first, only considering the case of 2-note chords, also
called intervals or dyads. Partly because modelling dissonance for more
than 2 notes looks hard and partly because we expect we have to agree on
dyads (intervals) first if that project is to have any hope of success. An
interval may be described by its width in cents or as a ratio.

We mostly seem to agree that dissonance can be approximated by composing
two functions. The first, I think we should call complexity (after Wilson).
Although Barlow calls a reciprocal measure "harmonicity" I think that
sounds too much like "consonance", and I'd prefer to make it clear that we
don't expect this function to approximate consonnance or dissonance on its
own. For one thing, it gives far too much importance to high primes (at
least in dyads).

The second function has been called tolerance. This is some kind of
blurring function where the dissonance of a complex ratio will depend more
on its proximity to nearby simpler ratios, thus limiting the significance
of higher primes. Paul Erlich's Harmonic Entropy and the Plomp/Levelt
dissonance curve for two sine tones, perform this function in different
models.

Bill Sethares' model works well but is rather computationally intensive. We
agree that there are simpler models of dissonance that work well enough for
timbres with harmonic or near-harmonic partials. The two most popular
do-it-in-your-head dissonance measures are odd-limit and prime-limit. These
are really only complexity measures, and tolerance is often ignored or
treated somewhat ad hoc.

Mostly what we expect from a complexity measure is that it will at least
rank the intervals in the correct order of increasing dissonance.
Complexity is only defined for ratios, not irrationals or cent values (the
tolerance or blurring function takes care of them). The complexity of a
ratio is typically described as some function of the complexities of its
numerator and denominator. In the case of odd-limit and prime-limit this is
just the maximum value (this is part of the appropriateness of the word
"limit"). My spreadsheet has so far only considered whole numbers.

Partch's Odd-limit ranks the whole numbers up to 19 as
(1,2,4,8,16),(3,6,12),(5,10),(7,14),(9,18),11,13,15,17,19
while Prime-limit gives
(1,2,4,8,16),(3,6,9,12,18),(5,10,15),(7,14),11,13,17,19
where those in parenthesis are given equal rank.

These two complexity measures disagree most importantly about the
dissonance of ratios of 9, and less importantly about 15.

There are formulae for musical complexity whose computational complexity is
intermediate. Barlow's is one such. Note that Barlow calls it
indigestibility when it is applied to whole numbers but flips it over and
calls it harmonicity (a consonance measure) when applied to ratios.
Barlow's ranking is
1,2,4,3,8,6,16,12,9,18,5,10,15,7,14,11,13,17,19.
This is hardly different from that of prime-limit, except in placing 3 and
6 below 8 and 16 respectively.

Another is Wilson's Harmonic Complexity, giving
(1,2,4,8,16),(3,6,12),(5,10),(9,18),(7,14),15,11,13,17,19
In its treatment of 9 and 15 it is intermediate between odd-limit and
either prime-limit or Barlow's, and as such it agrees better with my
experience.

Just as there are both linear and logarithmic measures of loudness (pascals
vs. decibels) and pitch (hertz vs. cents) there are linear and logarithmic
measures of dissonance. We could call the respective units the partch and
the wilson since Partch's odd-limit (and the so called integer-limit) is a
linear measure while Wilson's complexity (and Barlow's and prime-limit) is
logarithmic. The easiest way to tell is by the value they assign to 1. If
this is zero, it is most likely logarithmic. The other way is just by
comparing their curves. By the way, the curves imply that the prime-limit
of 1/1 may be safely defined as 0 even though its odd-limit is 1.

Of course taking the log (or its inverse the exponential) of any complexity
measure does not alter its ranking of the intervals. However, I'm inclined
to say that the logarithmic measures correspond more closely to our
experience (as they do for loudness and pitch).

When I entered this thread I proposed a complexity measure that had a
variable parameter (an exponent weight) for each prime, so that it could be
made to approximate the various existing measures and allow for others in
between, in the hope of enabling a consensus.

I now understand that Manuel Op de Coul has already done this in Scala by
generalising Barlow's harmonicity to allow the prime exponent weights to be
changed with the SET HARMCONST comand. This is good, except I'd prefer to
stick to a *dissonance* measure (not consonnance) and would also ignore the
sign (+ or -). The absolute value of the reciprocal of Manuel's harmonicity
is entirely equivalent to the the logarithmic version of my complexity when
my weights are multiplied by the log of their prime. So I'd like to use
this formulation from now on to explore the possibility for some kind of
consensus on the weights.

Given a whole number whose prime factorisation is

n = 2^a * 3^b * 5^c * ...

its logarithmic complexity is now

log_complexity(n) = k_2*a + k_3*b + k_5*c + ...

where the k_p's are the prime exponent weights (Manuel's HARMCONSTs).

The logarithmic complexity of a ratio n/d in lowest terms is then just the
sum of the log complexities of numerator and denominator.

Alternatively and equivalently a ratio n/d (which need not be in lowest
terms) may be expressed as a single prime factorisation where exponents may
be positive or negative and its log complexity is

k_2*|a| + k_3*|b| + k_5*|c| + ...

where |x| is the absolute value of x.

The linear complexity is therefore

lin_complexity = e^log_complexity
= e^(k_2*|a| + k_3*|b| + k_5*|c| + ...)
= e^(k_2*|a|) * e^(k_3*|b|) * e^(k_5*|c|) * ...

where e is the natural log base. Note that since my first proposal, the e's
have replaced the primes themselves, however the equivalence is explained
by the fact that
2^(k_2*a) = e^(ln(2)*k_2*a) and
3^(k_3*b) = e^(ln(3)*k_3*b) etc.
where ln(x) is the natural log of x.

I'll let you know when I've updated my spreadsheet, and I promise to answer
any earlier questions that weren't answered above, when I can find the time.

Regards,

-- Dave Keenan
http://dkeenan.com

🔗Paul H. Erlich <PErlich@xxxxxxxxxxxxx.xxxx>

3/8/1999 4:36:51 PM

Dave Keenan wrote,

>The second function has been called tolerance. This is some kind of
>blurring function where the dissonance of a complex ratio will depend
more
>on its proximity to nearby simpler ratios, thus limiting the
significance
>of higher primes. Paul Erlich's Harmonic Entropy and the Plomp/Levelt
>dissonance curve for two sine tones, perform this function in different
>models.

Did you mean the Plomp/Levely dissonance curve for two non-sine harmonic
tones?

P.S. Dave: I don't like it if 15/8 is given the same complexity as 6/5,
assuming factors of 2 are ignored. This last post of yours seems to
propose a family of formulae that do give the two the same complexity if
factors of 2 are ignored. Did you see Paul Hahn's post on using
triangular lattices?

🔗Daniel Wolf <DJWOLF_MATERIAL@xxxxxxxxxx.xxxx>

3/9/1999 1:40:21 PM

Message text written by Paul Erlich

>P.S. Dave: I don't like it if 15/8 is given the same complexity as 6/5,
assuming factors of 2 are ignored.<

P.E.:

If you don't mind my jumping into your postscript, what do you imagine a
complexity formula to look like where the factors of 2 are not ignored?
Might this be a useful, if not necessary, component in a complexity theory
in which register is taken into account? I am thinking here of something
in addition to a roughness/critical band curve.

DJW

🔗Paul H. Erlich <PErlich@xxxxxxxxxxxxx.xxxx>

3/9/1999 3:27:28 PM

Dave Keenan wrote,

>The second function has been called tolerance. This is some kind of
>blurring function where the dissonance of a complex ratio will depend
more
>on its proximity to nearby simpler ratios, thus limiting the
significance
>of higher primes.

Have you noticed that this argument is far more valid if you replace
"primes" with "odds" at the end of the sentence, showing that a strict
lattice approach like all those we've been discussing is much more
likely to be meaningful if we restrict ourselves to, say, the
11-odd-limit, than if we restrict ourselves to the 11-prime-limit, the
7-prime-limit, the 5-prime-limit, or even the 3-prime-limit? The
11-odd-limit seems about right given ideal conditions for pitch
discrimination. And again, a triagular lattice would be more
appropriate.

🔗Paul H. Erlich <PErlich@xxxxxxxxxxxxx.xxxx>

3/11/1999 2:00:18 PM

>>P.S. Dave: I don't like it if 15/8 is given the same complexity as
6/5,
>assuming factors of 2 are ignored.<

>P.E.:

>If you don't mind my jumping into your postscript, what do you imagine
a
>complexity formula to look like where the factors of 2 are not ignored?

>Might this be a useful, if not necessary, component in a complexity
theory
>in which register is taken into account? I am thinking here of
something
>in addition to a roughness/critical band curve.

>DJW

Yes, factors of 2 should be important in an octave-specific theory. I'm
not sure what you mean by "in addition to"; a true psychoacoustical
dissonance curve (including both roughness and harmonic entropy) would
be a refinement over a lattice-based complexity measure; the latter is
desireable as an approximation which allows actual _visualization_ of
scales with "closeness" representing "consonance" to a good
approximation.

🔗Daniel Wolf <DJWOLF_MATERIAL@xxxxxxxxxx.xxxx>

3/12/1999 1:06:57 PM

Message text written by P. Erlich
>Yes, factors of 2 should be important in an octave-specific theory. I'm
not sure what you mean by "in addition to"; a true psychoacoustical
dissonance curve (including both roughness and harmonic entropy) would
be a refinement over a lattice-based complexity measure; the latter is
desireable as an approximation which allows actual _visualization_ of
scales with "closeness" representing "consonance" to a good
approximation.
<

With my students, I've always explained lattices as analogous to flat
geographic maps. That is, that they represent distances (harmonic and
physical, resp.) quite precisely in the center but with increased distorted
in the extremes. For the analysis or composition of a piece of tonal music,
in a typical chorale range and voicing, the lattice will be close enough.

The 'in addition to' meant precisely the inclusion of roughness, and of 2^n
phenomena (which I have previously called remoteness, but I gather is
covered by your harmonic entropy; I'm pleased to find the better term).

These are more than details in real musical situations. For example, if I
wanted to write a choral piece with a minor third between the tenors and
basses, how low could it be voiced before becoming too rough? In the past I
had always orchestrated with the rule of thumb than the lowest 'clean'
voicings would follow the intervals of a harmonic series two octave below
Bb. (So, for example, Bb - d, was the lowest 'clean' M3rd etc.). Recently,
in preparation for a large orchestra piece, I have been refining this more
systematically by subjective analysis of sampled sounds. So, not only would
my ideal complexity formula include roughness, but have the roughness
classified further by timbre.

Not directly related, I have also used variations on a formula, called
'effort', to help in the generation of melodic lines with a vocal charcter.
This is based on the notion that the larger the interval, the greater the
vocal 'effort' to produce the leap, while leaps of simpler ratios reduce
the error. Most often, I have have calculated effort simply by multiplying
the Wilson complexity by cents. Here are some effort values, calculated off
the top of my head:

2/1 1200
15/8 8704
11/6 14686
9/5 11209
16/9 5976
7/4 6783
5/3 7072
13/8 10933
8/5 4070
14/9 9945
3/2 2106
11/8 6061
4/3 1494
9/7 5655
81/64 4896
5/4 1930
11/9 5899
6/5 2528
7/6 2670
8/7 1617
9/8 1224
10/9 2002
16/15 672
25/24 923
1/1 0