Blue Cat's Plug'n Script 3.31 Free Update & Promotion

Official support for: bluecataudio.com
User avatar
KVRAF

Topic Starter

4612 posts since 8 Sep, 2004 from Paris (France)

Post Fri Mar 19, 2021 7:50 am

Oh so you are using the Chorus plug-in then, not Plug'n Script?

KVRer
6 posts since 6 Jun, 2019

Post Fri Mar 19, 2021 10:05 am

Blue Cat Audio wrote:
Fri Mar 19, 2021 7:50 am
Oh so you are using the Chorus plug-in then, not Plug'n Script?
I first ran into the issue while using Plug'n Script. Sometimes black appears over widgets or the background image.

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.

User avatar
KVRAF

Topic Starter

4612 posts since 8 Sep, 2004 from Paris (France)

Post Fri Mar 19, 2021 11:04 pm

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

Post Sat Mar 20, 2021 6:28 am

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

KVRAF
12653 posts since 13 Oct, 2009

Post Sat Mar 20, 2021 4:37 pm

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.

KVRist
278 posts since 28 May, 2011

Post Mon Mar 22, 2021 2:16 am

ghettosynth wrote:
Sat Mar 20, 2021 4:37 pm
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.
You can take a look at some examples with formula_curve here:
https://github.com/ilyaorlovru/plug-n-script-examples

Image
formula_curve_examples.kuiml

Image
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

User avatar
KVRAF

Topic Starter

4612 posts since 8 Sep, 2004 from Paris (France)

Post Mon Mar 22, 2021 6:59 am

LandofMissingParts wrote:
Wed Mar 17, 2021 5:11 pm
Hi, 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
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 :party: . 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.

User avatar
KVRAF

Topic Starter

4612 posts since 8 Sep, 2004 from Paris (France)

Post Mon Mar 22, 2021 7:05 am

ghettosynth wrote:
Sat Mar 20, 2021 4:37 pm
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.
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:

Code: Select all

formula="MyFunction(MyOtherFunction(x))+MyParam*MySurface(x,2*x)" 
And there is now a nuilt-in function called if() that lets you execute conditional formulas, so it can behave a bit like scripting, with a much shorter syntax.

KVRAF
12653 posts since 13 Oct, 2009

Post Mon Mar 22, 2021 10:26 am

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?

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

Post Mon Mar 22, 2021 10:28 am

ilyaorlov wrote:
Mon Mar 22, 2021 2:16 am
You can take a look at some examples with formula_curve here:
https://github.com/ilyaorlovru/plug-n-script-examples
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.

KVRAF
12653 posts since 13 Oct, 2009

Post Mon Mar 22, 2021 11:52 am

Ah, I should have looked more closely at ilyaorlov's kuiml files, there is a FORMULA element.

Code: Select all

  <FORMULA name="sin(x)/x scaled with fc" value="sin(2*pi*x*(fc/fs))/(2*pi*x*(fc/fs))" />
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.

User avatar
KVRAF

Topic Starter

4612 posts since 8 Sep, 2004 from Paris (France)

Post Mon Mar 22, 2021 2:21 pm

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.

KVRAF
12653 posts since 13 Oct, 2009

Post Mon Mar 22, 2021 2:50 pm

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.

User avatar
KVRAF

Topic Starter

4612 posts since 8 Sep, 2004 from Paris (France)

Post Tue Mar 23, 2021 12:30 am

ghettosynth wrote:
Mon Mar 22, 2021 2:50 pm
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.
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:
KUIML Reference wrote:"The formula can reference any other model data available (parameter, curve, surface...)."
But yes, some more examples would not harm, for sure!

KVRAF
12653 posts since 13 Oct, 2009

Post Tue Mar 23, 2021 8:12 am

Blue Cat Audio wrote:
Tue Mar 23, 2021 12:30 am
ghettosynth wrote:
Mon Mar 22, 2021 2:50 pm
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.
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:
KUIML Reference wrote:"The formula can reference any other model data available (parameter, curve, surface...)."
But yes, some more examples would not harm, for sure!
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.

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.

Return to “Blue Cat Audio”