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

Thread: NoteFrequency HELP!!! Live input

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    9

    NoteFrequency HELP!!! Live input

    What do I need to add to my code to make NoteFrequency example work for a live input.

    I tired the design tool but nothing is printing out in the serial monitor.

    I have the teensy 3.6 and audio shield

    I get the FFT example to work but not the Note Frequency example for live input to work.

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioInputI2S            i2s1;           //xy=103.00000762939453,57.000000953674316
    AudioAnalyzeNoteFrequency notefreq;      //xy=297,56
    AudioConnection          patchCord1(i2s1, 0, notefreq, 0);
    // GUItool: end automatically generated code
    
    IntervalTimer playNoteTimer;
    
    
    //---------------------------------------------------------------------------------------
    void setup() {
    
      Serial.begin(9600);
        AudioMemory(30);
        /*
         
         *  threshold, this is good number.
         */
          notefreq.begin(.15);
        pinMode(LED_BUILTIN, OUTPUT);
        
       
      
    }
    
    void loop() {
        // read back fundamental frequency
        if (notefreq.available()) {
            float note = notefreq.read();
           
            Serial.printf("Note: %3.2f \n", note);
        }
    }

  2. #2
    Junior Member
    Join Date
    Mar 2019
    Posts
    9
    got it working now with a sine wave... going to try with a guitar now

Posting Permissions

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