Working with presets in Cabbage 3 with custom UI

The following is working for me here?

instr 1
    dirs:S[] = ["/Users/rwalsh/sourcecode/cabbage3-recipes/samples/GridSequencerPresets", "/Users/rwalsh/sourcecode/cabbage3-recipes/samples"]
    cabbageSet "presetCombo", "populate.directories", dirs
endin

So is this:

instr 1
    cabbageSet "presetCombo", "populate.directories", ["/Users/rwalsh/sourcecode/cabbage3-recipes/samples/GridSequencerPresets", "/Users/rwalsh/sourcecode/cabbage3-recipes/samples"]
endin

If you enable verbose logging, it will show some debug logs, they might contain some useful info.

DEBUG: Received onFileChanged message for file: c:\Users\Dale\Desktop\GridSequencer\GridSequencer.csd [CabbageAudioApp.cpp (308) CabbageAudioApp::processIncomingMessage Thread ID: 18964]

DEBUG: File exists, adding InitCabbage to queue [CabbageAudioApp.cpp (313) CabbageAudioApp::processIncomingMessage Thread ID: 18964]

DEBUG: Received onFileChanged message for file: c:\Users\Dale\Desktop\GridSequencer\GridSequencer.csd [CabbageAudioApp.cpp (308) CabbageAudioApp::processIncomingMessage Thread ID: 18964]

DEBUG: File exists, adding InitCabbage to queue [CabbageAudioApp.cpp (313) CabbageAudioApp::processIncomingMessage Thread ID: 18964]

DEBUG: Processing InitCabbage command [CabbageAudioApp.cpp (727) CabbageAudioApp::onIdle Thread ID: 12036]

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (943) CabbageAudioApp::addDevicesToSettings Thread ID: 12036]

DEBUG: Attempting to start audio with the following settings:

SR: 44100

Buffer Size: 512

Input device: Default Device

Number of input channels: 2

Output device: Default Device

Number of output channels: 2 [CabbageAudioApp.cpp (556) CabbageAudioApp::initialiseAudio Thread ID: 12036]

DEBUG: RtApi::openStream: a stream is already open! [CabbageAudioApp.cpp (636) CabbageAudioApp::errorCallback Thread ID: 12036]

DEBUG: RtApiWasapi::startStream(): the stream is already running! [CabbageAudioApp.cpp (636) CabbageAudioApp::errorCallback Thread ID: 12036]

DEBUG: Resetting csound ...

csound = 0000023005286C70 [Cabbage.cpp (150) cabbage::Engine::setupCsound Thread ID: 12036]

DEBUG: Merged populate config (processing deferred to avoid blocking) [CabbageParser.cpp (330) cabbage::Parser::mergeJsonProperties Thread ID: 12036]

DEBUG: === Starting addParameters() === [CabbageProcessor.cpp (134) CabbageProcessor::addParameters Thread ID: 12036]

DEBUG: Total widgets: 2 [CabbageProcessor.cpp (135) CabbageProcessor::addParameters Thread ID: 12036]

DEBUG: Created numeric channel for non-automatable widget 'formChannel' with default value 0 [CabbageProcessor.cpp (306) CabbageProcessor::addParametersForWidget Thread ID: 12036]

DEBUG: Created string channel for non-automatable widget 'presetCombo' [CabbageProcessor.cpp (299) CabbageProcessor::addParametersForWidget Thread ID: 12036]

DEBUG: === Finished addParameters() === [CabbageProcessor.cpp (177) CabbageProcessor::addParameters Thread ID: 12036]

warning:

could not open library 'C:\Program Files\Csound7\plugins64\\osc.dll' (-1)




Reading CSD file:  c:\Users\Dale\Desktop\GridSequencer\GridSequencer.csd

--Csound version 7.0 (double samples) Dec 28 2025

[commit: 45b655eec6a0a24a1d737ff6253ef05f2ac5911f]

using callback interface

Compiling Csound code...

warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 44




warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 44




warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 57




warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 57




...done

Elapsed time at end of code compilation: real: 0.002s, CPU: 0.002s

using libsndfile-1.2.2

displays suppressed

sr = 44100.0,

kr = 4410.000,

ksmps = 10

0dBFS level = 1.0,

A4 tuning = 440.0

audio buffered in 256 sample-frame blocks

SECTION 1:

DEBUG: Num widgets : 2 [CabbageAudioApp.cpp (464) CabbageAudioApp::createCabbageProcessor Thread ID: 12036]

DEBUG: Cabbage processor created successfully [CabbageAudioApp.cpp (730) CabbageAudioApp::onIdle Thread ID: 12036]

DEBUG: setCabbageIsReady() called [CabbageProcessor.cpp (754) CabbageProcessor::setCabbageIsReady Thread ID: 12036]

DEBUG: Processing InitCabbage command [CabbageAudioApp.cpp (727) CabbageAudioApp::onIdle Thread ID: 12036]

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (943) CabbageAudioApp::addDevicesToSettings Thread ID: 12036]

DEBUG: Attempting to start audio with the following settings:

SR: 44100

Buffer Size: 512

Input device: Default Device

Number of input channels: 2

Output device: Default Device

Number of output channels: 2 [CabbageAudioApp.cpp (556) CabbageAudioApp::initialiseAudio Thread ID: 12036]

DEBUG: RtApi::openStream: a stream is already open! [CabbageAudioApp.cpp (636) CabbageAudioApp::errorCallback Thread ID: 12036]

DEBUG: RtApiWasapi::startStream(): the stream is already running! [CabbageAudioApp.cpp (636) CabbageAudioApp::errorCallback Thread ID: 12036]

DEBUG: Resetting csound ...

csound = 000002300531FD40 [Cabbage.cpp (150) cabbage::Engine::setupCsound Thread ID: 12036]

DEBUG: Merged populate config (processing deferred to avoid blocking) [CabbageParser.cpp (330) cabbage::Parser::mergeJsonProperties Thread ID: 12036]

DEBUG: === Starting addParameters() === [CabbageProcessor.cpp (134) CabbageProcessor::addParameters Thread ID: 12036]

DEBUG: Total widgets: 2 [CabbageProcessor.cpp (135) CabbageProcessor::addParameters Thread ID: 12036]

DEBUG: Created numeric channel for non-automatable widget 'formChannel' with default value 0 [CabbageProcessor.cpp (306) CabbageProcessor::addParametersForWidget Thread ID: 12036]

DEBUG: Created string channel for non-automatable widget 'presetCombo' [CabbageProcessor.cpp (299) CabbageProcessor::addParametersForWidget Thread ID: 12036]

DEBUG: === Finished addParameters() === [CabbageProcessor.cpp (177) CabbageProcessor::addParameters Thread ID: 12036]

warning:

could not open library 'C:\Program Files\Csound7\plugins64\\osc.dll' (-1)




Reading CSD file:  c:\Users\Dale\Desktop\GridSequencer\GridSequencer.csd

--Csound version 7.0 (double samples) Dec 28 2025

[commit: 45b655eec6a0a24a1d737ff6253ef05f2ac5911f]

using callback interface

Compiling Csound code...

warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 44




warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 44




warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 57




warning:

opcode printf_i has been renamed (uppercase to lowercase / underscores removed), line 57




...done

Elapsed time at end of code compilation: real: 0.002s, CPU: 0.003s

using libsndfile-1.2.2

displays suppressed

sr = 44100.0,

kr = 4410.000,

ksmps = 10

0dBFS level = 1.0,

A4 tuning = 440.0

audio buffered in 256 sample-frame blocks

SECTION 1:

DEBUG: Num widgets : 2 [CabbageAudioApp.cpp (464) CabbageAudioApp::createCabbageProcessor Thread ID: 12036]

DEBUG: Cabbage processor created successfully [CabbageAudioApp.cpp (730) CabbageAudioApp::onIdle Thread ID: 12036]

DEBUG: setCabbageIsReady() called [CabbageProcessor.cpp (754) CabbageProcessor::setCabbageIsReady Thread ID: 12036]

new alloc for instr 1:

DEBUG: populate property must be an object for widget type: comboBox [CabbageParser.cpp (334) cabbage::Parser::mergeJsonProperties Thread ID: 15604]

DEBUG: Checking widget for populate config: presetCombo [CabbageProcessor.cpp (476) CabbageProcessor::onIdle Thread ID: 15604]

DEBUG: Widget has populate field, type: object [CabbageProcessor.cpp (479) CabbageProcessor::onIdle Thread ID: 15604]

DEBUG: Populate config: {"defaultLabel":"Load Preset","directories":[""],"fileType":"*","fullFileAndPath":false,"labelWhenEmpty":"No Presets","order":"date"} [CabbageProcessor.cpp (490) CabbageProcessor::onIdle Thread ID: 15604]

DEBUG: Triggering processPopulateAsync for widget: presetCombo [CabbageProcessor.cpp (502) CabbageProcessor::onIdle Thread ID: 15604]

DEBUG: populate property must be an object for widget type: comboBox [CabbageParser.cpp (334) cabbage::Parser::mergeJsonProperties Thread ID: 15604]

DEBUG: processPopulateAsync thread started for widget: presetCombo [CabbageParser.cpp (877) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: populateConfig received: {"defaultLabel":"Load Preset","directories":[""],"fileType":"*","fullFileAndPath":false,"labelWhenEmpty":"No Presets","order":"date"} [CabbageParser.cpp (890) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: fileType: * [CabbageParser.cpp (916) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: Adding directory:  [CabbageParser.cpp (923) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: Scanning directory:  [CabbageParser.cpp (931) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

WARNING: populate directory does not exist or is not a directory:  [CabbageParser.cpp (935) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

WARNING: No files found in directories [] with type '*' [CabbageParser.cpp (964) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: Total files found: 0 [CabbageParser.cpp (1050) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: No files found, using labelWhenEmpty [CabbageParser.cpp (1058) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: Result items count: 1 [CabbageParser.cpp (1064) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: Calling callback with result [CabbageParser.cpp (1068) cabbage::Parser::processPopulateAsync::<lambda_1>::operator () Thread ID: 19060]

DEBUG: Populate callback received for widget: presetCombo [CabbageProcessor.cpp (507) CabbageProcessor::onIdle::<lambda_2>::operator () Thread ID: 19060]

DEBUG: Result contains items: yes [CabbageProcessor.cpp (508) CabbageProcessor::onIdle::<lambda_2>::operator () Thread ID: 19060]

DEBUG: Items count: 1 [CabbageProcessor.cpp (510) CabbageProcessor::onIdle::<lambda_2>::operator () Thread ID: 19060]

DEBUG: Updated widget items in internal state [CabbageProcessor.cpp (517) CabbageProcessor::onIdle::<lambda_2>::()::<lambda_1>::operator () Thread ID: 19060]

DEBUG: Enqueued widget update for idle thread processing [CabbageProcessor.cpp (534) CabbageProcessor::onIdle::<lambda_2>::operator () Thread ID: 19060]

DEBUG: Merged populate config (processing deferred to avoid blocking) [CabbageParser.cpp (330) cabbage::Parser::mergeJsonProperties Thread ID: 15604]

DEBUG: Merged populate config (processing deferred to avoid blocking) [CabbageParser.cpp (330) cabbage::Parser::mergeJsonProperties Thread ID: 15604]

B  0.000 ..  1.000 T  1.000 TT  1.000 M:

0.00000

0.00000




new alloc for instr 2:

Number of presets found: 1

Found preset: No Presets at index 0

new alloc for instr 3:

Current preset is:  at index 0

That seems to show that the directory doesn’t exist. Aew you trying my simple example, or the grid sequencer?

Yeah trying your example

I’ll have to check myself on Windows, could be a platform issue. Maybe it’s not parsing the directories correctly there.

It does parse it when it is a single string though, any upstream changes that didn’t make it into the release?

This works fine, just when I wrap it in an array, it doesn’t work

I don’t think so, I need to run it myself on Windows to see why its failing.

That’s odd. There was an issue in my code that should have prevented this for working on MacOS too, but somehow I couldn’t recreate the issue there. Fixed now.

Nice, now it populates correctly, pulling the presets from the different folders aswell :grinning_face_with_smiling_eyes:

1 Like

hello, just posting in here because I notice hdale94 had a similar issue to me..

In my csound file (cabbage3 + csound7) I am settings ksmps to 64, but when I run the file I always get the following in the console:
sr = 44100.0,
kr = 4410.000,
ksmps = 10

It’s as if something is forcing ksmps to 10 which breaks the rest of my file (phase vocoder opcodes) because it all runs on multiples of 64, causing awful audio quality

That’s odd, I just tried quite a few examples here and they all report the correct ksmps. Do you have a simple example you can share? I wonder if the issue isn’t caused elsewhere?