I just noticed now that you have sub groups in this. The dynamic syntax system was never really designed to handle this kind of complexity.
Edit mode destroys source code (Windows 10/11)
Any chance you could describe to me the simplest way I can recreate the problem on my end?
I use curly brackets (Plants), with a label as the container, and with slider inside. Try to move the widget in GUI-editor with this example. It will do all sorts of odd stuff.
<Cabbage>
form caption("Untitled") size(400, 300), guiMode("queue"), pluginId("def1")
keyboard bounds(8, 158, 381, 95)
label bounds(0, 78, 80, 16) channel("label10002") {
rslider channel("rslider10001") channel("rslider10001") range(0, 1, 0, 1, 0.001)
}
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr 1
kEnv madsr .1, .2, .6, .4
aOut vco2 p5, p4
outs aOut*kEnv, aOut*kEnv
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
</CsScore>
</CsoundSynthesizer>
Yup, that does the trick alright this isn’t going to be easy but I’ll try to find a fix for it.
What I do, is very simple:
- open a new file
- add “size(600, 500), colour(200, 200, 200), textColour (0,0,0)” to the caption
- add the following lines to the cabbage part:
#define SLIDER1 textColour ( 0, 0, 0), trackerColour (170, 170, 170)
#define LABEL1 textColour ( 0, 0, 0), fontColour (0, 0, 0)
#define COMBO1 colour (170, 170, 170), fontColour (0, 0, 0)
rslider $SLIDER1 bounds ( 12, 14, 105, 101), channel (“att”), range (0, 20, 0.1, 1, 0.01), text (“Attack”)
rslider $SLIDER1 bounds (114, 14, 105, 101), channel (“dec”), range (0, 20, 0.5, 1, 0.01), text (“Decay”)
rslider $SLIDER1 bounds (218, 14, 105, 101), channel (“sus”), range (0, 1, 0.5, 0.5, 0.01), text (“Sustain”)
rslider $SLIDER1 bounds (322, 14, 105, 101), channel (“rel”), range (0, 20, 0.7, 1, 0.01), text (“Release”) - say “Run” to bring the GUI up
- say “Stop”
- enter edit mode
- move a slider.
Result: garbage.
That’s all.
Two things here seems to break things. 1) The tab indentation, and 2) the fact you have no bounds set for the label.
I can’t seem to recreate this here? Can you spot anything I’m not doing? It does add a few colour identifiers, but that’s not so bad.
Very strange…
I used the built-in windows recorder, so I can show only the cabbage window, not the plugin…
…and now the video is too big. Pls. find the link to the video here (valid for one week):
Great - that does the trick! Problem solved!!!
(But does not improve raedability… )
No, but at least we know now what is causing the issue. I have some place to start
I pushed a fix for this now. While some of the use cases above still result in issues (1, 2), adding spaces or tabs to the starts of lines in order to create a better formatted document should no longer results in garbage. So @stefanv, you should be free to add as many tabs/spaces as you like from now on.
Tested and approved. Thanks very much!
Which version should I use for this fix?
I got the same problem on Mac, Cabbage 2.9.
https://recordit.co/ZqWYqP7dUa
What I did was basically replacing my existing section with the one from the tutorial here: https://cabbageaudio.com/docs/using_imgs/
Hey @strongbear, welcome to the forum. Whenever you hit an issue like this the first thing you should do is install the latest development build. You can read about how to access them from here. If that doesn’t help let me know
Thanks @rorywalsh. I have installed 2.9.137, and still have the problem. Is it the latest version at the moment?
I’d say what’s happening there is that file was created with quite an older version of Cabbage. Although it still compiles and runs, I think the code might be a little suspect. What I would do is create another file, and just bring over one of the sliders to test first. You’ll hardly want the same layout anyway. Btw, what are you hoping to do?
Hi,
I was just following the tutorial to learn Cabbage
Those tutorials are pretty old at this stage. I will be redoing them in the next few months so they show the most recent version of Cabbage. I might also redo that instrument soon as iI don’t want people to experience the same issue you did.
Sounds great!