Summer of Math Exposition

Presented by 3Blue1Brown 3blue1brown

Yin (yang) Algorithm: The Most Important Algorithm in Computer Music

Audience:

In this video, we use the Yin (yang) Algorithm, one of the most important algorithms in computer music, to improve upon the Music Transcription Algorithm we built in the last video. The algorithm was published in 2002 by Alain de Cheveigne and Hideki Kawahara. Through their algorithm, we learn about auto-correlation, Fourier transforms, basis’s for audio, the difference function and log-normal penalty.

Github link: https://github.com/Waz-ly/SheetMusicGenerator Original paper: https://www.ee.columbia.edu/~dpwe/papers/deChevK02-yin.pdf



Analytics

6.1 Overall score*
56 Rank
12 Votes
10 Comments

Comments

6.1

Interesting topic and I learned something new:)

Ironically the quality of the mic could be better, it is hard to hear with the reflections in the room. You can use a voice enhancer like the one from Adobe.

The visual style is a bit all over the place. I like the animations, but the standard matplotlib graphs didn’t really fit in that style.

6

The problem of transcribing music is interesting, and you make the logic pretty clear. And while I still wouldn’t recognize the end result as Call Me Maybe, it’s still a huge improvement over where it started.

The recap is necessary to make this stand alone, but it takes up most of the video, and the actual new content doesn’t even show up until the last few minutes. That makes it feel like an afterthought, rather than the main event.

4.6

Thanks for this interesting introduction to music transcription. Overall, I enjoyed the video and learned a lot.

You have a natural camera presence and your usage of different media (Python plots, scribbles, images) made the video easy and exciting to watch. I also enjoyed the examples of well-known songs. From the presentation side, I think you’re at a very good level. From the content side, I would have three suggestions: (1) sharpen your explanations, (2) make the video standalone and (3) mention the problem earlier.

Let me start with a summary of how I understood the main topic of the video: We can extract notes using a Fourier analysis. We slide over the signal in time and extract the maximum frequency in that window, which is then transcribed to a note on the sheet. However, because we only use the maximum, we get problems such as only transcribing the loud drums and no singing, which makes “Call me maybe” sound almost unrecognizable. To solve this issue, we may try to leverage the autocorrelation and difference method. Both duplicate the signal and shift it in time and then correlate or subtract the original signal, respectively. You explained that because the output of the difference methods shrinks, it’s useful for identifying pitch, and because the output of the autocorrelation method grows, it’s not useful for that task. We can further improve the difference method by dividing by the average signal of the previous timestamps and applying parabolic interpolation. That is the Yin algorithm.

Now coming to point (1): In the example with the violin tone and difference vs. autocorrelation method I was a bit lost. Probably because I couldn’t see what the ground truth frequency we want to extract is. I also struggled to understand, how either method helps us to extract frequencies with lower amplitude (such as the singing in “Call me maybe”). What might’ve helped here would be to explicitly state the optimization problem again and show the “ground truth” output against the output we obtain from the autocorrelation and difference method. You introduced the Yin algorithm very nicely. But somehow I also couldn’t follow how we get from the plot where you applied parabolic interpolation to the step-shaped wiggly plot signal in the end from which we extract the notes.

This directly leads me to (2): I imagine that these questions are answered in one of your previous videos. It’s great you referred to them, but it would be even better if you provide a 2 sentence summary or “flashback” to the previous videos. This way, I don’t have to stop the video and go back to a previous one to follow the explanation in the current video.

And lastly (3): When you mentioned why the original transcription of “Call me maybe” sounds so weird (drums vs. singing), I became very interested in the video and wanted to finish it. This would’ve been great to mention even earlier in the video. It would’ve also been cool if you’d show the output of the Yin algorithm right at the beginning, instead of just mentioning that it will improve the quality of the transcription a lot. ( I struggled to recognize the snippet in the end as “call me maybe”, but maybe that’s just because I didn’t listen to the song often enough)

Keep up your camera presence, it’s very cool to see your personality and you’re very likable. With a little bit of polishing on the technical explanation and logical flow, imo your content would be in a very high percentile of all YouTube videos :)

6.3

Nice presentation overall. But somehow nothing really stuck and I couldn’t tell you what the yin algorithm is. Unfortunately, I can’t say why.

6.1

This was a cool presentation and an interesting topic! I’m curious how you choose how many simultaneous notes to detect, and how you avoid detecting overtones as separate notes. That didn’t seem obvious to me from the video.

6.8

I really liked the MS paint style visuals and the low-budget feeling irl setup lol. It felt like a friend explaining a project/ study they really like. The casual explanations that are very simple were good. I think they helped me keep track of the main ideas better, but I also think they could have been more in-depth. I was pretty lost in many parts.

I also would’ve liked more summarizing generally or like points to stop and think about everything.

The examples from common pop songs were also really fun and a great hook.

I think the video overall was interesting but could’ve used better explanations along with making the intended structure more clear to the viewer.

6.2

your rooms echos. When you have the time, space, and money for it try to add some stuff to it especially the corners to break up the echo.

3.3

The audio quality could be quite easily enhanced with Audacity or Davinci Resolve or something! I would say the Fourier transform basis explanation could be made tighter: “a sine can’t be turned into a sine of a different frequency” is too vague and sounds wrong! Talk about linear independence which is what you mean. Your autocorrelation sign argument is a bit fuzzy: It isn’t non-positive at non-aligned times for arbitrary signals, e.g. a signal with strong low frequency content stays positively correlated across a wide range of small lags. I feel this is not an oversimplification you can gloss over as it is the setup for the octave error problem that the YIN algorithm was built to fix! The absolute threshold and best local estimate steps seem to be missing!

5.5

Great video, I had fun watching it.

Some things I wasn’t quite able to figure out though. As far as I understand, the difference method computes something like int ( x(t) - x(t + tau) )^2 dt and the correlation does int x(t) x(t + tau) dt. One is supposed to be better at sounds with increasing intensity, but I couldn’t understand why. It would have helped to have the graphs labeled I think. The subject is really interesting, but the explanations wasn’t always easy to follow. Keep it up, your presentation is great.

5

This video is very instructive … I know nothing about computer music neither music at all but with this video I can appreciate the idea… It is well explained with a lot of enthusiasm… keep that way!!