A synth for experimenting with SIMD techniques

Hi JUCE folks,

For educational purposes, I built a new synth plugin that uses SIMD techniques on both ARM and x86, and I thought I’d share it for anyone else interested in this topic - its pretty rudimentary, but functions well enough to produce 8-voices of polyphony, and I’ve produced a small set of presets for further development purposes.

I would love to get some feedback from others who are interested in this topic:

Screenshot:

Repo:

EDIT: Just wanted to add that the UI is, obviously, a work in progress .. gotta add labels and sort out some Flexbox issues, but .. nevertheless, is still pretty functional.

6 Likes

This allows you to write the SIMD code once and compile equivalent functions on all platforms:

So you could write SSE/AVX code, and when targeting ARM64, it automatically uses NEON instructions. You can also write NEON code, and it compiles to SSE/AVX.

1 Like

@refx - that is very handy, thanks for that! I’m enjoying learning things bit for bit for now, but I will definitely have a closer look at simde-everywhere soon for more details. Have you used it in your projects?

Yes, we use it extensively. Wherever possible, we combine left/right into SIMD datatypes and then perform the DSP for left/right simultaneously. We also have several special algorithms that take advantage of the multi-processing and always use the SIMDe to generate the NEON version.

Our optimization specialist uses the SSE versions because he’s more familiar with them, and they offer more features than the NEON instructions.

Ah, very interesting. I’m using SIMD for per-voice calculations. I hadn’t thought about the stereo optimization path, though. Also, that SSE → NEON is another path, hadn’t thought of. Thanks for that!

May I know why you decide not to use KFR for SIMD operations? Is it because you need some fine controls over SIMD or some performance issues? I do like the idea of dynamic dispatch so KFR and highway are quite attractive to me.

@zsliu98 - I’m learning SIMD basically, so I haven’t caught up with you yet. :wink: This isn’t a commercial project, more of a lab workbench to get a good grasp on the issues. So far, I have learned a lot in the few weeks I’ve been hacking at it.

Its pretty clear that there are a great deal of giants’ shoulders for me to stand on, but I’m trying to get a personal understanding of things with SIMD at a low level, and don’t really want to leverage other libraries/methods until I’ve got a grasp on things with SIMDSynth.

Today I optimised a fair bit and got things up to 16 voices with pretty decent performance. I’ll add a few more features to the engine and then start taking a look at, for example sime and KFR in the context of my existing code. Good advice though!