|
From: Stéphane L. <le...@gr...> - 2015-01-07 11:42:10
|
faust2 branch can generate pure C, using commands like : faust -lang c foo.dsp Stéphane Le 7 janv. 2015 à 12:35, Harry van Haaren <har...@gm...> a écrit : > > > On Wed, Jan 7, 2015 at 6:31 AM, Edgar J Berdahl <edg...@ls...> wrote: > Does anyone have anything to report about compiling Faust directly into traditional C code instead of C++? Have you ever tried it? > I don't think this has been tried: but I'm not a faust dev, so perhaps there's some research somewhere hidden way... > > "Reference to external C functions, variables and constants can be introduced using the foreign function mechanism.” > Yes, this can be used to *call into* C code from FAUST. An example from a FAUST based wavetable synth: > C header: https://github.com/harryhaaren/openAV-Sorcer/blob/master/faust/wavetableReader.h > ffunction code in FAUST: https://github.com/harryhaaren/openAV-Sorcer/blob/master/faust/main.dsp#L44 > > This is C (not C++) as the FAUST language itself is functional not OOP, and hence calling C++ (with classes etc) is not normal. Calling C is easy though: just pass in the data needed, grab the return value. > > However, all of the architecture files seem to be .cpp and not .c. > Indeed: and the generated code is generally a C++ class representing the FAUST dsp code. Note that different backends to faust may or may not utilize the C++ code, but I'll let somebody more knowledgeable jump in here :) > > Cheers, -Harry > > -- > > http://www.openavproductions.com > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net_______________________________________________ > Faudiostream-devel mailing list > Fau...@li... > https://lists.sourceforge.net/lists/listinfo/faudiostream-devel |