madskjeldgaard / portedplugins

A collection of plugins for the SuperCollider sound environment, all of which are ported / remixed from elsewhere
GNU General Public License v3.0
180 stars 13 forks source link

SIMD status for these plugins? #31

Open jamshark70 opened 2 years ago

jamshark70 commented 2 years ago

I'm curious if these plugins are getting SIMD-optimized during compilation. I suspect not, as they are very CPU hungry (e.g. 2 instances of AnalogTape = 17-18% CPU). So, for instance, I might use the VA filters for a monophonic bass line but I would have to avoid too many of them at once.

I'm afraid my C++ skills are not good enough to review the plugins for this. Spacechild1 had pointed out to me on the SC forum that 8-sample loops can clue the compiler in to places where SIMD instructions could be used. This resulted in a massive speedup for me.

madskjeldgaard commented 2 years ago

I agree - I think this would be awesome. I don't think (this is the disadvantage of only porting other's code and not writing it yourself from the ground up) that it's not simd optimized.

If anyone has pointers on how to do it, I can look into it and mess around with it at some point. As an alternative we could also port the Surge ports of the same, they seem to have someting along those lines going on?

https://github.com/surge-synthesizer/surge/blob/main/src/common/dsp/filters/K35Filter.cpp#L111

https://github.com/surge-synthesizer/surge/blob/0b36ab24d0fe2a1810d29f57e0e0a0cee8af0013/doc/Adding%20A%20Filter.md

madskjeldgaard commented 2 years ago

It would be really awesome to fix all three of these filter related issues(https://github.com/madskjeldgaard/portedplugins/issues/30 and https://github.com/madskjeldgaard/portedplugins/issues/28). They're all big and important improvements IMO