jeremymuller / Sha-Bang-Modules

A collection of modules for VCV Rack
GNU General Public License v3.0
32 stars 2 forks source link

Photron eats CPU #13

Closed Petervos2018 closed 3 years ago

Petervos2018 commented 3 years ago

Simple case, new project, add Photron, close rack open rack watch the CPU go sky-high.

afbeelding

Windows 10.

Thanks, Peter.

jeremymuller commented 3 years ago

Ok, I was able to replicate it on my machine, too. Very strange...thanks for letting me know. I'll look into it.

jeremymuller commented 3 years ago

Ok this is weird. I've tried a few things...when I override the onSampleRateChange method and you change the sample rate in Rack, it actually reduces CPU usage back down to normal. Of course this isn't ideal because you have to do it everytime.

I made a post on the community forum since this is a real head-scratcher for me.

jeremymuller commented 3 years ago

Ok I was able to fix the problem, but I'm going to leave this open for a little bit while I try some things. It's ready for an update so keep an eye out when they do the next build.

Petervos2018 commented 3 years ago

The new one 1.1.1 is about 50 x as hungry as 1.1.0 but it stays that way when reloading.

afbeelding afbeelding

Thanks, Peter.

jeremymuller commented 3 years ago

Yeah, I know it's around 5%. That seems to make more sense because it has to process every block (adjacent and corners) about 60 times a second. I'm not sure why the v1.1.0 started out at ~0.1%, but with this amount of processing/drawing to the screen should be fairly normal. Will it work for you in your patches?

Petervos2018 commented 3 years ago

Honestly, I'm not using it yet in my patches, but 5% is about what valley reverb uses, and I'm mostly using 1 of them not bunches. We'll see what the future brings. Thanks for ALL your modules, not only Photon. Greetings Peter.

jeremymuller commented 3 years ago

Yeah, I also noticed Vult's Trummor2 module uses about 4% so I was hoping that Photron being a heavy visual animation module would be ok at 5%.

Thank you for your kind words. I'm glad you enjoy them!

jeremymuller commented 3 years ago

Ok in the next version there will be a right-click menu that gives you the option to change the processing rate from 60Hz (default) to lower ones like 30Hz. Could also be a cool effect if you wanted the animation to evolve slower.