TeensyAudio / Wavetable-Synthesis

General repository for Wavetable Synthesis Capstone project at Portland State, Fall 2016 - Winter 2017
89 stars 19 forks source link

no matching function for call to 'AudioSynthWavetable::setInstrument(const instrument_data&)' #4

Open zumdar opened 1 year ago

zumdar commented 1 year ago

I can't seem to get the example sketches to compile. I keep on getting this error:

no matching function for call to 'AudioSynthWavetable::setInstrument(const instrument_data&)'

I think it has to do with the Teensy Audio library having the same AudioSynthWavetable class as the one defined in this Wavetable-Synthesis library. I'm sure there is an easy fix, but I've been wrangling with this for a while now and can't seem to figure it out.

heres the full error:

In file included from C:\Users\moogtron 4k\Documents\Arduino\wav_player_w_synth\wav_player_w_synth.ino:8:0: C:\Users\moogtron 4k\Documents\Arduino\libraries\Wavetable-Synthesis-master/AudioSynthWavetable.h:46:7: error: redefinition of 'class AudioSynthWavetable' class AudioSynthWavetable : public AudioStream ^ In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/Audio.h:137:0, from C:\Users\moogtron 4k\Documents\Arduino\wav_player_w_synth\wav_player_w_synth.ino:1: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/synth_wavetable.h:38:7: error: previous definition of 'class AudioSynthWavetable' class AudioSynthWavetable : public AudioStream ^ wav_player_w_synth: In function 'void setup()': wav_player_w_synth:62: error: no matching function for call to 'AudioSynthWavetable::setInstrument(const instrument_data&)' wavetable1.setInstrument(EthansWindChimes); ^ In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/Audio.h:137:0, from C:\Users\moogtron 4k\Documents\Arduino\wav_player_w_synth\wav_player_w_synth.ino:1: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/synth_wavetable.h:103:7: note: candidate: void AudioSynthWavetable::setInstrument(const AudioSynthWavetable::instrument_data&) void setInstrument(const instrument_data& instrument) { ^ C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio/synth_wavetable.h:103:7: note: no known conversion for argument 1 from 'const instrument_data' to 'const AudioSynthWavetable::instrument_data&' Multiple libraries were found for "SD.h" Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD Not used: C:\Program Files (x86)\Arduino\libraries\SD Using library Audio at version 1.3 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.2.2 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD Using library SerialFlash at version 0.5 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 Using library Bounce in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Bounce (legacy) Using library Wavetable-Synthesis-master in folder: C:\Users\moogtron 4k\Documents\Arduino\libraries\Wavetable-Synthesis-master (legacy) no matching function for call to 'AudioSynthWavetable::setInstrument(const instrument_data&)'

zumdar commented 1 year ago

update!! read this if things arent working for you

ahhhh ok i have solved this problem after many hours of sleuthing and messing around......... for anyone in the future trying to use this soundfont decoder and class

  1. this project has gotten integrated into the main teensyduino audio library, therefore you dont need to add any files from here to your Arduino library folder! (even tho it says so here on the documentation website )
  2. the examples here have been deprecated. DONT USE the examples here, use the ones in the Teensyduino audio example folder
  3. the decoder has been deprecated. please for the love of god download Pauls updated decoder, and replace the files in this github repo with Paul's files. The .exe miiight still work, but I didnt risk it, i just ran python controller.py from the terminal.
  4. NOW you have properly decoded soundfont file and using that with the Wavetable examples from Teensyduio you should be able to make all the fun goofy midi sounds your heart desires

this is an awesome tool thank yall for making it! Pleaseee update the main github readme so others wont tear their hair out for hours trying to figure out how to get this to work.