Weaving sounds to make braids
Vi Hart’s “Doodle Music” video is a beautiful combination of art, math and music, illustrating parallels between symmetries in curves and symmetries in sound:
I particularly enjoyed the braid melody at 2:35, so it made me want to discover a mathematical function governing the vibrations in the air that define a “musical braid”.
Looking at the braid
First, let’s investigate what Vi’s musical braid looks like. If we look at a section of the spectrogram of the melody, here is what we get:
Even with this visualization, it is not obvious where the braid is. But Vi’s voice is luckily not a pure sine tone, meaning that there are many harmonics visible. Vi also chose to quantize the braid by discretely changing the pitch of her voice to make the result sound more musical, sticking to western musical tones. A pure sine tone usually does not sound very pleasing, and graphically looks like a flat line in the spectrogram; it appears similar to a the spectrogram of a whistle. To mathematically reproduce Vi’s musical braid so that it appears in the spectrogram, we need three independent sine tones, whose frequency varies in accordance with the drawing she made with sharpies.
Making the first thread of the braid
To mathematically “draw” Vi’s braid, we need to determine how to construct each thread individually, and then add them together at the end after erasing the parts that pass behind other threads. Let’s say that the shape of each thread is a sine wave. Then we need to create a frequency modulated signal, that is, a sine wave that changes pitch in a sinusoidal manner. A pure tone at a frequency \(f\) can be generated as $$y(t)=A \sin(2 \pi f t+\phi),$$ where \(t\) is in seconds, and \(\phi\) is the phase. In our case, we need the frequency itself to change as a function of time, in particular, we want our frequency to be $$f(t)=\bar{f}+\tilde{f}\sin(2\pi g t),$$
where
$$\bar{f}=\frac{f_\mbox{max}+f_\mbox{min}}{2},\;\tilde{f}=\frac{f_\mbox{max}-f_\mbox{min}}{2}$$
It may be tempting to plug this result for \(f(t)\)directly into our pure sine formula, but this doesn’t quite work. To see this, imagine our answer is \(y(t)=A \sin(a(t))\), with \(a(t)\) some function to be determined. Recognize that in order for our frequency modulated signal to be locally identical to a pure sine wave with some phase, we require that the argument of the pure sine, \(2 \pi f t+\phi\), be the best approximation to the argument of our frequency modulated signal, that is, the tangent line. So we require that the slope of the tangent line (\(a’(t)\)) be equal to our desired frequency (\(f(t)\)), indicating that our undetermined function \(a(t)\) is essentially just the indefinite integral of our desired frequency function \(f(t)\):
$$y(t)=A \sin\left(2\pi \int f(t) \; dt+\phi\right).$$
Let us determine \(a(t)\):
$$a(t)=2\pi \int \bar{f}+\tilde{f}\sin(2\pi g t) \; dt=2\pi\bar{f}t-\frac{\tilde{f}\cos(2 \pi g t)}{g},$$
so our desired function is
$$A \sin\left(2\pi\bar{f}t-\frac{\tilde{f}\cos(2 \pi g t)}{g}\right).$$
This gives an output spectrogram of:

Perfect!
Weaving the second and third threads of the braid
Now we need two more sine waves, each offset by a different amount. Since there are \(2 \pi\) radians in a full cycle, and we have three waves that we want to be spread out evenly, \(\phi=\{0,\frac{2\pi}{3},\frac{4\pi}{3}\}\).
By adding several of these warbly sine tones together (call them “metasines”), we can create Vi’s musical braid. To make it look like they are passing over and under each other, we have to increase and decrease their respective volumes at the appropriate moments to give us the sense of depth. When this is done, the spectrogram looks like this:

The outcome
Here is the result played as a sound:
Sonified Braid by danielkwalsh
Interesting, but not as beautiful as the original. My friend Britta said it reminded her of a fire alarm.









That red connector between the bottles creates a handle for easy transportation. Most people dispose of these connectors and consume the Red Juice with the help of friends. Cody manages to drink this quantity of juice in a few days and sets the connectors aside, initially out of laziness but soon building a collection of them.













