Skip to content

analogRead reference doesn't work in my case  #7

Open

Description

@neophyte006

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

Activity

  1. ghostintranslation commented on Jan 5, 2020

    @ghostintranslation
    Owner

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

  2. neophyte006 commented on Jan 5, 2020

    @neophyte006
    Author

    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.

  3. ghostintranslation commented on Jan 5, 2020

    @ghostintranslation
    Owner

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions