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

Thread: Pipe organ tuner

  1. #1
    Member
    Join Date
    Feb 2015
    Location
    Rians in Provence, France
    Posts
    53

    Pipe organ tuner

    Dear all,
    I'm using the Audio Shield for Pipe Organ tuning.
    I am using Arduino 1.6.7
    I wrote the following program, which outputs only a constant value, when sending a .wav file via the Line Out connector of a PC running XP.
    Thanks for your help !

    Pascal Leray

    #include <Wire.h>
    #include <Audio.h>
    #include <analyze_notefreq.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    #include <FreqMeasure.h>
    #define LED 13

    // GUItool: begin automatically generated code
    AudioPlaySdWav playWav1;
    AudioInputAnalog adc1; //xy=173,172
    AudioAnalyzePeak peak1;
    AudioInputI2S i2s2; //xy=177,419
    AudioAnalyzeNoteFrequency notefreq1; //xy=361,413
    AudioOutputAnalog dac1; //xy=533,174
    AudioConnection patchCord1(adc1, dac1);
    AudioConnection patchCord2(i2s2, 0, notefreq1, 0);
    AudioControlSGTL5000 sgtl5000_1;
    // GUItool: end automatically generated code
    float note;
    float prob;
    long temps = 0;

    void setup()
    {
    // put your setup code here, to run once:
    delay(10);
    AudioMemory(50);

    sgtl5000_1.enable();
    sgtl5000_1.volume(0.5);
    Serial.begin(9600);
    notefreq1.begin(1.);
    pinMode(LED, OUTPUT);

    }

    void loop()
    {
    // put your main code here, to run repeatedly:
    delay(100);
    digitalWrite(LED, HIGH);
    delay(100);
    if(notefreq1.available())
    {
    note = notefreq1.read();
    prob = notefreq1.probability();
    // Serial.printf("%ld Note: %3.2f | Probability: %.2f\n", temps,note, prob);
    }
    Serial.printf("%ld Note: %3.2f | Probability: %.2f\n", temps,note, prob);
    temps++;

    digitalWrite(LED, LOW);

    }

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Quote Originally Posted by LERAY View Post
    Thanks for your help !
    I missed your question. What sort of help did you want?

  3. #3
    Member
    Join Date
    Feb 2015
    Location
    Rians in Provence, France
    Posts
    53
    The program is only giving a constant frequency value. Even when no signal is sent to the audio inputs.
    May be some statements are missing ?
    Thanks foryour help !

    Pascal

Posting Permissions

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