Where is Audio Library Located in the New Arduino 2.0 IDE?

grinch

Well-known member
Hi, I need to find where the audio library is installed on the new Arduino IDE (2.3.2). I used to be able to find it easily when using teensyduino, but cannot find where the folder referenced by the new ide install is located. I can even open the files as read only, but cannot get the ide to tell me where the file is located so I can edit it.

I need to fix a small bug in the library that is breaking my project, please let me know.
 
Bit hard to say since my crystal ball doesn't know which OS you're using. On windows it's under:
%localappdata%/Arduino15/packages/teensy/hardware/avr/$(SOME_NUMBERS_MATCHING_THE_TEENSYDUINO_VERSION)/libraries/Audio
 
Click File > Preferences (or perhaps Arduino > Settings if using MacOS) and turn on verbose output during compile.

Once this is enabled, Arduino IDE will print much more info. Near the end (you may need to scroll up slightly) will be the list of all libraries it used with their full pathnames.

It also should print the library list when you have compile errors. But the default behavior is to print less info when your project compiles properly.
 
Bit hard to say since my crystal ball doesn't know which OS you're using. On windows it's under:
%localappdata%/Arduino15/packages/teensy/hardware/avr/$(SOME_NUMBERS_MATCHING_THE_TEENSYDUINO_VERSION)/libraries/Audio
OSX 13.0 - IDE 2.3.2
 
On MacOS with Arduino IDE 2.0.0 or later, the default location is /Users/{username}/Library/Arduino15/packages/teensy/hardware/avr/{version}/libraries/Audio
 
On MacOS with Arduino IDE 2.0.0 or later, the default location is /Users/{username}/Library/Arduino15/packages/teensy/hardware/avr/{version}/libraries/Audio
That is it! Thank you!

For reference the issue I was having is related to an optimization where synth objects don't generate an output buffer if their amplitude is set to 0:

Code:
void AudioSynthWaveform::update(void)
{
    audio_block_t *block;
    int16_t *bp, *end;
    int32_t val1, val2;
    int16_t magnitude15;
    uint32_t i, ph, index, index2, scale;
    const uint32_t inc = phase_increment;


    ph = phase_accumulator + phase_offset;
    if (magnitude == 0) {
        phase_accumulator += inc * AUDIO_BLOCK_SAMPLES;
        return;
    }

This was causing objects downstream to not update, my project uses some of these objects as timing sources, leading to some extremely confusing bugs.

I also often use AudioSynthWaveform as a CV source using both oscillator and offset to control objects downstream. Really nice in that it can switch from an LFO to pot control in a single object. The fact that offset doesn't work when magnitude is zero was also causing unexpected behavior so I needed to update this.
 
Back
Top