Skip to content

Conversation

dsharlet
Copy link
Owner

This is basically a redo of #195, but goes even further and removes the oversample parameter completely. This simplifies the simulation code a bit.

The filtering it does after oversampling is basically just a box filter anyways, which may explain why this has little benefit. Maybe a higher quality filter would make oversampling more useful. But if that's the case and explains why this doesn't matter much, then this won't be a regression vs. the last ~10 years of LiveSPICE :)

@kostoskistefan
Copy link
Contributor

Here is what I've found out after a bit of testing:

There is a very slight difference in the audio when increasing the Oversample count. Besides solely relying on my ears and gear, I also rendered 2 tracks of the same guitar riff, one with Oversample = 1 and one with Oversample = 8. Then, flipping the phase on one of the tracks allowed me to hear the difference. I can't speak for everyone, but based on my ears, the difference is negligible. The iterations parameter however is a bit different. If I load the Marshall JCM800 2203 preamp modded.schx schematic, which is a bit more CPU heavy, setting the iterations to 64, makes the audio stutter from time to time, because my CPU can't catch up in real time. Lowering the iterations to 2, makes the CPU a bit more happy, even though the audio quality is signlificanly reduced. Setting the oversample to 8 and iterations to 64, absolutely crushes my system and I can't get a smooth playback even with the highest latency that my audio interface offers. I am using an older system, so I'm not sure how this behaves on newer ones.

Now, in my opinion, there are 2 points of view. If someone is using the VST just for mixing and not real time applications, then the Oversample and Iterations parameters can definitely be completely removed and set to a fixed value. If the VST is used for real time audio, then, having the option to lower the CPU load is good. But also, leaving the iterations option might make some people a bit confused, like, "what is this iterations parameter, what does it do?".

I've seen a lot of audio plugins use a "CPU scaling" option where you can choose between 2 or 3 values, Low, Medium (Optional) and High. Maybe something like that can be used here, where the Low value will be 2 iterations, Medium will be 16, and High will be 64.

Of course, there are tons of circuits that are not very CPU heavy and this parameter will basically be useless if you can use the highest iteration count without any problems.

Those are my thoughts about this, so please proceed as you think is best for LiveSPICE. I support any decision you make about this!

@dsharlet
Copy link
Owner Author

It's interesting you found a case where reducing the iterations improved performance. That invalidates one of the assumptions I was making about all this.

I really need to try to figure out a way to test this objectively. Maybe if I feed in very high frequency test signals I'll be able to measure a difference in our benchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants