Closed Miserlou closed 1 year ago
If it helps nudge you, this function is used for peak/shelf filters..
(My interim solution so far has been to compute and cache it in C++, then pass that value into Vult, but it feels very inelegant.)
it might be better to support a natural logarithm, as it is used in many DSP algorithms.
then one can build on pow(a,x) == exp(x * ln(a))
There's the function pow(a,b)
It's undocumented. I added it not so long ago. Here's the part of the code that lists all the builtins.
https://github.com/modlfo/vult/blob/master/src/core/env.ml#L593
I try to avoid it because it's slow. You can cache it directly in Vult if you have one of the arguments fixed. For example:
fun pow1_4(x) @[table(size=127,min=0.0,max=10)] {
return pow(x, 1.4);
}
In general, you can add missing functions as follows:
external atan2(x:real, y:real) : real "atan2f";
That adds the C++ atan2f
and can be used for code generation. The problem when using external function is that the code becomes less portable.
Heyo! Loving Vult so far!
I'm looking at the language reference, and I don't see anyway to do power functions ( ex:
3**3 == 27
orpow(3,3)==27
). There is anexp()
, but it only takes one argument so I'm not sure what that's doing.Can you either add this feature, or add the documentation for it if it already exists?
Thanks! Rich