Closed rleathart closed 3 years ago
Since Fundamental will be packaged with VCV Rack for DAWs, I cannot accept contributions to this project. See https://github.com/VCVRack/Rack/blob/v1/.github/CONTRIBUTING.md I will make this more clear by adding a link to the README.
I've changed the VCO modules to only compute wave types that are actually connected.
Currently
VoltageControlledOscillator::process()
computes the samples for each wave type regardless of what is connected. We can save a non-trivial amount of CPU time by only processing the connected wave types. This is especially relevant for patches that use many oscillators.I'm just passing a new parameter to
VoltageControlledOscillator::process()
that enables or disables the processing for wave types based on theWaveIds
enum flags. This is set inVCO::process()
based on which outputs are connected. I'd have liked to useenum WaveIds
for the type ofenabledWaves
rather thanint
but C++ seems to make using enums as flags more difficult than C.I've also changed the
VCO
andVCO2
process methods to return immediately if there are no outputs connected since I can't see any reason for this to not be the case?I don't have any rigorous performance numbers but making these changes resulted in a patch of ~35 oscillators that was previously CPU clipping really badly become playable.