Open magnetophon opened 4 years ago
I found out that fixedDelayMedianOfMedians(pow(3,3):int);
works.
Not sure why though.
Probably because the (n,x) =>
pattern matching clause is always taken, and never the first two.
May I ask why you closed the issue?
It's not high priority or anything, but I'd consider this a bug: faust should behave the same when I write pow(3,3)
and when I write 27
, wouldn't you agree?.
pow(3,3) produces a "float" type, and 27 is seen as an integer. A probably better and safer way is to have fixedDelayMedianOfMedians
cast its argument to "int" internally, so that pattern-matching would work as expected ?
Sure, I can do that. I was just wondering if it would be possible to do in the compiler.
On the lower levels it might very well be true that the power of two ints gives a float, but I think Faust's main strength is that it abstracts away those levels, and just lets me focus on audio! :)
Again, not a priority at all, just something that would be nice to have some day.
Maybe one day. I reopen the issue to keep it hot !
Thanks!
I get the above error when I compile the following code:
When I use
all is good.
I wanna turn this into a variable window construct, like slidingReduce, but for that, I need to specify n as a power .
PS: Can anyone tell me if I'm on the right track with this, or will Julius do it in a one-liner that doesn't take any CPU? :)
The web tells me I should be using groups of 5 or 7, for performance reasons. I don't understand any of the explanations of the algorithms they are using, but as far as I can tell in this case it doesn't matter for the performance because I'm able to re-use older values here and because I'm not calculating the exact Median but just an approximation.
Can someone enlighten me?