Blue Cat's Plug'n Script 3.31 Free Update & Promotion
 KVRAF
 4612 posts since 8 Sep, 2004 from Paris (France)
Topic Starter
Oh so you are using the Chorus plugin then, not Plug'n Script?

 KVRer
 6 posts since 6 Jun, 2019
I first ran into the issue while using Plug'n Script. Sometimes black appears over widgets or the background image.Blue Cat Audio wrote: ↑Fri Mar 19, 2021 7:50 amOh so you are using the Chorus plugin then, not Plug'n Script?
However, in the screen capture I posted I'm only using the Chorus plugin without Plug'n Script, that is correct. This is to make sure the issue isn't being caused by my own .cxx or kuiml code.
 KVRAF
 4612 posts since 8 Sep, 2004 from Paris (France)
Topic Starter
Thanks for the details. This looks like a bug that should be investigated! Which version of MacOS are you using here?

 KVRer
 6 posts since 6 Jun, 2019
Thanks. I'm using 10.14.6Blue Cat Audio wrote: ↑Fri Mar 19, 2021 11:04 pmThanks for the details. This looks like a bug that should be investigated! Which version of MacOS are you using here?

 KVRAF
 12653 posts since 13 Oct, 2009
Q: Is there a way to create user defined functions for KUIML script FORMULA_CURVE elements such that one can easily create formulas that incorporate composition of functions? Alternatively, is there a way to define a FORUMLA_CURVE such that the formula is specified as a script function that takes the independent variable as an input parameter and returns the dependent value to be plotted. In this way, function composition could be managed within the script.
I'm only now revisiting this after a hiatus, so if my questions reflect key misunderstandings of how KUIML works then please attribute that to my lack of experience.
I'm only now revisiting this after a hiatus, so if my questions reflect key misunderstandings of how KUIML works then please attribute that to my lack of experience.

 KVRist
 278 posts since 28 May, 2011
You can take a look at some examples with formula_curve here:ghettosynth wrote: ↑Sat Mar 20, 2021 4:37 pmQ: Is there a way to create user defined functions for KUIML script FORMULA_CURVE elements such that one can easily create formulas that incorporate composition of functions? Alternatively, is there a way to define a FORUMLA_CURVE such that the formula is specified as a script function that takes the independent variable as an input parameter and returns the dependent value to be plotted. In this way, function composition could be managed within the script.
I'm only now revisiting this after a hiatus, so if my questions reflect key misunderstandings of how KUIML works then please attribute that to my lack of experience.
https://github.com/ilyaorlovru/plugnscriptexamples
formula_curve_examples.kuiml
formulas_viewer.kuiml
But in general it's rather limited to formulas. If you want to draw freely you should explore CANVAS.
https://pns.letimix.com/scripts/gui/drawing
 KVRAF
 4612 posts since 8 Sep, 2004 from Paris (France)
Topic Starter
I confirm that the issue only appears on 10.14 (not 10.13 or 10.15 or 10.16). It seems to be a problem with MacOS' backing layer alpha channel that works differently on this particular version . We will issue an update that fixes the problem. In the meantime you can indeed use a SKIN with default color background and load the image in a separate component inside.LandofMissingParts wrote: ↑Wed Mar 17, 2021 5:11 pmHi, I'm getting an issue when reskinning with KUIML
There's solid black covering up the background image, but it disappears when a knob/slider in front of it moves. Here's an example using the code from the Blue Cat Chorus KUIML tutorial, no modifications.
https://youtu.be/oF3OsZz5hkM
 KVRAF
 4612 posts since 8 Sep, 2004 from Paris (France)
Topic Starter
It is currently possible to use formula curves only with math formulas, not scripts. You can however use any function or parameter that is defined elsewhere in the skin, such as:ghettosynth wrote: ↑Sat Mar 20, 2021 4:37 pmQ: Is there a way to create user defined functions for KUIML script FORMULA_CURVE elements such that one can easily create formulas that incorporate composition of functions? Alternatively, is there a way to define a FORUMLA_CURVE such that the formula is specified as a script function that takes the independent variable as an input parameter and returns the dependent value to be plotted. In this way, function composition could be managed within the script.
Code: Select all
formula="MyFunction(MyOtherFunction(x))+MyParam*MySurface(x,2*x)"

 KVRAF
 12653 posts since 13 Oct, 2009
Thanks, I'm probably not being clear enough but I believe that solves my issue. I should have tried the obvious thing before asking. In any case, I'll go play with this and, if necessary, refine my question with more clarity with respect to terminology.
So, still haven't tried this, but, If I'm following, a formula specified in a FORMULA_CURVE is a function of x (or other specified variable) where the id is the name of the function?
So, still haven't tried this, but, If I'm following, a formula specified in a FORMULA_CURVE is a function of x (or other specified variable) where the id is the name of the function?
Code: Select all
<FORMULA_CURVE id="f" formula="2*x"/>
<FORMULA_CURVE id="g" formula="sin(f(x))"/>
Last edited by ghettosynth on Mon Mar 22, 2021 10:51 am, edited 1 time in total.

 KVRAF
 12653 posts since 13 Oct, 2009
Just wanted to take a second thank you for your efforts. I had already downloaded your repos and they were instrumental in clarifying some questions that I had.ilyaorlov wrote: ↑Mon Mar 22, 2021 2:16 amYou can take a look at some examples with formula_curve here:
https://github.com/ilyaorlovru/plugnscriptexamples

 KVRAF
 12653 posts since 13 Oct, 2009
Ah, I should have looked more closely at ilyaorlov's kuiml files, there is a FORMULA element.
That said, my examples above also work. AFAIK, FORMULA isn't documented in the KUIML online docs. I get the sense that the documentation lags the product pretty significantly, yes?
In any case, being able to name "formulas" is equivalent to defining functions of the independent skin variable so that solves my immediate problem.
Code: Select all
<FORMULA name="sin(x)/x scaled with fc" value="sin(2*pi*x*(fc/fs))/(2*pi*x*(fc/fs))" />
In any case, being able to name "formulas" is equivalent to defining functions of the independent skin variable so that solves my immediate problem.
 KVRAF
 4612 posts since 8 Sep, 2004 from Paris (France)
Topic Starter
Yes, your formulas are fine. It's indeed the same as defining a function (in the mathematical sense). It is actually fully documented in the KUIML reference:
FORMULA_PARAM (parameter value defined by math formula)
FORMULA_CURVE (curve defined by math formula)
FORMULA_SURFACE (surface defined by math formula)
With also a complete reference of the math formula syntax.
FORMULA_PARAM (parameter value defined by math formula)
FORMULA_CURVE (curve defined by math formula)
FORMULA_SURFACE (surface defined by math formula)
With also a complete reference of the math formula syntax.

 KVRAF
 12653 posts since 13 Oct, 2009
In the math formula reference it's not clear that any named FORMULA variant id can be used syntactically to invoke a function. If the BNF of this expression evaluator were a part of the documentation, then it would have been clear.
That said, my examples also make it pretty clear, feel free to copy and paste
However, I see now that the FORMULA element isn't defined in kuiml, that's simply XML that ilyaorlov uses to later define a FORMULA_CURVE.
That said, my examples also make it pretty clear, feel free to copy and paste
However, I see now that the FORMULA element isn't defined in kuiml, that's simply XML that ilyaorlov uses to later define a FORMULA_CURVE.
 KVRAF
 4612 posts since 8 Sep, 2004 from Paris (France)
Topic Starter
Indeed, because the same syntax is used in some other contexts where you cannot reference other model objects (for the response curve of controls for example). However it is clearly specified on the page for the FORMULA_CURVE:ghettosynth wrote: ↑Mon Mar 22, 2021 2:50 pmIn the math formula reference it's not clear that any named FORMULA variant id can be used syntactically to invoke a function. If the BNF of this expression evaluator were a part of the documentation, then it would have been clear.
But yes, some more examples would not harm, for sure!KUIML Reference wrote:"The formula can reference any other model data available (parameter, curve, surface...)."

 KVRAF
 12653 posts since 13 Oct, 2009
Yes, but, that's exactly what I mean. You're saying that there is a different syntax for expression evaluations in different places in kuiml. For someone used to technical documentation, I would expect to find that information in the table of the math formulas. The restricting context could be included in a comment. That context would also be a part of the BNF of expressions evaluation in kuiml.Blue Cat Audio wrote: ↑Tue Mar 23, 2021 12:30 amIndeed, because the same syntax is used in some other contexts where you cannot reference other model objects (for the response curve of controls for example). However it is clearly specified on the page for the FORMULA_CURVE:ghettosynth wrote: ↑Mon Mar 22, 2021 2:50 pmIn the math formula reference it's not clear that any named FORMULA variant id can be used syntactically to invoke a function. If the BNF of this expression evaluator were a part of the documentation, then it would have been clear.But yes, some more examples would not harm, for sure!KUIML Reference wrote:"The formula can reference any other model data available (parameter, curve, surface...)."
Like I said, I should have tried the obvious thing, but it definitely would have helped there to just be more explicit regarding the syntax. I'm going to take some issue with your use of the word "clearly." I remember reading that phrase and thinking that it was referring to using the name of parameters in a formula. Probably because I was reading it while I was trying to sus out TEMPLATES. I would say that the terseness of the documentation on KUIML is probably the thing that I most regularly bump my head against.
At any rate, thanks for the help. My immediate problem is solved.