Переглянути джерело

Udate SGTL5000 examples

dds
PaulStoffregen 10 роки тому
джерело
коміт
9f167ace1f
11 змінених файлів з 18 додано та 31 видалено
  1. +1
    -2
      examples/Analysis/StereoPeakMeter/StereoPeakMeter.ino
  2. +1
    -2
      examples/Effects/CalcBiquadToneControl/CalcBiquadToneControl.ino
  3. +0
    -4
      examples/Effects/Chorus/Chorus.ino
  4. +1
    -4
      examples/Effects/Flange/Flange.ino
  5. +3
    -3
      examples/HardwareTesting/SGTL5000_Specific/CalcBiquadToneControlDAP/CalcBiquadToneControlDAP.ino
  6. +2
    -2
      examples/HardwareTesting/SGTL5000_Specific/balanceDAC/balanceDAC.ino
  7. +2
    -2
      examples/HardwareTesting/SGTL5000_Specific/balanceHP/balanceHP.ino
  8. +4
    -3
      examples/HardwareTesting/SGTL5000_Specific/dap_avc_agc/dap_avc_agc.ino
  9. +4
    -3
      examples/HardwareTesting/SGTL5000_Specific/dap_bass_enhance/dap_bass_enhance.ino
  10. +0
    -3
      examples/HardwareTesting/ToneSweep/ToneSweep.ino
  11. +0
    -3
      examples/Synthesis/PlaySynthMusic/PlaySynthMusic.ino

+ 1
- 2
examples/Analysis/StereoPeakMeter/StereoPeakMeter.ino Переглянути файл

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);
} }



+ 1
- 2
examples/Effects/CalcBiquadToneControl/CalcBiquadToneControl.ino Переглянути файл

// 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);

+ 0
- 4
examples/Effects/Chorus/Chorus.ino Переглянути файл

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();

+ 1
- 4
examples/Effects/Flange/Flange.ino Переглянути файл



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();

+ 3
- 3
examples/HardwareTesting/SGTL5000_Specific/CalcBiquadToneControlDAP/CalcBiquadToneControlDAP.ino Переглянути файл

*/ */
#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

+ 2
- 2
examples/HardwareTesting/SGTL5000_Specific/balanceDAC/balanceDAC.ino Переглянути файл



#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;

+ 2
- 2
examples/HardwareTesting/SGTL5000_Specific/balanceHP/balanceHP.ino Переглянути файл



#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;

+ 4
- 3
examples/HardwareTesting/SGTL5000_Specific/dap_avc_agc/dap_avc_agc.ino Переглянути файл



#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)
{ {

+ 4
- 3
examples/HardwareTesting/SGTL5000_Specific/dap_bass_enhance/dap_bass_enhance.ino Переглянути файл



#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)
{ {

+ 0
- 3
examples/HardwareTesting/ToneSweep/ToneSweep.ino Переглянути файл



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");



+ 0
- 3
examples/Synthesis/PlaySynthMusic/PlaySynthMusic.ino Переглянути файл

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

Завантаження…
Відмінити
Зберегти