I need help getting Faust code to run on teensy

Maulwurst

New member
Hello I wrote the following Faust code
Code:
import("stdfaust.lib");

// vertical voice group
osc_g(i,x) = vgroup("OSC %2nn", x)
with{
 nn = i+1;
};

// Oscillator
f = hslider("[06]Freq",440,1,20000,0.1);
s = nentry("[07]Waveform Select",0,0,2,1);
oscillator = os.polyblep_saw(f),
             os.polyblep_square(f),
             os.polyblep_triangle(f) : 
             select3(s);

//Amp
attack = hslider("[01]Attack",0,0,400,0.1);
decay = hslider("[02]Decay",0,0,400,0.1);
sustain = hslider("[03]Sustain",0,0,1,0.1);
release = hslider("[04]Release",0,0,20,0.1);
volume = hslider("[05]Volume",0,0,1,0.01);
gate = button("[08]Gate");
envelope = en.adsr(attack,decay,sustain,release,gate);
amp = envelope*volume;

process = hgroup("MYSYNTH", par(i,3,osc_g(i,oscillator*amp))):>_;

and I am now trying to get it to run on my teensy I wrote the following code however I hear no sound. Any help would be appreciated
Code:
#include <Audio.h>
#include "Synth1.h"

AudioOutputI2S out;
AudioControlSGTL5000 audioShield;

Synth1 Synth;

AudioConnection patchCord0(Synth,0,out,0);
AudioConnection patchCord1(Synth,0,out,1);

void setup() {
  AudioMemory(2);
  audioShield.enable();
  audioShield.volume(1);
  Synth.setParamValue("gate",1);

}

void loop() {
  Synth.setParamValue("f",random(50,1000));

  delay(50);
  
}
 
Hi Conchita,
maybe Faust needs more AudioMemory. I don't know, it's a guess only. Try a higher number.
 
I raised the AudioMemory to a value high value and I now hear sound thank you. However changing the parameters seems to have no effect.
 
Last edited:
working Faust library on a Teensy 4.0

I raised the AudioMemory to a value high value and I now hear sound thank you. However changing the parameters seems to have no effect.

I know I'm a bit late to the party, but I have been able to get some Faust Models running on a Teensy 4.0 and change parameters. Details and code at museelectronicinstruments.com but basically I am using the compiled files generated at https://faustide.grame.fr/ to the Teensy. Not quite what you are doing, but maybe a work around.

Keith
 
Back
Top