Skip to content

Instantly share code, notes, and snippets.

@schollz
Created May 9, 2022 14:44
Show Gist options
  • Save schollz/14021f0079bd24744793701207cd0e58 to your computer and use it in GitHub Desktop.
Save schollz/14021f0079bd24744793701207cd0e58 to your computer and use it in GitHub Desktop.

my faust code. the faust code generates a "teensy" library "Volume.h" and "Volume.cpp" from https://faustide.grame.fr/

import("stdfaust.lib");
gain		= vslider("[1]", 0, -70, +4, 0.1) : ba.db2linear : si.smoo;
process		= *(gain);

then my teensy code here (volume.ino) will pass through audio unless I comment out volume.setParamValue("gain",0.5);! I have no idea why

#include <Audio.h>
#include "Volume.h"

Volume volume;
AudioInputI2S in;
AudioOutputI2S out;
AudioControlSGTL5000 audioShield;
AudioConnection patchCord0(in,0,out,0);
AudioConnection patchCord1(in,1,out,1);

void setup() {
AudioMemory(20);
audioShield.enable();
audioShield.inputSelect(AUDIO_INPUT_LINEIN);
audioShield.volume(0.5);

// audio will go through unless this line is uncommented!
// ?????
// volume.setParamValue("gain",0.5);
}

void loop() {
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment