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

Thread: Audio to Light

  1. #1

    Audio to Light

    I'm a newbie, but what I need to do should be pretty simple. I'd like use a piezoelectric trigger like this:
    https://www.sweetwater.com/store/det...ith-clip-mount

    or a drum pad similar to this:
    https://www.sweetwater.com/store/det...85-v-pad-black

    to trigger an LED strip. The lights will be a certain color and brightness depending on how hard you hit the drum. Which Teensy would be the best for this? I'm sure I can figure out the code, but if anyone wants to give me a head start on the audio part (I'm okay with the lighting code), I wouldn't turn it down. I'm on a tight time schedule.

    I scoured the net for a prebuilt circuit and can't find exactly what I'm looking for (that's not $300), so I figured I could just build it.

    TIA

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,379
    Look at the Audio -> Analysis -> WaterFallSpectrum example.

    If you go to minute 17:36 of the video (through about 19:12), you will see it in use:


    Here is the tutorial of the audio shield:

  3. #3
    I'm a little confused. Looks like it's outputting to an LCD screen. I need to output to an LED strip like this one:

    https://www.adafruit.com/product/4245

    Audio trigger input > ??? > Teensy 3.2 > LED Strip

    I'll code it to change color and brightness based on the intensity of the input. Let me know if I missed something.

  4. #4
    I think I found it:
    https://www.pjrc.com/store/teensy3_audio.html

    So, that board will allow the audio input to the 3.2 if I understand that right.

  5. #5
    Hmmm... this may be way over my head. It seems like I just need an analog audio input -- or microphone input -- to the RMS amplitude (?) and then convert that level to various light variables... but I'm not understanding the relationship between the audio adapter and the Teensy. The tutorial goes into things that I don't need to know and my brain is already on overload. If someone could simplify this for my application for me I'd be grateful.

  6. #6
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,379
    Quote Originally Posted by Synchrony View Post
    I'm a little confused. Looks like it's outputting to an LCD screen. I need to output to an LED strip like this one:

    https://www.adafruit.com/product/4245

    Audio trigger input > ??? > Teensy 3.2 > LED Strip

    I'll code it to change color and brightness based on the intensity of the input. Let me know if I missed something.
    Yes it goes to the display, but it shows how to get the input. You would have to change the display part completely to do LEDs instead of a screen.

    Quote Originally Posted by Synchrony View Post
    I think I found it:
    https://www.pjrc.com/store/teensy3_audio.html

    So, that board will allow the audio input to the 3.2 if I understand that right.
    Well yes and no. It is mostly for processing and playing sounds. So for what you want it is overkill.

    Note the board does not have a microphone, but you can buy one:


    Now that I think about it, you may want something like this:

  7. #7
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,379
    And this might be an even cheaper build. It is basically a microphone and a cheap 8x8 i2c display with 2 colors. Note this was written for an Arduino, but it should carry over to the Teensy. The one thing you may need to do is add two pull-up resistors (typically 2.2k). One resistor would go in parallel to between pin 18/A4 and 3.3v. The other would go between 18/A5 and 3.3v

  8. #8
    Junior Member
    Join Date
    Dec 2019
    Posts
    1
    Quote Originally Posted by Synchrony View Post
    I'm a newbie, but what I need to do should be pretty simple. I'd like use a piezoelectric trigger like this:
    https://www.sweetwater.com/store/det...ith-clip-mount

    or a drum pad similar to this:
    https://www.sweetwater.com/store/det...85-v-pad-black

    to trigger an LED strip. The lights will be a certain color and brightness depending on how hard you hit the drum. Which Teensy would be the best for this? I'm sure I can figure out the code, but if anyone wants to give me a head start on the audio part (I'm okay with the lighting code), I wouldn't turn it down. I'm on a tight time schedule.

    I scoured the net for a prebuilt circuit and can't find exactly what I'm looking for (that's not $300), so I figured I could just build it.

    TIA
    drum pads work by using a piezo trigger which is essentially a piezo element with a 1 M resistor running across it. if you use a pre-made pad or roll your own, you will need to hook one branch of the circuit to any arduino ground and the other to an analog input pin. When the drum is hit, the piezo is excited and will convert that into current. that current across the resistor will result in a voltage the arduino can read. your code should keep reading the analog pin and when those values are high, light up your strip. Any arduino that can support your strip will work. it will really depend on the strip you use. Adafruit makes neopixles and they provide a good guide for how to drive them. They like 5 volt signals so a simple uno will work. nothing fancy needed.

Posting Permissions

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