Getting the audio editor up and running on Teensy 4.0

Status
Not open for further replies.

windpspirit

New member
Hi folks, first post. Apologies for the beginner nature of the questions I am new to both the teensy audio editor and the teensy 4.0 and running into some compiler errors. I did a search on the forum to no help, hopefully I'm just making a silly rookie mistake.

I'm trying to run a patch just to test audio out functionality of the teensy using PWM, basic "hello world" for audio kind of program. Here is my code:

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthWaveformSine   sine1;          //xy=323,296
AudioOutputPWM           pwm1;           //xy=501,292
AudioConnection          patchCord1(sine1, pwm1);
// GUItool: end automatically generated code


void setup() {
  // put your setup code here, to run once:
   AudioMemory(20);
  sine1.amplitude(1.0);
  sine1.frequency(440);
}

void loop() {
  // put your main code here, to run repeatedly:

}

When I try to compile and upload I am hit with the following errors:

C:\Users\ile\AppData\Local\Temp\arduino_build_740388\sketch\teensy_4_audio_test.ino.cpp.o: In function `AudioOutputPWM::AudioOutputPWM()':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/output_pwm.h:37: undefined reference to `AudioOutputPWM::begin()'

C:\Users\ile\AppData\Local\Temp\arduino_build_740388\sketch\teensy_4_audio_test.ino.cpp.o: In function `AudioStream::AudioStream(unsigned char, audio_block_struct**)':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/AudioStream.h:130: undefined reference to `vtable for AudioOutputPWM'

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "Audio.h"
Used: C:\Program
Multiple libraries were found for "SPI.h"
Used: C:\Program
Multiple libraries were found for "SD.h"
Used: C:\Program
Not used: C:\Program
Multiple libraries were found for "SerialFlash.h"
Used: C:\Program
Multiple libraries were found for "Wire.h"
Used: C:\Program
Error compiling for board Teensy 4.0.

Just to test I tried to upload the example patch "passThroughMono" which also uses PWM output and got the same sort of errors. I've upgraded to the most recent version of Arduino and reinstalled the teensyduino uploader after teensy 4.0 came out. I went to the folder path named in the "undefined reference" error just to be sure that everything looked right, the "Audio.h" library is there with only one instance that I can find and the "output_pwm.cpp" and "output_pwm.h" files that I would expect to contain the functions not found are both in the same folder as the "Audio.h" file. I tried all of the different COM ports that showed up in the drop down list and they all gave the same error. Teensy 4.0 was listed as one of them so I am pretty sure it is being recognised correctly.

Any help with this is greatly appreciated. Its my first teensy audio editor project so I'm pretty sure I'm just doing something wrong that would be obvious to someone more experienced.

I'm running windows 10 Pro version 1903 (64 bit) on a Lenovo Thinkpad Yoga X1. Let me know if any other details would be helpful.

Thank you!
 
Status
Not open for further replies.
Back
Top