
Mathematical Analysis of The Beatles’ Magical Mystery Chord - ColinWright
http://www.kevinhouston.net/blog/2014/12/the-beatles-magical-mystery-chord-2/
======
tylerneylon
This was enjoyable.

I wonder if software exists that is aware of the overtones of each particular
note of a given instrument. Theoretically, this would be a more precise way to
pull out a chord from a recording without having to manually compensate for
them later. Standard Fourier analysis is based on sine waves which aren't the
best model for complex tones like that of a piano or a 12-string guitar.

Mathematically, the best approach I'm aware of in the long run would be to
study the harmonic spectrum of the exact instrument as closely as possible,
and then perform inner products against the spectrum of the mystery sound
being analyzed. There's no guarantee that the note-vectors would be orthogonal
(probably not), so the problem becomes more interesting in that you might want
to perform a sparsity maximization on the resulting output - that is, look for
the least number of notes capable of matching the recording within epsilon
error in sample (or spectrum) space. Sparsity maximization is NP-complete, so
a good way to approximate this is to actually perform L1-minimization using
linear programming. Another approach might be to look for a balance between
the absolute error term and the sparsity term.

~~~
TTPrograms
If you know the number of notes being played you can solve in polynomial time.
You could run it with a few variations in the assumed number of notes.

The harmonic spectrum of each instrument will be extremely difficult to get,
though, as each note can have a different waveform and will be affected by
unknown non-linear effects in the instrument itself as well as in mixing (i.e.
compression or distortion).

~~~
kefka
Not really. First, you can simulate overtones by where you strike a guitar.
Secondly, we don't know the model of the tube amps they were using. Tube amps
do some really funky mixing, which can exasperate FFTs by giving weird/wrong
results.

~~~
TTPrograms
>First, you can simulate overtones by where you strike a guitar.

If you know the make of the guitar and the strings and where it was picked
each time and the location of each of the tone and volume knobs and the
position of the pickup switches.

>Tube amps do some really funky mixing, which can exasperate FFTs by giving
weird/wrong results.

>unknown non-linear effects...distortion

------
arafalov
Interesting reading. Just today I was doing an internet research on a similar
topic.

I want to take a piece of Salsa music and extract a pattern each of the
instruments make. To figure out whether it is 2/3 or 3/2 (for clave). Which
patterns the bongo plays. Where is the '1' (phrase start). And - of course - I
want this all happen auto-magically.

It sounds like there must be a solution for it, but I did not find the actual
ready answer for it. And my own music skills are below useful.

------
ajarmst
Randy Bachman (of Bachman Turner Overdrive) did a very interesting analysis of
the chord from a guitar player's perspective on CBC a few years ago:

[http://www.openculture.com/2011/12/guitarist_randy_bachman_d...](http://www.openculture.com/2011/12/guitarist_randy_bachman_demystifies_the_opening_chord_of_a_hard_days_night.html)

~~~
JohnBooty
The author of the linked article addresses Bachman's story, and offers some
seemingly compelling reasons why he thinks Bachman was mistaken about some
things.

I say "seemingly compelling" because much of this is over my head!

------
mcenedella
What a wonderful year-end gift to lovers of music, math and the Beatles. So
thank you.

------
tacos
So, so many words. But you can stop reading right here:

"The track was from a CD and therefore suffers from compression issues. That
is, some of the frequencies may be missing due to the method employed to fit
everything on the CD"

Programmers dicking around with audio and getting it all wrong is the new
programmers dicking around with graphic design/UX and getting it all wrong.

FFTs really don't work for this stuff. There's not enough frequency resolution
at the low end. Even higher up the most common error is an octave error. This
can be caused by even harmonic distortion. Also, the brain is great at
creating a missing fundamental. Mixing engineers use this to clear out the low
frequency mud from a mix.

Tinkering with AutoTune for even a few minutes you'll quickly learn that the
name itself is a lie. It doesn't Auto-matically Tune anything. It generates a
crude, crappy attempt at tracking pitch (and monophonic only pitch) which then
requires a trained musician to wiggle against using a mouse in a tiny window
for hours and hours. Get it wrong and it sounds like a robot. Most people get
it wrong. "Wrong" has become a sound. Now people get it wrong on purpose.

Melodyne is more interesting but also trips over itself.

This is a hard, hard problem. Even if you can find the loudest frequency and
map it to a note, it doesn't mean it's the note in question.

~~~
baddox
You accurately describe the many subtleties in audio engineering and pitch
perception, but you omit the conclusion that, at least for pathological cases,
there is no _objective_ "note in question." Two reasonable people, both
musically educated, can have different interpretations of a note, especially
in the context of a particular chord or musical arrangement.

~~~
tacos
Agree, with caveats: in the context of vocal tuning there's often a desired
note that represents the melody. And objectively there's often a note that a
musician intended to play.

Even if the instrument and signal path cooperate to capture this intent (the
inharmonicity of the string itself; nonlinearities of the microphone and
amplifiers; resonances in the instrument soundboards and rooms themselves)
you're already chasing ghosts!

Then add in a mixing engineer boosting and reducing frequencies, a tape
machine varying in speed ever so slightly, and a mastering compression step
throwing away amplitude detail -- and you've really got to wonder what the
hell someone thought they were doing by running FFTs on a 50 year old analog
mix and pretending they've got insight into the original solo instruments.

