Web Assembly, Music Synthesis, And The Beauty Of Math

The electronics hobby has changed a lot since the advent of the microprocessor. Before that — and with the lack of large-scale integrated circuits — projects in magazines tended to be either super simple or ultra complex. However, one popular type of project dealt with music synthesis. Fairly simple circuits could combine to make a complex synthesizer so it was sort of the best of both worlds. Nowadays, you are more likely to tackle a music synthesizer in software like [Tim] did when he created Abelton in Web Assembly and C++. Along the way, he learned a lot about the relationship between math and music.

[Tim] covers what he learned about the Nyquist theorem and how to keep synthesis data flowing in real time with buffers. However, there are some problems trying to do all this in a cross-browser context. The AudioWorklet class appears to have widespread support, though, and [Tim] managed to get that working.

If you ever wondered if you could use a formula to compute MIDI tones to frequency instead of a table, the answer is yes. Using emscripten allows easy compilation, but integrating into rollup.js — a JavaScript framework — was a bit of work, and you’ll find the process documented in the post.

If you want to know more about WebAssembly, check out our earlier post. We’ve seen emscripten do interesting things on the Web before, too.

9 thoughts on “Web Assembly, Music Synthesis, And The Beauty Of Math

  1. And nobody complained that the complicated projects were too hard. They dud want simoke projects, but they didn’t say “let’s not see complicated projects until some device can be invented that does it all”.

    So people wrote about complicated subjects like under under the noise reception and building a converter to receive an early satellite. Or build a computer from discrete components. If you didn’t build it, you coukd still learn from the article.

    And yes, you could use 555s in music synthesizers, in the VCO and and envelope generator. And opamps for much of the rest.

    1. I literally read it to see if my memory was wrong and he actually “created Abelton(sic)”, but no, just a synth. Still super cool, but the write-up creates a let-down. Maybe Al hasn’t heard of Ableton Live.

    2. Maybe Tim created a replica of Ableton products with “Abelton” branding? Like “Sonny” and “Luis Viutton”?

      (It’s almost a pet peeve of mine on product names like “VCV” for Rack and “Ableton” for Live.)

  2. Without watching the video I read …building AN Ableton Live synth… Some small words have impact. Just one of many builds.

    I use ZynAddSubFX, free and just a synth not a workstation world unto itself.

  3. Whilst I admire the journey he went through and the way he documented it, it might lead the you to imagine that it is necessary. Most synths are made up of a chain of components to create the sound you want. The built in BaseAudioContext contains a great set of tools (oscillators, filters, timing, shaping) which would allow you to build a quite sophisticated synth with a fraction of the effort.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.