Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy 3-6 DACS issue

  1. #1
    Member darioconcilio's Avatar
    Join Date
    Feb 2016
    Location
    Varese, Italy
    Posts
    44

    Teensy 3-6 DACS issue

    Hi guys,
    I'm working with Teensy 3.6 and DACS.

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthWaveformSine   sine1;          //xy=484,352
    AudioSynthKarplusStrong  string1;        //xy=490,444
    AudioOutputAnalogStereo  dacs1;          //xy=706,404
    AudioConnection          patchCord1(sine1, 0, dacs1, 0);
    AudioConnection          patchCord2(string1, 0, dacs1, 1);
    // GUItool: end automatically generated code
    As you can see in the pasted example, I'm trying to use the object DACS and send out 2 different mono signals to 2 mono outputs (destination = two loudspeakers).
    I'd like to hear sine1 only in left channel (PAN 100% LEFT) and string1 (PAN 100% RIGHT) in right channel, but actually their out they are summed and mixed into a mono signal (PAN 50% LEFT, PAN 50% RIGHT).

    Is it possible to use the 2 channels independently? If yes, how?
    Thanks in advance for your precious advice.
    Best,
    DC

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,940
    Quote Originally Posted by darioconcilio View Post
    Hi guys,
    I'm working with Teensy 3.6 and DACS.

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthWaveformSine   sine1;          //xy=484,352
    AudioSynthKarplusStrong  string1;        //xy=490,444
    AudioOutputAnalogStereo  dacs1;          //xy=706,404
    AudioConnection          patchCord1(sine1, 0, dacs1, 0);
    AudioConnection          patchCord2(string1, 0, dacs1, 1);
    // GUItool: end automatically generated code
    As you can see in the pasted example, I'm trying to use the object DACS and send out 2 different mono signals to 2 mono outputs (destination = two loudspeakers).
    I'd like to hear sine1 only in left channel (PAN 100% LEFT) and string1 (PAN 100% RIGHT) in right channel, but actually their out they are summed and mixed into a mono signal (PAN 50% LEFT, PAN 50% RIGHT).

    Is it possible to use the 2 channels independently? If yes, how?
    Thanks in advance for your precious advice.
    Best,
    DC
    Whole code please!
    what is your setup() function?

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,691
    Quote Originally Posted by darioconcilio View Post
    If yes, how?
    Your code fragment is the correct way.

    Maybe something is wrong in the rest of your code? Or perhaps something isn't right on the hardware side? We can't see your screen or your wires to actually help, unless you show the code and photos.

  4. #4
    Member darioconcilio's Avatar
    Join Date
    Feb 2016
    Location
    Varese, Italy
    Posts
    44
    I'm sorry. I'm checking again my circuit and...
    I had just mistaken the GND pin on the speaker, this created abnormal behavior.
    I'm an idiot! Sorry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •