What is a harmonic? An interactive comic about additive synthesis

40 points by suda


chrismorgan

The second part, on timbre¹, is the key to pipe organ synthesis. Pipe organs have a variety of sounds, and the differences all boil down to the amplitudes of the different harmonics. Historically, pipe organ synthesis has involved a large number of parameters to control this, which is a lot of work. But somewhat more recently, Colin Pykett investigated the topic and ultimately came up with trendline synthesis, allowing you to model all of the normal types of pipes with no more than four parameters—far more manageable!

Then, you say, why doesn’t that flute, clarinet, violin sound like a pipe organ? Room acoustics. Seriously, echoes make up most of the effect of a pipe organ. And guess what? You can map the impulse response of a room and apply convolution, and the result is basically perfect.

End result: using something like the Web Audio API, you can synthesise a startlingly realistic organ pipe in significantly less than a hundred lines of code (plus an impulse response audio file for your desired room). The synthesis is the easy part—it’s gluing the organ together that will take more code.

I doubt I’ll get to it this year, but I’m really looking forward to adding a pipe organ to my website.

—⁂—

¹ You say “say it tambre”—it’s not consistently so. Growing up in Australia, I did come across /ˈtæmbər/ sometimes, but I heard /ˈtɪmbər/ a lot more. Wikipedia recognises these two and one other pronunciation as common.

ifreund

Very nice interactive examples!

Am I going crazy or is the 3rd to last note of the melody in the Timbre example a half step too low?

I hear C B A G# F G# A but my ear says that the F should be an F#...

chrismorgan

The interactive part doesn’t work for me, Firefox on Linux. Relevant excerpts from my console:

Specified “type” attribute of “video/mp4; codecs=hvc1” is not supported. Load of media resource /wp-content/uploads/dot-dev-tailwind/videos/Harmonic-220-Alpha-HEVC.mov failed. Trying to load from next <source> element.

All candidate resources failed to load. Media load paused.

And apparently this stops even the audio from working.

When I load the files directly:

  1. The .mov file (incidentally served as video/quicktime, video/mp4 is wrong, but it doesn’t make a difference) plays just fine when loaded directly, and ffprobe tells me it is hvc1, so I’m not sure why Firefox isn’t accepting it in that way.

  2. The .webm file isn’t playing at all, and I don’t know why.

    Media resource https://melatonin.dev/wp-content/uploads/dot-dev-tailwind/videos/Harmonic-660-Alpha.webm could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005)
    Details: auto mozilla::MediaChangeMonitor::CreateDecoderAndInit(MediaRawData *)::(anonymous class)::operator()(const MediaResult &) const: Unable to create decoder