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

Thread: Do I need an external audio shield and/or amplifier to generate notes??

  1. #1

    Do I need an external audio shield and/or amplifier to generate notes??

    I have built a MIDI over USB keyboard using the TeensyLC. I also want to add line level audio out for use without a computer. I think I can get by with 8-bit tone.
    My requirements are:
    1) Polyphonic. Hopefully up to 5 notes at the same time
    2) Able to respond to pitch bend
    3) Able to respond to volume change
    4) MONO line-level output
    5) low latency, so I do not have a detectable pause between pressing a button and getting the tone
    Optionally I would like to have
    1) Accurate representation of sub-bass notes (I think this has to do with capacitor size on the amp?)
    2) The ability to have some different tone options that I could preconfigure.

    I do not want Midi jacks or speaker level output.

    Can you wonderful folks help me figure out:
    1) which Teensy board I would be best off with? I do not think the TeensyLC has any DAC functionality
    2) what sort of amplifier/shield to get
    3) pointers to existing sample code of those that have been here before.

    please and thanks!!

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,821
    Quote Originally Posted by colorado_hick View Post
    Can you wonderful folks help me figure out:
    1) which Teensy board I would be best off with? I do not think the TeensyLC has any DAC functionality
    The Teensy LC has a single DAC (pin A12) in the same location on the back that the Teensy 3.2 has (pin A14). However, parts of the audio library will not work on the LC since some of the functions uses machine instructions that are not present in the LC. So you likely want a Teensy 3.2 if mono is ok, or a Teensy 3.5/3.6 if you need stereo with a pair of DACs.

    I will let others answer the question about line level vs. speaker level output.

    FWIW, I have used either the Adafruit amplifiers or the Teensy prop shield for simple amplification and the cheap Adafruit speakers, but I don't know if it would meet your needs:

    Amps:

    Speakers:


    I seem to recall there is a limit for polyphonic voices in the Teensy 3.2. While looking it up, I found these projects:


    It looks like you could get 8-9 44Khz mono samples from SPI flash with a Teensy 3.1 a few years ago:
    Last edited by MichaelMeissner; 12-04-2018 at 02:20 PM.

  3. #3
    Anyone out there want to jump on the amplifier question? WHat is my best option for getting the mono output from a Teensy3.2 up to line level?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,655
    Quote Originally Posted by colorado_hick View Post
    WHat is my best option for getting the mono output from a Teensy3.2 up to line level?
    Using the audio library, the DAC output defaults to 1.2V peak-to-peak range.

    That's pretty close to the -10 dBV "line level" used by consumer equipment (0.775V AC RMS). However, the DAC has an output impedance of approx 1K. So if you have gear expecting "level level" of -10 dBV and the input impedance is high, like 47K or 100K (pretty common for better quality consumer equipment) then you might be able to just use the DAC with a series capacitor to block the DC voltage, or even directly if your equipment blocks DC (also pretty common - though almost never explicitly specified).

    If you need a lower output impedance, then an opamp as a unity gain buffer or should do the trick, or maybe set it for a gain of 1.8, so you get exactly -10 dBV level.

    But if your "level level" is something much higher, like +4 dBu common with professional studio equipment, then you're probably going to need an opamp to significantly increase the voltage. If your gear has balanced input, then you'd need 2 opamps so you get the signal plus an inverted copy.

    It all depends on exactly what you mean by "line level". There are lots of great pages on the internet about these audio specs. Here's one.

    https://huisr0t.wordpress.com/2014/0...oltage-levels/

    The main thing you need to know about the Teensy side is the default using the audio library is 1.2 volts peak-to-peak, with 0.6 volt DC offset, and output impedance of ~1K ohm.

Posting Permissions

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