FM oscillators/LFOs by adding GPU state

Captain's Log: Stardate 77412.2

LFOs and exciter-oscillators now work really well with frequency modulation (FM), both at LFO frequency and audio frequency. Previously this was a really difficult problem, because in order to avoid GPU memory writes I was doing stateless computation for the waveforms. But trying to get this stateless model working with FM was extremely difficult (maybe impossible). I ended up going with a much more typical phase-incrementing model, and it turned out to be faster than my stateless "optimizations." Which is the 107th time that I've learned the lesson to benchmark everything.

The nice thing is that not only do the LFOs and oscillators sound good under FM, but also the simulation is a little bit faster, and new possibilities have opened up. The former stateless model ruled out certain things like good mic compressors, but now that is something that I can (and will) implement. Still, there are a lot of restrictions here, mostly due to the amount of shared memory being so small. Right now I'm dedicating 32 bytes of shared memory to each entity for state, and I don't think I'd like to go to 64 bytes as that would halve the number of entities.

Another really good outcome is that the new data model made it really easy to get the modulator output values back out of the GPU so they can be used to e.g. animate the modulators in the 3D GUI.

I'm now getting closer to the next big demo video. I wanted to do it earlier, but modulators had to sound good first. Now that that's solved, the remaining work is to make sure that the animations all work correctly in the 3D GUI, and fix a few rough edges in the new code, and then I think I'm ready to produce the next video.


© 2024 Anukari LLC, All Rights Reserved
Contact Us|Legal