I’m having an issue with audio quality in Cabbage3, every time I run the file the console returns “ksmps = 10” no matter what I declare ksmps as in Csound. I wonder if it has something to do with kr = sr / 10? Does JUCE impose its own configuration before csound instruments are run?
In the two files attached, the code is identical apart from the UI (one for Cabbage2, one for Cabbage3) but the difference in audio is night and day. Cabbage2 is perfect/clean, in Cabbage3 there is a strong resonance frequency above the input pitch which scales with amplitude, making it the most prominent frequency. It seems the pvscaling is working fine but something is off with the audio buffer/processing.
Also no matter what I change k-rate or ksmps to, I get “kr = 4410, ksmps = 10” in the console. Also having issues with 0dBFS = 1 vs 32768.
In cabbage2, the console IDE returns:
sr = 44100.0, kr = 344.531, ksmps = 128
0dBFS level = 1.0, A4 tuning = 440.0
audio buffered in 1024 sample-frame blocks
In Cabbage3 the VSCode console returns:
sr = 44100.0,
kr = 4410.000,
ksmps = 10
0dBFS level = 32768.0,
A4 tuning = 440.0
audio buffered in 128 sample-frame blocks
ksmpsbug-cabbage3.csd (592 Bytes)
ksmpsbug-cabbage2.csd (625 Bytes)
I’m on macOS - Sonoma 14.6.1
I’m not sure what’s going on for you, it runs as expected for me 
Ok I think I’ve figured it out:
When I include “nchnls = 2” in my current Audio MIDI Setup (1 in and 2 outs), the audio breaks - when I include “nchnls = 1” the audio quality is perfect but is mono (left only).
But when I create a new aggregate audio device in the Audio MIDI Setup App with 2 ins and 2 outs (using the same ins and outs as the first time, but adding another input which is not used in the file), then set “nchnls = 2” the audio sounds great.
The audio quality has returned, but ksmps is still being forced to 10 for some reason
Ok fixed!
I have to include the following at the top of the instruments section:
#define MY_BLOCK_SIZE #64#
ksmps = $MY_BLOCK_SIZE
Strangely I’m still seeing this printout in the console:
sr = 44100.0,
kr = 4410.000,
ksmps = 10
This is no different to doing ksmps = 64?
No matter what I set ksmps = to (64, 128, 256, 512), it just shows “ksmps = 10” in the console.
Even if I let “ksmps = 64” , then later include “setksmps 64” within the instrument, I get “ksmps = 10” in the console.
If I dont include the #define MY_BLOCK_SIZE lines it just ignores any ksmps declarations.
But the thing is… even with the #define command it STILL shows “ksmps = 10” in the console output. Even though the audio runs perfectly and ksmps is clearly not set to 10 (if it was the audio buffer wouldn’t run correctly and it would sound horrible, but it sounds fine!).
Try adding --ksmps=64 to your CsOptions. This is a brute force override.
No joy unfortunately, I still get the following output:
sr = 44100.0,
kr = 4410.000,
ksmps = 10
0dBFS level = 32768.0,
Can you try running this file from the command line with Csound 7?
ksmps.csd (264 Bytes)
You’ll need to call the Csound that is installed to /Applications/Csound, i.e,
cd /Application/Csound
csound ~/Downloads/ksmps.csd
Let me know what you see here..
I’ve tracked this down to an issue in your .csd file which is causing Csound to exit. This is good news, now I can look for a fix
Btw, it is likely to be an issue with something else rather than you’re code, which just happens to trigger it..
1 Like
I tried your attached command but t’s calling csound 6.18, I got it to call csound 7 but I get a similar error in both:
–Csound version 7.0 (double samples) Mar 4 2026
[commit: 32fe6c37f4d382e1b25d4a5fccf0e0fccc3ffa85]
Csound Command ERROR: no outfilename
overall amps: 0.0
overall samples out of range: 0
0 errors in performance
Elapsed time at end of performance: real: 0.000s, CPU: 0.000s
Actually, the error is right there in the Csound output:
error opening file '/Users/colmdelaney/Downloads/Chordable-Mar26-v130/debug.csv'
from file /Users/rwalsh/Downloads/Chordable-Mar26-v130/Chordable-Mar26-v130.csd (1)
fprintks
gSlogfile:S,
"%.4f,%.2f,%.6f,%.6f,%.0f,%.0f,%.0f,%.0f,%.3f,":S,
ktime:k,
kfreq:k,
kamp:k,
krms:k,
kmidiin_raw:k,
kmidiin:k,
kmidi:k,
kharmtest:k,
kaccuracy:k
B 0.000
INIT ERROR in instr 1: note deleted (1 init errors)
When I change this to a valid path, it runs fine, and ksmps is repoting the correct value. So if your seeing ksmps is 10, that’s a sign that something is not running correctly with your .csd file. If you enable Cabbage: Log Verbose, you’ll get a lot more info printed. Should help us track this down 
Sorry, there was an issue with the .csd file, I’ve updated, can you try it again now? But I think it’s likely an issue with your .csd file itself.
Great - something seems to be running better, I get the following output when running the updated ksmps.csd in terminal:
sr = 44100.0, kr = 1378.125, ksmps = 32
0dBFS level = 1.0, A4 tuning = 440.0
The ksmps issue is solved thanks to the last update, but I’m getting strange behaviour when I use the default “external headphones” Audio MIDI Setup Aggregate device, I get strange audio buffer glitches when I select the default device (mono input, stereo output).
When I select my created aggregate device with two mono inputs and one stereo output it works fine
Does you csd match this channel setup?
I fixed a few issues with this earlier today. There is a new build available now to test. While you can use Csound’s nchnls/nchnls_i, it’s better to manage the inputs/outputs with the channelConfig object instead. The reason is simple: Csound can’t set the number of channels a plugin uses in a DAW. That’s up to the DAW to decide, based on a nudge from the plugin. More details can be found it the documentation.
yes no matter what I declare sample rate to in my file, or using the cabbage commands (ctrl + shift + p) or setting it in the options tab, the csound console always outputs 44100.
Also when I use either of the following ins/outs I get robotic audio:
- the normal Mac ins/outs for either the MacBook itself (MacBook Speakers/Microphone)
- the default ins/outs for my Apple earphones (External Headphones)
Only when I create a custom aggregate driver (2 mono ins, 1 stereo out with one additional unused mono in) does it fix the robotic voices issue, but I still get sr = 44100 always.
I’m not sure if the sr - 44100 and default audio driver issues are related, but I would assume so.