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

Thread: Biquad setLowShelf / setHighShelf methods not accessable from Audio library

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    19

    Biquad setLowShelf / setHighShelf methods not accessable from Audio library

    This is so odd... and I can't figure out the problem.

    I'm making a simple usb external audio adapter to test out filters for a larger project, but the compiler doesn't recognize the setLowShelf and setHighShelf biquad members. I get the following error: "ExternalTeensySoundCard:49: error: 'class AudioFilterBiquad' has no member named 'setHighShelf'".

    There is only a single Audio-master library on the system, and the filter_biquad.h file defines both the setLowShelf and setHighShelf methods, but the IDE just can't find them. Other functions work.

    Just a note... the keywords.txt file does not contain KEYWORD2 entries for either, but contains LITERAL1 entries for both.
    FILTER_LOSHELF LITERAL1
    FILTER_HISHELF LITERAL1
    If I add entries for the associated KEYWORD2s, they get highlighted in the IDE, but still get the error and doesn't compile.

    Hope somebody can help. Thanks.

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioInputUSB            usb1;           //xy=63.19999694824219,127.19999694824219
    AudioInputI2S            i2s1;           //xy=64.19999694824219,221.1999969482422
    AudioFilterBiquad        biquad1;        //xy=228.1999969482422,323.20001220703125
    AudioFilterBiquad        biquad2;        //xy=225.1999969482422,363.20001220703125
    AudioFilterBiquad        biquad3;        //xy=227.1999969482422,400.20001220703125
    AudioFilterBiquad        biquad4;        //xy=227.1999969482422,438.20001220703125
    AudioMixer4              mixer2;         //xy=372.20001220703125,283.20001220703125
    AudioMixer4              mixer1;         //xy=373.20001220703125,215.1999969482422
    AudioFilterStateVariable filter1;        //xy=534.2000122070312,367.20001220703125
    AudioFilterStateVariable filter2;        //xy=534.2000122070312,429.20001220703125
    AudioOutputUSB           usb2;           //xy=695.2000122070312,216.1999969482422
    AudioOutputI2S           i2s2;           //xy=695.2000122070312,273
    AudioConnection          patchCord1(usb1, 0, mixer1, 0);
    AudioConnection          patchCord2(usb1, 1, mixer2, 0);
    AudioConnection          patchCord3(i2s1, 0, mixer1, 1);
    AudioConnection          patchCord4(i2s1, 1, mixer2, 1);
    AudioConnection          patchCord5(mixer2, 0, usb2, 1);
    AudioConnection          patchCord6(mixer2, 0, i2s2, 1);
    AudioConnection          patchCord7(mixer1, 0, usb2, 0);
    AudioConnection          patchCord8(mixer1, 0, i2s2, 0);
    AudioControlSGTL5000     sgtl5000_1;     //xy=512.2000122070312,129
    // GUItool: end automatically generated code
    
    
      float freq  = 2000.0f;
      float tGain =  -10.0f;
      float slope =    0.05f;
    
    
    void setup()
    {
      // Enable the audio shield and set the output volume.
      AudioMemory( 10 );
      sgtl5000_1.enable();
      sgtl5000_1.volume( 0.5 );
      sgtl5000_1.inputSelect( AUDIO_INPUT_MIC );
      sgtl5000_1.micGain( 36 );
      delay( 1000 );
      biquad1.setHighShelf( 0, freq, tGain, slope );  //stage, freq, gain, slope
      biquad2.setHighShelf( 0, freq, tGain, slope );  //stage, freq, gain, slope
      biquad3.setHighShelf( 0, freq, tGain, slope );  //stage, freq, gain, slope
      biquad4.setHighShelf( 0, freq, tGain, slope );  //stage, freq, gain, slope
    }
    
    void loop()
    {
      delay( 20 );
    }

  2. #2
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    843
    Builds fine for me, do you have the latest Teensyduino downloaded and installed?

  3. #3
    Junior Member
    Join Date
    Jun 2013
    Posts
    19
    Pretty recent--probably not the latest. It's a development shop, so we keep at the same version until it's time to migrate to the next. I'll check tomorrow when I get back to work what the version is; but I'm dubious that it's the problem, though. Do you have something in mind that would point to the Teensyduino version?

  4. #4
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    843
    Quote Originally Posted by insane View Post
    Pretty recent--probably not the latest. It's a development shop, so we keep at the same version until it's time to migrate to the next. I'll check tomorrow when I get back to work what the version is; but I'm dubious that it's the problem, though. Do you have something in mind that would point to the Teensyduino version?
    Looks like it was added on Jul 18, 2016, check your Audio library's filter_biquad.h to see if those fuctions are there.

  5. #5
    Junior Member
    Join Date
    Jun 2013
    Posts
    19
    Quote Originally Posted by duff View Post
    Looks like it was added on Jul 18, 2016, check your Audio library's filter_biquad.h to see if those fuctions are there.
    Yes...did that. 3rd paragraph of my OP.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,870
    Quote Originally Posted by insane View Post
    There is only a single Audio-master library on the system,
    Please verify this. If Arduino has found more than 1 library, it will print info about the libs it found and which one it is using and which others it is ignoring. Older Arduino printed this for all cases, but newer versions only show this info when the compile fails. Scroll up and look carefully for any messages about detecting multiple copies of various libs. It should show the full pathname of the one it's really using, and the others it is not.

  7. #7
    Junior Member
    Join Date
    Jun 2013
    Posts
    19
    That was indeed the problem, it was finding the older library in C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio.
    The default compile gives no indication of multiple libraries:

    Code:
    ExternalTeensySoundCard: In function 'void setup()':
    ExternalTeensySoundCard:46: error: 'class AudioFilterBiquad' has no member named 'setHighShelf'
       biquad1.setHighShelf( 0, freq, tGain, slope );  //stage, freq, gain, slope
    
               ^
    
    'class AudioFilterBiquad' has no member named 'setHighShelf'
    ...but specifying the verbose directive reveals the actual source of the library:

    Code:
    ExternalTeensySoundCard: In function 'void setup()':
    ExternalTeensySoundCard:46: error: 'class AudioFilterBiquad' has no member named 'setHighShelf'
       biquad1.setHighShelf( 0, freq, tGain, slope );  //stage, freq, gain, slope
    
               ^
    
    Using library Audio at version 1.03 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio 
    Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI 
    Using library SD at version 1.0.8 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD 
    Using library SerialFlash at version 0.4 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash 
    Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire 
    'class AudioFilterBiquad' has no member named 'setHighShelf'
    So, if I delete the old Audio library, the (up-to-date) one in Documents\Arduino\libraries is used. That fixes this problem. However, I was under the impression that libraries and hardware defs would be first used from Documents\Arduino\libraries and Documents\Arduino\hardware as the default. Isn't there some technique to make those directories the priorities?

Posting Permissions

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