Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: I need help getting Faust code to run on teensy

  1. #1
    Junior Member
    Join Date
    Feb 2021
    Posts
    3

    I need help getting Faust code to run on teensy

    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);
      
    }

  2. #2
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Hi Conchita,
    maybe Faust needs more AudioMemory. I don't know, it's a guess only. Try a higher number.

  3. #3
    Junior Member
    Join Date
    Feb 2021
    Posts
    3
    I am unsure what you mean with try a higher number I'm sorry.

  4. #4
    Senior Member
    Join Date
    Apr 2014
    Location
    -
    Posts
    9,756
    Quote Originally Posted by Maulwurst View Post
    I am unsure what you mean with try a higher number I'm sorry.
    Does it work with AudioMemory(20)?

  5. #5
    Junior Member
    Join Date
    Feb 2021
    Posts
    3
    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 by Maulwurst; 02-05-2021 at 05:40 PM.

  6. #6
    Junior Member
    Join Date
    Dec 2021
    Location
    wisconsin USA
    Posts
    3

    working Faust library on a Teensy 4.0

    Quote Originally Posted by Maulwurst View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •