Hi Scott,

That's not your fault :-).

Unfortunately this tutorial is a little bit outdated. When it was written (2003), sin was not part of the language and was defined as a foreign function. That's not the case anymore and this is why you get an error.

Therefore when reading this tutorial you must take into account that most mathematical functions are now primitives (the others are defined in math.lib as foreign functions). Moreover the semantics of sequential composition (:) has evolved and it is now more strict. It is now mandatory in (A:B) that the number of outputs of A to be equal to the number of inputs of B. Some examples of the tutorial will produce an error because they don't respect this rule.  But you can easily correct the concerned examples by adding _ in parallel to A or B.

BTW the most up-to-date document is the Faust Quick Reference.

Cheers

Yann






 used to be a foreign function, but it is now a primitive of the language
Le 04/11/13 22:29, Scott Hawley a écrit :
I am trying to type in the example of the Sinusoidal Oscillator from page 42 of the Faust tutorial, and FaustWorks seems to be giving me errors on every turn.

Most notably, on the very first non-comment line:

sin = ffunction(float sin (float), <math.h>, "");

I get the error

faust/osc.).tmp.dsp:1:syntax error, unexpected SIN
----------------------

I many subsequent errors as well, but this is the one I would like help with first.


Apologies for redundancy, as this is likely a very common problem that newcomers encounter when they first try this; I was however unable to find a "search" interface for the mailing list archives.

Many thanks.
-SS



------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk


_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users



------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to