Cabbage Logo
Back to Cabbage Site

3d objects in gui

I think so. You might also want to reduce the file size of those images too. They probably don’t need to be so big…

seems like a whole lot of work making the strip in blender…
ended up using
https://www.wavesfactory.com/blog/posts/strip-generator/
instead !

1 Like

Trying to make the spin indefinitely with some triggers but there’s no overwrite on the widget value while holding down control of the widget value.
I hope the filmstrip could make it possible.
Is there a way to access the position on the strip ?

tuning peg test.csd (810 Bytes)

How about (with endless encoder):

<Cabbage>
form caption("Untitled") size(400, 300), guiMode("queue"), colour(22), pluginId("def1")
encoder bounds(162, 102, 100, 110), channel("tuningSlider"), alpha(0), increment(10)
image bounds(162, 102, 100, 110) channel("tunerImage"), file("peg_nr_01.png"), mouseInteraction(0)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d 
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

opcode setImg, 0,k
    kIndex xin
    SImg sprintfk "file(\"peg_nr_%02d.png\")", abs(kIndex) % 99
    cabbageSet changed(kIndex), "tunerImage", SImg
endop

;instrument will be triggered by keyboard widget
instr 1
    kIndex chnget "tuningSlider"
    setImg(kIndex)
endin

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

That looks good.
Not sure why the abs(kIndex) % 99 works exactly.
So 99 is the steps between all the frames of which you take a part with the kIndex ?
I found that the strip generator auto-cropped the transparent sides, which gives the smaller filespace. So I think it doesn’t really matter whether to use the strip or the image collection.

% is a modulo operator. No matter what value the slider is, % ensure it always returns 0 to 99. It’s a very useful operator :slight_smile:

1 Like

I see.
The only modulus I knew of was the remainder of a quotient.

That’s what this does is it not?