Cabbage Logo
Back to Cabbage Site

Hrange,vrange update?

Hi Rory, I wonder if you have any time/appetite for updating the appearance of hrange and vrange?

First of all, I found that they work much better in queue mode so have started using them again. I’m placing image behind each of them to indicate the empty channel beyond the tracker and using nsliders to display values left and right for upper and lower sliders. hrange doesn’t currently respond to valueTextBox(). valueTextBoxes are very useful for inputting precise values. Also double-clicking hslider to return it to its initial location is dead handy and would be lovely to have it in hrange too.

What do you or does anybody else think about adding any of this? I appreciate that there are certain layout challenges.

<Cabbage>
form caption("hrange") size(640, 400), colour(40,40,45), guiMode("queue"), pluginId("def1")
label     bounds( 65,  9,510, 13), text("RANGE"), align("centre"), $FONT_COLOUR
image     bounds( 75, 33,490,  4), colour("Black")
hrange    bounds( 65, 25,510, 20), channel("Upp","Low"), range(0, 1, 0.2:0.5, 1, 0.0001), trackerColour(100,100,100)
nslider   bounds(  5, 26, 60, 20), channel("UppD"), range(0,1,0.2)
nslider   bounds(575, 26, 60, 20), channel("LowD"), range(0,1,0.5)

hrange    bounds( 65,125,510, 20), channel("1","2"), range(0, 1, 0.2:0.5, 1, 0.0001)
hrange    bounds( 65,225,510, 20), channel("3","4"), text("RANGE"), range(0, 1, 0.2:0.5, 1, 0.0001)
hslider   bounds( 65,325,510, 20), channel("5","6"), text("hslider"), range(0, 1, 0.5)

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
kUpp,kT  cabbageGetValue "Upp"
         cabbageSetValue "UppD",kUpp,kT
kLow,kT  cabbageGetValue "Low"
         cabbageSetValue "LowD",kLow,kT

endin

</CsInstruments>
<CsScore>
i 1 0 z
</CsScore>
</CsoundSynthesizer>

Let me take a look Iain :+1:

I’ve added the double-click to reset to default. The value text box will be a bit of work. But I’ll try to get it done in the next few days. :+1:

1 Like

Thanks, Rory. That seems to work well.

Hi @iainmccurdy. I just pushed through those UI changes you requested. I hope these changes don’t lead to a range of other issues :crazy_face:

Thanks, Rory. I’m just testing that out now and it looks good.

I have one query, the increment value in the range identifier seems to be behaving oddly. For example, in your demo above, the first hrange is given an increment of 0.01 but is displaying to only 1 decimal place. Am I missing something?

It seems that if text("abc") is included, the text label is underneath the slider. Could it go above the hrange? Maybe you prefer it to be removed altogether as an option and for the user use a label instead for this purpose.

No, it should be above. It is in my example? I’ll take a look tomorrow and also the increment issue.

It’s just when valueTextBoxes are omitted that the label is placed at the left underneath the slider.

Yes, I see this now. The slider needs resizing…

New build triggered :+1: Here is the .csd I’m testing with.

<Cabbage>
form caption("hrange") size(640, 500),guiMode("queue"), colour("brown"), pluginId("def1")
hrange    bounds(65, 25, 510, 40), text("Range"), channel("Upp","Low"), valueTextBox(1), range(0, 1, 0.2:0.5, 1, 0.0001)
hrange    bounds(65, 85, 510, 40), channel("Upp1","Low1"), valueTextBox(1), range(0, 1, 0.2:0.5, 1, 0.01)
hrange    bounds( 65,145,510, 20), text("Range"), channel("1","2"), range(0, 1, 0.2:0.5, 1, 0.01)
vrange    bounds(66, 214, 50, 244) text("Range"), channel("min10004", "max10004") range(0, 1, 0:1, 1, 0.001)
vrange    bounds(126, 214, 50, 244) text("Range"), valueTextBox(1), channel("min10005", "max10005") range(0, 1, 0:1, 1, 0.001)
vrange    bounds(186, 214, 50, 244) valueTextBox(1), channel("min10006", "max10006") range(0, 1, 0:1, 1, 0.001)

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1


endin

</CsInstruments>
<CsScore>
i 1 0 z
</CsScore>
</CsoundSynthesizer>

Thanks, Rory. It all looks good now and increment seems correct.

The double-click reset functionality seems not to work any more though. It was working in a previous version.

What? You’re joking? Let me take a look…

Sorry about that. I’ve no idea where that code went. It’s back in now anyway, new build triggered.