Cabbage Logo
Back to Cabbage Site

Populate opcode clashing with items or text opcodes


I am having trouble using the populate opcode (using for loading in .wav files) paired with the items (tried the text item aswell but just assumes that loads text) opcode using the combobox. The populate opcode works correctly when using the standard combobox. However, when using the items opcode to create dropdowns in the combobox, the populate function cannot seem to be used in tandem as it simply overrides the dropdowns from being created.

My next port of call was trying to individually code the .wav files using the file() opcode but the combobox ignores that being an opcode and just takes it as text (I’m nearly 100% my syntax was correct and tried it several ways to no avail).

I think I am just getting the wrong end of the stick and there is quite an easy solve, but just wondering is it possible to load .wavs into a combobox when using dropdowns.

I think you mean populate() identifier? Opcodes are part of the Csound language, we typically refer to the little bits of Cabbage syntax as identifiers :slight_smile:

I’m not sure I follow this. Comboboxes are dropdown widgets? If you use the populate() identifier you don’t need to use the items() identifier. Maybe you can prepare a simple example of the issue and post the code?

Hi Rory,

I am so sorry for my lack of clarity last night, I was half asleep and it clearly showed :sleeping: (Hence why i kept referring to the identifiers as opcodes).

I have prepared a couple of examples and put them in a zip file. for the sake of clarity I just modified a very basic synth I found using comboboxes on the forum as there are many things going on in the synth I am creating which only further complicate things.

Basically, I want the .wav samples to appear in submenus instead of just one drop like in the items screenshot and cabbage example.

I tried to solve this problem in several ways so I attached a couple of files along with the sample audio to use.

Hope this is much clearer than what I posted last night.

Cheers again,

ComboBox (2.4 MB)

Right, I understand now. But I’m afraid there is no way to populate like this with submenus. The only solution I can think of would be to use two comboboxes, where the first one lets you select what bunch of samples will appear in the next one? Does this sound like something that might work, in terms of UI?

Ok perfect Rory thanks very much for clearing that up. I had a feeling that would be the case. The dual combobox system could work and will definitely keep it in mind.

Cheers again,
Mark. :+1:

1 Like