I'm not sure if that title makes total sense, but I also can't find the answer. I've tested the audio objects and my code a bunch of different ways back and forth and searched all over Google/Reddit/PJRC. That being said, I feel like I'm missing something very basic here.
I am trying to take an old Yamaha Keyboard, plug it into a Teensy (I'm testing on a 3.2, but will likely upgrade to a 4.0 as I work out bugs). I like the sound of the old keyboard, so I'd like to preserve that while layering more effects on it using the teensy.
Here is the code that "works" in the sense that I play a note on the keyboard and I hear it on my headphones.
Very very basic. As soon as I introduce the envelope audio object, the sound goes away. I have tried using envelope before and after mixer1, but nothing changes. I tried adding a multiply between i2s1 and mixer1, but still nothing. Only when the envelope object is removed completely, does the sound come all the way through to the headphones. I've also tried replacing i2s1 with adc1, but that also does nothing.
What am I missing?
My current hunch is I need to add a noteOn() before engaging the filter, but also am not sure how to tell the teensy to listen for a signal to then start noteOn(). Likely something in the analyze list of objects, but I haven't started testing them out.
If you have any insight, that would be super appreciated!
I am trying to take an old Yamaha Keyboard, plug it into a Teensy (I'm testing on a 3.2, but will likely upgrade to a 4.0 as I work out bugs). I like the sound of the old keyboard, so I'd like to preserve that while layering more effects on it using the teensy.
Here is the code that "works" in the sense that I play a note on the keyboard and I hear it on my headphones.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=63.75,106.25
AudioMixer4 mixer1; //xy=420.00000762939453,97.49999809265137
AudioOutputI2S i2s2; //xy=877.5000076293945,112.50000190734863
AudioConnection patchCord1(i2s1, 0, mixer1, 0);
AudioConnection patchCord2(i2s1, 1, mixer1, 1);
AudioConnection patchCord3(mixer1, 0, i2s2, 0);
AudioConnection patchCord4(mixer1, 0, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=396.25000762939453,380.8333492279053
// GUItool: end automatically generated code
void setup() {
Serial.begin(9600);
AudioMemory(20);
sgtl5000_1.enable();
sgtl5000_1.volume(0.8);
delay(500);
mixer1.gain(0,1);
mixer1.gain(1,1);
mixer1.gain(2,0);
mixer1.gain(3,0);
}
void loop() {
}
Very very basic. As soon as I introduce the envelope audio object, the sound goes away. I have tried using envelope before and after mixer1, but nothing changes. I tried adding a multiply between i2s1 and mixer1, but still nothing. Only when the envelope object is removed completely, does the sound come all the way through to the headphones. I've also tried replacing i2s1 with adc1, but that also does nothing.
What am I missing?
My current hunch is I need to add a noteOn() before engaging the filter, but also am not sure how to tell the teensy to listen for a signal to then start noteOn(). Likely something in the analyze list of objects, but I haven't started testing them out.
If you have any insight, that would be super appreciated!