Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Example 1

For example,
  process = ffunction(float fn(float), "<math.h>", "-lm");
compiles to (as of 2020-04-29 using the latest FAUST master-dev branch)
  ...
  /* link with : "-lm" */
  #include "<math.h>"
  ...
  virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
    FAUSTFLOAT* input0 = inputs[0];
    FAUSTFLOAT* output0 = outputs[0];
    for (int i = 0; (i < count); i = (i + 1)) {
      output0[i] = FAUSTFLOAT(float(fn(float(input0[i]))));
    }
  }
  ...


Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download aspf.pdf
[Comment on this page via email]

``Audio Signal Processing in Faust'', by Julius O. Smith III
Copyright © 2023-08-16 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA