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

Thread: Hello Teensy world

  1. #1
    Junior Member
    Join Date
    Nov 2021
    Posts
    2

    Hello Teensy world

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    
    // GUItool: begin automatically generated code
    AudioInputI2S            i2s1;           //xy=254.9333267211914,136.93335056304932
    AudioMixer4              mixer2;         //xy=366.3999938964844,968.3999938964844
    AudioEffectDelay         delay3;          //xy=577.3999938964844,970.3999938964844
    AudioMixer4              mixer1;         //xy=584.4000778198242,146.39999961853027
    AudioEffectChorus        chorus2;        //xy=767.3999938964844,1011.3999938964844
    AudioEffectDelay         delay1;         //xy=820.3999938964844,149.39999389648438
    AudioAmplifier           amp2;           //xy=931.4000625610352,1010.400068283081
    AudioEffectChorus        chorus1;        //xy=1006.4000015258789,196.40001106262207
    AudioAmplifier           amp1;           //xy=1100.4000701904297,515.4000396728516
    AudioMixer4              mixer3;         //xy=1370.4000854492188,539.4000425338745
    AudioEffectDelay         Haas_5ms;       //xy=1560.3999938964844,641.3999938964844
    AudioOutputI2S           is2_out;           //xy=1772.3999938964844,470.3999938964844
    
    AudioConnection          patchCord1(i2s1, 0, mixer1, 0);
    AudioConnection          patchCord2(i2s1, 0, mixer2, 0);
    AudioConnection          patchCord3(mixer2, delay3);
    AudioConnection          patchCord4(delay3, 7, chorus2, 0);
    AudioConnection          patchCord5(mixer1, delay1);
    AudioConnection          patchCord6(chorus2, amp2);
    AudioConnection          patchCord7(delay1, 7, chorus1, 0);
    AudioConnection          patchCord8(amp2, 0, mixer3, 1);
    AudioConnection          patchCord9(amp2, 0, mixer1, 1);
    AudioConnection          patchCord10(chorus1, amp1);
    AudioConnection          patchCord11(amp1, 0, mixer2, 1);
    AudioConnection          patchCord12(amp1, 0, mixer3, 0);
    AudioConnection          patchCord13(amp1, 0, mixer1, 2);
    AudioConnection          patchCord14(mixer3, 0, is2_out, 0);
    AudioConnection          patchCord15(mixer3, Haas_5ms);
    AudioConnection          patchCord16(Haas_5ms, 7, is2_out, 1);
    
    AudioControlSGTL5000     sgtl5000_1;     //xy=175.9333267211914,238.40006065368652
    // GUItool: end automatically generated code
    
    // GUItool: end automatically generated code
    
    
    void setup() {
      // put your setup code here, to run once
      Serial.begin(9600); //opens the USB port and set Baud rate
      
      AudioMemory(8);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.5);
      sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
      sgtl5000_1.micGain(36);
      delay(1000);
    
      mixer1.gain(0, 0.5);
      mixer1.gain(1, 0.5);
      mixer2.gain(0, 0.5);
      mixer2.gain(1, 0.5);
    
    }  
    
    void loop() {
      // put your main code here, to run repeatedly:
    
    }
    The above is what I have so far. My question is how do I proceed to understand this? I found the "Serial" function described in Arduino and setting the Baud rate would be a reasonable thing to do but I am not clear what the destination of the serial data is. Is it a Pseudo terminal?
    My next concern is AudioMemory(8). Where is this function defined if that is what it is and how is it possible to systematically find where it is defined so that I do not need to ask again? I have found methods of setting the value but I am not at that point in the project. I would appreciate any assistance because I do not support the physics philosophy of "just calculate" and prefer to understand the source of what I am doing rather than stitching together some examples .

    Peter

    Hardware:
    Teensy 4.1
    Audio Shield 4.0

    Unconnected because I have not yet received delivery of the header.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Echo chamber 0v01.jpg 
Views:	19 
Size:	118.1 KB 
ID:	26729  

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,460
    You have the source code within the Teensyduino app, though precisely where the files live
    depends on OS. I simply grep the source tree locally to find stuff. There are many similar
    code search tools available, absolutely invaluable.

    The GIT repo for the audio stuff is at https://github.com/PaulStoffregen/Audio
    and in AudioStream.* at
    https://github.com/PaulStoffregen/cores

  3. #3
    Junior Member
    Join Date
    Nov 2021
    Posts
    2
    Thank you MarkT.
    I was watching a video of the origins of grep some days ago. I have not used it for some time.
    The technique worked, It is part of AudioStream
    Peter
    Last edited by Peter DPM47; 11-30-2021 at 04:53 PM.

Posting Permissions

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