Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Basic help - mixer, levels and peak

  1. #1
    Member dimitre's Avatar
    Join Date
    Aug 2016
    Location
    São Paulo
    Posts
    95

    Basic help - mixer, levels and peak

    Hello, I'm testing an audio project and would like to ask very basic questions:

    I'm conneting a Korg Minilogue to Teensy Audio Line In, for now just trying to find the right gain without distortion.
    I've put up a very simple sketch to listen input and plot peaks.
    Code:
    #include <Audio.h>
    
    AudioAnalyzePeak         peak1;
    AudioInputI2S            i2sInput;
    AudioOutputI2S           i2sOutput;
    AudioConnection          saida1(i2sInput, 0, i2sOutput, 0);
    AudioConnection          saida2(i2sInput, 0, i2sOutput, 1);
    AudioControlSGTL5000     audioShield;
    
    void setup(void) {
    	AudioMemory(8);
    	audioShield.enable();
    	audioShield.inputSelect(AUDIO_INPUT_LINEIN);
    	audioShield.volume(0.5);
    }
    
    void loop() {
    	if (peak1.available()) {
    		Serial.println(peak1.read());
    	}
    }

    Should I try to find the right gain, both in the instrument and audioShield.volume so the peaks aren't 1 or near, right?
    I found I have to lower a lot the instrument gain like 25% to be OK.
    Is there some way of lowering the line in gain? I suppose if I use a mixer after audioShield object it will already be clipping.

    Thanks

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,854
    The audioShield.lineInLevel(level) function controls line in.
    See the audio design tool for details of the level which can have values from zero to 15.

    Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •