emmanuel63
Well-known member
Hello,
I have made a simple sample player with teensy 3.6 + audio shield. The samples are stored on buitin SD card and triggered with a bunch of Touch pins. To maximize polyphony and time access, my samples are mono.
When I trigger these mono samples, I have noticed short clics and cracks at the very begining of the playing. But when doing the same test with stereo samples : no cracks and clics (but of course reduced polyphony).
I tried to add envelopes with short attacks, delays and all kind of tweakings, but it doesn't solve the problem.
Any idea or test to do ?
Here is a basic sketch for testing. Set for T3.6 + audioshield + builtin SD.
Thank you for any help.
Emmanuel
I have made a simple sample player with teensy 3.6 + audio shield. The samples are stored on buitin SD card and triggered with a bunch of Touch pins. To maximize polyphony and time access, my samples are mono.
When I trigger these mono samples, I have noticed short clics and cracks at the very begining of the playing. But when doing the same test with stereo samples : no cracks and clics (but of course reduced polyphony).
I tried to add envelopes with short attacks, delays and all kind of tweakings, but it doesn't solve the problem.
Any idea or test to do ?
Here is a basic sketch for testing. Set for T3.6 + audioshield + builtin SD.
Thank you for any help.
Emmanuel
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
AudioPlaySdWav playSdWav1;
AudioOutputI2S i2s1;
AudioConnection patchCord1(playSdWav1, 0, i2s1, 0);
AudioConnection patchCord2(playSdWav1, 1, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1;
// Use these with the Teensy 3.5 & 3.6 SD card
#define SDCARD_CS_PIN BUILTIN_SDCARD
//number of touch pin used
const byte touch_pin_number = 2;
//touch_pins#
const byte touch_pins[] = {0, 1, 16, 17, 22, 23};
//this arrays stores touch pin output values
int touch_value[touch_pin_number];
//touch threshold
const int threshold = 2000;
//touched or not touched
bool touchStatus[touch_pin_number];
void setup() {
Serial.begin(9600);
AudioMemory(8 );
sgtl5000_1.enable();
sgtl5000_1.volume(0.3);
//Initializes SD
SD.begin(SDCARD_CS_PIN);
}
void loop() {
for (int i = 0; i < touch_pin_number; i++) {
touch_value[i] = touchRead(touch_pins[i]);
if (touch_value[i] > threshold && touchStatus[i] == 0) {
Serial.println("touched");
touchStatus[i] = 1;
playSdWav1.play("marimba/60.wav");
}
if (touch_value[i] < threshold && touchStatus[i] == 1) {
Serial.println("released");
touchStatus[i] = 0;
}
}
}