Cabbage Logo
Back to Cabbage Site

Effects of setting high ksmps?

Say I change the standard ksmps setting from 32 to 512. It improves CPU-usage majorly, but could this cause any other problems when running the plugin? Perhaps there’s a reason why the standard setting is 32?

Latency is the key issue when increasing ksmps size. Csound has to process ksmps samples before it can return them to the output buffer, so you need to make a call on how important realtime IO is to your plugin…

Okey, so it would increase the latency for outputting a-rate variables, not only k-rate?

The k-rate stuff won’t be an issue. It will be the round trip time for an audio signal going into your plugin and returning. It’s less of an issue with a synth than an effect.

1 Like

So setting ksmps to 512 would create a latency of:

512 / 48000 = 0.01 sec


Correct :+1:

In general I would not recommend to increase ksmps. Actually, there are several plugins for which I had to reduce ksmps even below 32 for two reasons:

  1. Envelopes are sampled to slow. This may create a scratching noise for fast attacks or decays.
  2. Iterative calculations have to be done. That’s mainly for physical modelling. Then you have to use ksmps=1.

You should probably just use audio rate enveolpes for everything?

This can be done within a UDO. That way the global ksmps can be higher :+1: