|
Hi Timo,
The current behavior of the compiler is correct. Faust expressions have a precise and purely "functional" semantics. This is why, no matter how many time you repeat the foreign C function ffunction(int rand(), <math.h>, ""), it will *always* produce the same output signal. Let me try to explain why. A Faust _expression_ denotes a function (in the mathematical sens, not in the C sens) that maps a (possibly empty) group of input signals to a (possibly empty) group of output signals. For example the Faust primitive + maps a pair of signals (x,y) to a single signal (z) such that z(n) = x(n)+y(n). The Faust primitive ! maps any single signal (x) to the empty group of signals (). A Faust _expression_ with no inputs, for example the Faust number 3, is also a function. The Faust number 3 maps the empty group of signals () to the single signal (z) such that z(n) = 3. Being a mathematical function means that with the same input will *always* produce the same output : (x,y)=(u,v) => f(x,y)=f(u,v). Therefore any function that maps the empty group of signals () to some group of output signals, will *always* produce the same group of output signals: ()=() => f() = f(). This is why ffunction(int rand(), <math.h>, "") always produces the same output signal, no matter how many time it is repeated. The property of Faust expressions being mathematical functions is crucial for the Faust compiler and the optimizations it can perform. If a function f is applied several times to the same group of input signals, there is no need to recompute it, because it will always produce the same group of output signals. Moreover for any f that maps the empty group of signals () to a single signal (z), you have expected properties like f+f = 2*f, and f-f = 0, etc. no matter how complex f is. For example : par(i, 10, ffunction(int rand(), <math.h>, "")) :> _ is equal to 10*ffunction(int rand(), <math.h>, "") and ffunction(int rand(), <math.h>, "") - ffunction(int rand(), <math.h>, "") is equal to 0. Cheers Yann Le 25/04/2014 08:14, Timo Westkämper a écrit :
|
------------------------------------------------------------------------------ Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform
_______________________________________________ Faudiostream-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/faudiostream-users
