AudioMemory(6); | AudioMemory(6); | ||||
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.75); | |||||
audioShield.unmuteLineout(); | |||||
audioShield.volume(0.5); | |||||
Serial.begin(9600); | Serial.begin(9600); | ||||
} | } | ||||
// Enable the audio shield, select the input and set the output volume. | // Enable the audio shield, select the input and set the output volume. | ||||
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.75); | |||||
audioShield.unmuteLineout(); | |||||
audioShield.volume(0.5); | |||||
calcBiquad(FILTER_PARAEQ,110,0,0.2,2147483648,44100,updateFilter); | calcBiquad(FILTER_PARAEQ,110,0,0.2,2147483648,44100,updateFilter); | ||||
filterTone_L.updateCoefs(updateFilter); // default set updateCoefs(0,updateFilter); | filterTone_L.updateCoefs(updateFilter); // default set updateCoefs(0,updateFilter); |
l_myEffect.voices(0); | l_myEffect.voices(0); | ||||
r_myEffect.voices(0); | r_myEffect.voices(0); | ||||
// I want output on the line out too | |||||
audioShield.unmuteLineout(); | |||||
// audioShield.muteHeadphone(); | |||||
Serial.println("setup done"); | Serial.println("setup done"); | ||||
AudioProcessorUsageMaxReset(); | AudioProcessorUsageMaxReset(); | ||||
AudioMemoryUsageMaxReset(); | AudioMemoryUsageMaxReset(); |
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.65); | |||||
audioShield.volume(0.5); | |||||
// Warn that the passthru pin is grounded | // Warn that the passthru pin is grounded | ||||
if(!digitalRead(PASSTHRU_PIN)) { | if(!digitalRead(PASSTHRU_PIN)) { | ||||
// PASSTHRU button is pushed. | // PASSTHRU button is pushed. | ||||
l_myEffect.voices(FLANGE_DELAY_PASSTHRU,0,0); | l_myEffect.voices(FLANGE_DELAY_PASSTHRU,0,0); | ||||
r_myEffect.voices(FLANGE_DELAY_PASSTHRU,0,0); | r_myEffect.voices(FLANGE_DELAY_PASSTHRU,0,0); | ||||
// I want output on the line out too | |||||
audioShield.unmuteLineout(); | |||||
Serial.println("setup done"); | Serial.println("setup done"); | ||||
AudioProcessorUsageMaxReset(); | AudioProcessorUsageMaxReset(); |
*/ | */ | ||||
#include <Audio.h> | #include <Audio.h> | ||||
#include <Wire.h> | #include <Wire.h> | ||||
#include <SPI.h> | |||||
#include <SD.h> | #include <SD.h> | ||||
const int myInput = AUDIO_INPUT_LINEIN; | const int myInput = AUDIO_INPUT_LINEIN; | ||||
// Enable the audio shield, select the input and set the output volume. | // Enable the audio shield, select the input and set the output volume. | ||||
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.75); | |||||
audioShield.unmuteLineout(); | |||||
// audioShield.audioProcessorEnable(); // enable the DAP block in SGTL5000 | |||||
audioShield.volume(0.5); | |||||
audioShield.audioPostProcessorEnable(); // enable the DAP block in SGTL5000 | |||||
// audioShield.eqSelect(1); // using PEQ Biquad filters | // audioShield.eqSelect(1); // using PEQ Biquad filters | ||||
// audioShield.eqFilterCount(2); // enable filter 0 & filter 1 | // audioShield.eqFilterCount(2); // enable filter 0 & filter 1 | ||||
calcBiquad(FILTER_PARAEQ,110,0,0.2,524288,44100,updateFilter); // automation negates the need | calcBiquad(FILTER_PARAEQ,110,0,0.2,524288,44100,updateFilter); // automation negates the need |
#include <Audio.h> | #include <Audio.h> | ||||
#include <Wire.h> | #include <Wire.h> | ||||
#include <SPI.h> | |||||
#include <SD.h> | #include <SD.h> | ||||
// Enable the audio shield and set the output volume. | // Enable the audio shield and set the output volume. | ||||
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.75); | |||||
audioShield.unmuteLineout(); | |||||
audioShield.volume(0.5); | |||||
} | } | ||||
elapsedMillis chgMsec=0; | elapsedMillis chgMsec=0; |
#include <Audio.h> | #include <Audio.h> | ||||
#include <Wire.h> | #include <Wire.h> | ||||
#include <SPI.h> | |||||
#include <SD.h> | #include <SD.h> | ||||
const int myInput = AUDIO_INPUT_LINEIN; | const int myInput = AUDIO_INPUT_LINEIN; | ||||
// Enable the audio shield and set the output volume. | // Enable the audio shield and set the output volume. | ||||
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.75); | |||||
audioShield.unmuteLineout(); | |||||
audioShield.volume(0.5); | |||||
} | } | ||||
elapsedMillis chgMsec=0; | elapsedMillis chgMsec=0; |
#include <Audio.h> | #include <Audio.h> | ||||
#include <Wire.h> | #include <Wire.h> | ||||
#include <SPI.h> | |||||
#include <SD.h> | #include <SD.h> | ||||
// Enable the audio shield and set the output volume. | // Enable the audio shield and set the output volume. | ||||
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.75); | |||||
audioShield.unmuteLineout(); | |||||
audioShield.volume(0.5); | |||||
audioShield.audioPreProcessorEnable(); | |||||
// here are some settings for AVC that have a fairly obvious effect | // here are some settings for AVC that have a fairly obvious effect | ||||
audioShield.autoVolumeControl(2,1,0,-5,0.5,0.5); // see comments starting line #699 of control_sgtl5000.cpp in ./libraries/audio/ | audioShield.autoVolumeControl(2,1,0,-5,0.5,0.5); // see comments starting line #699 of control_sgtl5000.cpp in ./libraries/audio/ | ||||
// AVC has its own enable/disable bit | // AVC has its own enable/disable bit | ||||
void loop() { | void loop() { | ||||
// every 10 ms, check for adjustment | // every 10 ms, check for adjustment | ||||
if (chgMsec > 10) { | if (chgMsec > 10) { | ||||
float vol1=analogRead(15)/10.23; | |||||
float vol1=analogRead(15)/1023.0; | |||||
vol1=(int)vol1; | vol1=(int)vol1; | ||||
if(lastVol!=vol1) | if(lastVol!=vol1) | ||||
{ | { |
#include <Audio.h> | #include <Audio.h> | ||||
#include <Wire.h> | #include <Wire.h> | ||||
#include <SPI.h> | |||||
#include <SD.h> | #include <SD.h> | ||||
// Enable the audio shield and set the output volume. | // Enable the audio shield and set the output volume. | ||||
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.inputSelect(myInput); | audioShield.inputSelect(myInput); | ||||
audioShield.volume(0.75); | |||||
audioShield.unmuteLineout(); | |||||
audioShield.volume(0.5); | |||||
// just enable it to use default settings. | // just enable it to use default settings. | ||||
audioShield.audioPostProcessorEnable(); | |||||
audioShield.enhanceBassEnable(); // all we need to do for default bass enhancement settings. | audioShield.enhanceBassEnable(); // all we need to do for default bass enhancement settings. | ||||
// audioShield.enhanceBass((float)lr_level,(float)bass_level); | // audioShield.enhanceBass((float)lr_level,(float)bass_level); | ||||
// audioShield.enhanceBass((float)lr_level,(float)bass_level,(uint8_t)hpf_bypass,(uint8_t)cutoff); | // audioShield.enhanceBass((float)lr_level,(float)bass_level,(uint8_t)hpf_bypass,(uint8_t)cutoff); | ||||
void loop() { | void loop() { | ||||
// every 10 ms, check for adjustment | // every 10 ms, check for adjustment | ||||
if (chgMsec > 10) { // more regular updates for actual changes seems better. | if (chgMsec > 10) { // more regular updates for actual changes seems better. | ||||
float vol1=analogRead(15)/10.23; | |||||
float vol1=analogRead(15)/1023.0; | |||||
vol1=(int)vol1; | vol1=(int)vol1; | ||||
if(lastVol!=vol1) | if(lastVol!=vol1) | ||||
{ | { |
audioShield.enable(); | audioShield.enable(); | ||||
audioShield.volume(0.5); | audioShield.volume(0.5); | ||||
// I want output on the line out too | |||||
audioShield.unmuteLineout(); | |||||
// audioShield.muteHeadphone(); | |||||
Serial.println("setup done"); | Serial.println("setup done"); | ||||
codec.enable(); | codec.enable(); | ||||
codec.volume(0.45); | codec.volume(0.45); | ||||
// I want output on the line out too | |||||
// Comment this if you don't it | |||||
codec.unmuteLineout(); | |||||
// reduce the gain on some channels, so half of the channels | // reduce the gain on some channels, so half of the channels | ||||
// are "positioned" to the left, half to the right, but all | // are "positioned" to the left, half to the right, but all |