If I do this, then it works:
If I take a drum away to have an input free in the mixer*** to add a delay, then it does not work anymore (with feedback or not, it does not).
***I tried with 2 mixers but did not work, as it does not work in one anyway, I am doing something else wrong. I can add again the different drums + mixers once I get it to work.
THIS IS NOT WORKING WITH DELAY:
Do you know why?
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <synth_simple_drum.h>
AudioSynthSimpleDrum drum2; //xy=142,180
AudioSynthSimpleDrum drum3; //xy=167,246
AudioSynthSimpleDrum drum1; //xy=174,133
AudioSynthSimpleDrum drum4; //xy=207,310
AudioMixer4 mixer1; //xy=480,201
AudioOutputAnalog dac1; //xy=647,197
AudioConnection patchCord1(drum2, 0, mixer1, 1);
AudioConnection patchCord2(drum3, 0, mixer1, 2);
AudioConnection patchCord3(drum1, 0, mixer1, 0);
AudioConnection patchCord4(drum4, 0, mixer1, 3);
AudioConnection patchCord5(mixer1, dac1);
AudioControlSGTL5000 sgtl5000_1; //xy=930,518
static uint32_t next;
void setup() {
Serial.begin(115200);
// audio library init
AudioMemory(15);
next = millis() + 1000;
AudioNoInterrupts();
drum1.frequency(60);
drum1.length(1500);
drum1.secondMix(0.0);
drum1.pitchMod(0.55);
drum2.frequency(60);
drum2.length(300);
drum2.secondMix(0.0);
drum2.pitchMod(1.0);
drum3.frequency(550);
drum3.length(400);
drum3.secondMix(1.0);
drum3.pitchMod(0.5);
drum4.frequency(1200);
drum4.length(150);
drum4.secondMix(0.0);
drum4.pitchMod(0.0);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
AudioInterrupts();
}
void loop() {
static uint32_t num = 0;
if(millis() == next)
{
next = millis() + 1000;
switch(num % 4)
{
case 0:
drum1.noteOn();
break;
case 1:
drum2.noteOn();
break;
case 2:
drum3.noteOn();
break;
case 3:
drum4.noteOn();
break;
}
num++;
int knobFreq = analogRead(A11); // tune
int knobLength = analogRead(A9); // fine tune
drum1.frequency(knobFreq*2);
drum2.frequency(knobFreq*2);
drum3.frequency(knobFreq*2);
drum4.frequency(knobFreq*2);
drum1.length(knobLength*2);
drum2.length(knobLength*2);
drum3.length(knobLength*2);
drum4.length(knobLength*2);
}
}
***I tried with 2 mixers but did not work, as it does not work in one anyway, I am doing something else wrong. I can add again the different drums + mixers once I get it to work.
THIS IS NOT WORKING WITH DELAY:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <synth_simple_drum.h>
AudioSynthSimpleDrum drum1; //xy=485.33331298828125,211.66668701171875
AudioSynthSimpleDrum drum2; //xy=504,263
AudioSynthSimpleDrum drum3; //xy=538,323
AudioMixer4 mixer1; //xy=791.3333129882812,279.66668701171875
AudioEffectDelay delay1; //xy=946.6666666666665,444.99999999999994
AudioOutputAnalog dac1; //xy=958.3333129882812,275.66668701171875
AudioConnection patchCord1(drum1, 0, mixer1, 0);
AudioConnection patchCord2(drum2, 0, mixer1, 1);
AudioConnection patchCord3(drum3, 0, mixer1, 2);
AudioConnection patchCord4(mixer1, delay1);
AudioConnection patchCord5(delay1, 0, dac1, 0);
AudioConnection patchCord6(delay1, 0, mixer1, 3);
AudioControlSGTL5000 sgtl5000_1; //xy=930,518
static uint32_t next;
void setup() {
Serial.begin(115200);
// audio library init
AudioMemory(15);
mixer1.gain(0, 0.5);
mixer1.gain(1, 0.5);
mixer1.gain(2, 0.5);
mixer1.gain(3, 0.7);
delay1.delay(0, 400);
delay(1000);
next = millis() + 1000;
AudioNoInterrupts();
drum1.frequency(60);
drum1.length(1500);
drum1.secondMix(0.0);
drum1.pitchMod(0.55);
drum2.frequency(60);
drum2.length(300);
drum2.secondMix(0.0);
drum2.pitchMod(1.0);
drum3.frequency(550);
drum3.length(400);
drum3.secondMix(1.0);
drum3.pitchMod(0.5);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
AudioInterrupts();
}
void loop() {
static uint32_t num = 0;
if(millis() == next)
{
next = millis() + 1000;
switch(num % 3)
{
case 0:
drum1.noteOn();
break;
case 1:
drum2.noteOn();
break;
case 2:
drum3.noteOn();
break;
}
num++;
int knobFreq = analogRead(A11); // tune
int knobLength = analogRead(A9); // fine tune
drum1.frequency(knobFreq*2);
drum2.frequency(knobFreq*2);
drum3.frequency(knobFreq*2);
drum1.length(knobLength*2);
drum2.length(knobLength*2);
drum3.length(knobLength*2);
}
}