Browse Source

Udate SGTL5000 examples

dds
PaulStoffregen 10 years ago
parent
commit
9f167ace1f
11 changed files with 18 additions and 31 deletions
  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 View File

@@ -28,8 +28,7 @@ void setup() {
AudioMemory(6);
audioShield.enable();
audioShield.inputSelect(myInput);
audioShield.volume(0.75);
audioShield.unmuteLineout();
audioShield.volume(0.5);
Serial.begin(9600);
}


+ 1
- 2
examples/Effects/CalcBiquadToneControl/CalcBiquadToneControl.ino View File

@@ -39,8 +39,7 @@ void setup() {
// Enable the audio shield, select the input and set the output volume.
audioShield.enable();
audioShield.inputSelect(myInput);
audioShield.volume(0.75);
audioShield.unmuteLineout();
audioShield.volume(0.5);

calcBiquad(FILTER_PARAEQ,110,0,0.2,2147483648,44100,updateFilter);
filterTone_L.updateCoefs(updateFilter); // default set updateCoefs(0,updateFilter);

+ 0
- 4
examples/Effects/Chorus/Chorus.ino View File

@@ -135,10 +135,6 @@ void setup() {
l_myEffect.voices(0);
r_myEffect.voices(0);

// I want output on the line out too
audioShield.unmuteLineout();
// audioShield.muteHeadphone();
Serial.println("setup done");
AudioProcessorUsageMaxReset();
AudioMemoryUsageMaxReset();

+ 1
- 4
examples/Effects/Flange/Flange.ino View File

@@ -104,7 +104,7 @@ void setup() {

audioShield.enable();
audioShield.inputSelect(myInput);
audioShield.volume(0.65);
audioShield.volume(0.5);
// Warn that the passthru pin is grounded
if(!digitalRead(PASSTHRU_PIN)) {
@@ -125,9 +125,6 @@ void setup() {
// PASSTHRU button is pushed.
l_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");
AudioProcessorUsageMaxReset();

+ 3
- 3
examples/HardwareTesting/SGTL5000_Specific/CalcBiquadToneControlDAP/CalcBiquadToneControlDAP.ino View File

@@ -4,6 +4,7 @@ This example code is in the public domain
*/
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>

const int myInput = AUDIO_INPUT_LINEIN;
@@ -30,9 +31,8 @@ void setup() {
// Enable the audio shield, select the input and set the output volume.
audioShield.enable();
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.eqFilterCount(2); // enable filter 0 & filter 1
calcBiquad(FILTER_PARAEQ,110,0,0.2,524288,44100,updateFilter); // automation negates the need

+ 2
- 2
examples/HardwareTesting/SGTL5000_Specific/balanceDAC/balanceDAC.ino View File

@@ -5,6 +5,7 @@ This example code is in the public domain

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>


@@ -34,8 +35,7 @@ void setup() {
// Enable the audio shield and set the output volume.
audioShield.enable();
audioShield.inputSelect(myInput);
audioShield.volume(0.75);
audioShield.unmuteLineout();
audioShield.volume(0.5);
}

elapsedMillis chgMsec=0;

+ 2
- 2
examples/HardwareTesting/SGTL5000_Specific/balanceHP/balanceHP.ino View File

@@ -5,6 +5,7 @@ This example code is in the public domain

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>

const int myInput = AUDIO_INPUT_LINEIN;
@@ -34,8 +35,7 @@ void setup() {
// Enable the audio shield and set the output volume.
audioShield.enable();
audioShield.inputSelect(myInput);
audioShield.volume(0.75);
audioShield.unmuteLineout();
audioShield.volume(0.5);
}

elapsedMillis chgMsec=0;

+ 4
- 3
examples/HardwareTesting/SGTL5000_Specific/dap_avc_agc/dap_avc_agc.ino View File

@@ -5,6 +5,7 @@ This example code is in the public domain

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>


@@ -34,8 +35,8 @@ void setup() {
// Enable the audio shield and set the output volume.
audioShield.enable();
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
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
@@ -48,7 +49,7 @@ float lastVol=1024;
void loop() {
// every 10 ms, check for adjustment
if (chgMsec > 10) {
float vol1=analogRead(15)/10.23;
float vol1=analogRead(15)/1023.0;
vol1=(int)vol1;
if(lastVol!=vol1)
{

+ 4
- 3
examples/HardwareTesting/SGTL5000_Specific/dap_bass_enhance/dap_bass_enhance.ino View File

@@ -5,6 +5,7 @@ This example code is in the public domain

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>


@@ -34,9 +35,9 @@ void setup() {
// Enable the audio shield and set the output volume.
audioShield.enable();
audioShield.inputSelect(myInput);
audioShield.volume(0.75);
audioShield.unmuteLineout();
audioShield.volume(0.5);
// just enable it to use default settings.
audioShield.audioPostProcessorEnable();
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,(uint8_t)hpf_bypass,(uint8_t)cutoff);
@@ -49,7 +50,7 @@ float lastVol=1024;
void loop() {
// every 10 ms, check for adjustment
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;
if(lastVol!=vol1)
{

+ 0
- 3
examples/HardwareTesting/ToneSweep/ToneSweep.ino View File

@@ -55,9 +55,6 @@ void setup(void)

audioShield.enable();
audioShield.volume(0.5);
// I want output on the line out too
audioShield.unmuteLineout();
// audioShield.muteHeadphone();

Serial.println("setup done");


+ 0
- 3
examples/Synthesis/PlaySynthMusic/PlaySynthMusic.ino View File

@@ -143,9 +143,6 @@ void setup()
codec.enable();
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
// are "positioned" to the left, half to the right, but all

Loading…
Cancel
Save