ghostintranslation/SimpleSynth

analogRead reference doesn't work in my case

Opened this issue · 3 comments

Synth synth(0, 1, 2, 3, 4, 5, 6, 7, 8);

Replacing by
Synth synth(A0, A1, A2, A3, A4, A5, A6, A7, A8);
has fixed the problem

Hi,
Funny for me plain numbers work. What's your setup? Teensy version, Teensyduino version?

Hey, I am using the Teensy 3.6 with Teensy Loader 1.48. Just to make sure, I didn't do any misstake i doublechecked it now and it won't work with plain numbers. I also checked some examples where it also uses plain numbers. I'm quite new in the teensy area but for Arduino it was always confusing to me that pin numbers were used (in your case A0 would refere to Pin14).
Another thing that stood out was the gain. You defined it in the setup function as "sgtl5000_1.volume(2);". Fullscale ends at 1.0 and this leads to clipping and that means distortion. I would suggest you to choose a value of maximum 0.8 to leave some headroom. I normally choose something like 0.5 what is totally fine to listen to with 250 Ohm Headphones.

Quote from Teensy Audio System Design Tool: Set the headphone volume level. Range is 0 to 1.0, but 0.8 corresponds to the maximum undistorted output for a full scale signal. Usually 0.5 is a comfortable listening level. The line level outputs are not changed by this function.

I agree with using the variables that are meant for that instead of plain numbers, and also the volume is a mistake.

Here is the pull request, can you confirm that was what you noticed?
#8