Cabbage Logo
Back to Cabbage Site

Is there a way to make nslider corners square?

Even though it’s not documented specifically for nslider, I tried a radius property and a background image but neither of those methods seemed to do it.

There is no way to currently do this. But let me take a look and see if it can quickly be added…

[edit] I’ve added that now. I’ll run you off a new build later on today :wink:

1 Like

Thanks Rory - will check it out in a bit.

And does cabbageSet now replace ‘channelIdent’ and ‘chnset’?

Sure does. There are lots of examples in the new widget example files. Let me know if you have any problem. I’m going to pull the trigger on a new build now. Watch this space :+1:

OK, I tried to get it working but perhaps my syntax is wrong. Trying to move a control in and out of the interface depending on gkLFO1SyncMode

if gkLFO1SyncMode < 1 then 
        cabbageSet 1, "LFO1Rate", "bounds(5, 32, 65, 65)"
        cabbageSet 1, "LFO1BPMRate", "bounds(500, 32, 65, 65)"
     else
        cabbageSet 1, "LFO1Rate", "bounds(500, 32, 65, 65)"
        cabbageSet 1, "LFO1BPMRate", "bounds(5, 32, 65, 65)"
    endif

That looks ok to me although it might waste some cpu cycles depending on how you are calling it. You sure those channel names are correct? Maybe you can prepare a simplified csd?

P.s. do you have guiMode(“queue”) set in your form widget?

@chronopolis, this is working fine for me here:

Gui mode… once I added it it worked. And the square nsliders look awesome too. Thanks Rory.

Another quick question. I have some multisample programs in this new thing I’m building and each time I switch multisample presets it takes 2-3 seconds for the f-tables to load. Can you think of anyway to display a progress bar while this is happening? Perhaps a ‘shape’ widget that gets filled in by another shape? I guess I’m just wondering if there’s a way to ping the progress of the f-tables loading.

The progress bar is easy, I’m not so sure on how best to determine if the table has loaded?

Right. I think that’s where I’m running into trouble here. I guess I could put an arbitrary length for the progress bar - like 2.5s. Thanks.

And another one for you. Possible to update the ‘populate’ identifier for a combobox?
cabbageSet 1, "Preset", "populate", "*.txt, ~/PathToFiles/"

That identifier has always been i-time only.
You can call refreshFiles(), let me dig out an example. If you want to update the files you can do:

cabbageSet 1, "Preset", "refreshFiles(1)"

Just make sure it’s only called once, otherwise it will continuously try to update the file file.

I see - but I want to actually update the path that it refreshes from. The content isn’t changing but the path is.

Also - sorry lots of questions coming in today :roll_eyes: — is it possible to make listbox respond to single click rather than double? I spent about 20 mins thinking it wasn’t working until I dug into the docs and realized I had to double click. I can imagine many end-users would experience the same.

Yeah, that listbox issue is a weird one that kind of crept in when the first ever listbox user requested it!
I can sort that and add a flag.

Hmm, changing the directory that the combobox reads from. I guess having a dynamic populate() would be the answer to that, and we mean I can remove refreshFiles() which always felt a little cluncky. Leave it with me :+1:

1 Like

@chronopolis. It turns out you can already do this, although it only works for me when I use a sprintfk rather than pass the strings one by one. I’ll check that out. In the meantime, here’s a working instrument:

<Cabbage>
form caption("Test") size(600, 400), guiMode("queue"), colour(58, 110, 182)
filebutton bounds(22, 22, 80, 40) channel("filebutton1"), mode("directory")
combobox bounds(134, 26, 80, 20) channel("combo1"), populate("*", "Graindrop")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
    SFile, kTrig cabbageGetValue "filebutton1"
    cabbageSet kTrig, "combo1", sprintfk("populate(\"*\", \"%s\")", SFile)
endin

</CsInstruments>
<CsScore>
i1 0 z
;causes Csound to run for about 7000 years...
f0 z
</CsScore>
</CsoundSynthesizer>