CPU Usage/Crackling Reduction! - Quick Update (Patreon)
Content
tl;dr - I found a new approach that significantly reduces the amount of CPU used by Generative.fm pieces. In one case, it brought CPU usage from 45% to 5%. This means pieces using this approach won't crackle so much.
Hey there, just wanted to share some exciting news. As you've probably noticed before, most of the pieces on Generative.fm use a lot of your computer's processing power. If you've listened on older hardware, on a smartphone, or while your processor was occupied with other tasks, you've probably heard some crackling. This happens when your device can't keep up with the site's demands. Unfortunately, generating audio data on-the-fly as Generative.fm does is significantly more difficult than just playing back a recording.
I've been working on a new piece this week that was using about 45% of my computer's CPU as it played even though it was pretty simple. At the same time, I was writing an article about the resources needed by generative music systems like Generative.fm. This really got me thinking about what I could be doing differently to reduce the strain that Generative.fm puts on CPUs, and I decided try something new. Long story short, my new approach worked better than I had hoped, and the piece I'm working on now uses only 5% of my CPU while playing even though it sounds the same.
Since the piece uses so much less CPU, it won't crackle nearly as much as some of the other pieces. I'll be able to use this approach on other pieces going forward, so they'll perform well too. I can even go back and "fix" some of the old pieces (but not all)—let me know if you have any requests!
If you're interested, I'll be posting an article later explaining what I'm doing differently in technical detail (spoiler: it's not ground-breaking).
As always, thanks for being here. I hope you stay safe and healthy!