DEV Community

Andrew Luchuk
Andrew Luchuk

Posted on

1

Designing a Full-Featured Web Synthesizer

Recap

I ended my last post with a working prototype of a Rust and WebAssembly based synthesizer using wasm-pack to build the JavaScript wrappers. Now that the prototype is complete, it's time to start designing and building a more feature-complete synthesizer.

This update will be short compared with previous entries.

Architecture

Here is an overview of the architecture I plan to use for the synthesizer.

Design Diagram

The entry point for the synthesizer will be a wrapper struct that starts the process of fully synthesizing the sound:

The wrapper starts by sending information about the note that should be playing to the oscillator bank which will use that information to generate the initial audio buffers. From there, the audio buffer will be passed along the chain of modifiers to apply filters and other transformations to the audio. Finally, the audio buffer will be returned to the wrapper to be passed back to the best available audio device.

Why this design?

I chose this design to keep the code base as flexible as possible. I eventually want to turn the synthesizer into a plugin for digital audio workstations. To achieve that goal, I want to make the design as generic as possible so that it will be easily compatible with many different plugin formats.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay