Re: [Faudiostream-users] WaveShaping using multiple functions

2020-11-23 Thread Yann Orlarey
Hi Yoann, As James pointed out, Faust has strict semantics. This means that all signals are always computed (https://en.wikipedia.org/wiki/Strict_function) and that there is no non-strict 'if' in Faust. It turns out that due to a bug in the compiler, the code generated for select2 and select3 is

Re: [Faudiostream-users] WaveShaping using multiple functions

2020-11-23 Thread yoann.le.bor...@gmail.com
Hi Florian! Le 22/11/2020 à 13:03, Florian Hülsmann a écrit : Hi Yoann, You can simply multiply the functions with their conditions: f(x) = (x < LowerThreshold) * LowerSignal(x) + ((x >= LowerThreshold) & (x <= UpperThreshold)) * LinearSignal(x) + (x > UpperThreshold) * UpperSignal(x) process

Re: [Faudiostream-users] WaveShaping using multiple functions

2020-11-22 Thread Florian Hülsmann
Hi Yoann, You can simply multiply the functions with their conditions: f(x) = (x < LowerThreshold) * LowerSignal(x) + ((x >= LowerThreshold) & (x <= UpperThreshold)) * LinearSignal + (x > UpperThreshold) * UpperSignal process = f Hope this works for you! Flo Am So., 22. Nov. 2020 um 12:39 Uhr

Re: [Faudiostream-users] WaveShaping using multiple functions

2020-11-22 Thread James Mckernon
On 11/22/20, yoann.le.bor...@gmail.com wrote: > In a non functional language, I would have used a classic if/then/else > but, as specified in the faust manual: > "WARNING: since select2 is strict (always evaluating both branches), the > resulting if does not have the usual "lazy" semantic of the C