Optimizing nucleus for MetaModule
Hi @cosinekitty - wondering if you have any suggestions on where to start from optimizing Nucleus. It sounds really great - I attempted a port to MetaModule (I know 4MS already has a Sapphire library ported, but there are a few new modules in this library that aren't there) but I couldn't get it to run at 48khz, 256 block size without some serious accuracy changes that seemed to change the character of the sound.
The biggest change I made was to try and compute forces for dt and not do that twice in step. That helps a lot, but it sounds quite different.
Let me know if you have any ideas or if there's anything I can look into - thanks!
Hi @Ericxgao! Yes, the reason I calculate the forces twice is to reduce interpolation error. Optimizing Nucleus will be very difficult because the physical model is inherently demanding with number crunching. I doubt there is much low-hanging fruit, so to speak.
I am thinking about porting my chaos modules (Frolic, Glee, Lark) to MetaModule, because they are interesting, but don't use very much CPU.
@Ericxgao would you be interested in porting Frolic, Glee, and Lark? They are all mostly shared code, so it is really like porting a single module. And CPU efficiency definitely will not be a problem. I realize I am so focused on new development that I would be happy to let someone else do it. If so, I will be happy to provide assistance as needed.
I already did :)On May 10, 2025, at 9:44 AM, Don Cross @.***> wrote: cosinekitty left a comment (cosinekitty/sapphire#131) @Ericxgao would you be interested in porting Frolic, Glee, and Lark? I realize I am so focused on new development that I would be happy to let someone else do it. If so, I will be happy to provide assistance as needed.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
I'm sorry... I can't believe I forgot about that! I just found the "module finder" and now I see the supported modules. It looks like you got the ones that make sense already. I will keep thinking about how Nucleus might run faster.
Thanks! I had a few things that "worked" in terms of reducing CPU but with varying degrees of success.
Lowering particles from 5->4 works, but means that there are outputs that now get deleted when you transfer a patch from VCV to the MetaModule
The step function is by far the most expensive thing that runs. I can also get it to run on lower sample rates, but 48 khz 256 block size is my standard for quality/latency tradeoff. Very curious what you find and to learn how you profile/optimize this if you do get a chance to do so