Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 39 of 39

Thread: Teensy 3.1 + Audio Board polyphony - how many is too many?

  1. #26
    Quote Originally Posted by Pensive View Post
    I'm using this one:
    https://www.sparkfun.com/products/9196

    Apparently i need to bring the voltage down from a peak of 30 instead; Still AC, though I believe? It doesn't say but the nature of the vibration leads me to believe so.


    I'm not so sure this piezo is similiar enough to yours for your circuit to work out of the box.
    I've not seen a piezo looking like that, but I assume the theory is the same. Yes, with my piezos there is potentially high voltage AC (with incredibly low current) being output from a piezo. In my design I use a voltage divider to reduce the input voltage. Originally I was using a 10k / 1k to reduce it by a factor of around 1/10, but found that this was too much. Now I am using 1k/1k for about 1/2, and that works much better.

    When figuring out how much to drop the signal, you also need to know about your pad design. I find that pad design is just as important as circuit design if you want consistent signals. After a lot of trial and error I arrived at the pad design documented at https://hackaday.io/project/6881-drum-master/log/29084. By doing things like this, you won't get the full 30V-ish max output on the piezos.

  2. #27
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    mine is being attached to a midi device full of arcade buttons.

    When I detect a button being pressed, I need the peak from the last XXms. I will apply this as a velocity to the midi note.


    This sounds complex, but achievable. Not something I want to do twice though.
    Since I will ultimately need a PCB mounted solution, I will wait until i'm developing the PCB to selct a suitable SMD shock sensor / accelerometer.

    I'm prototyping at the moment, so I dont want to go down to the Nth degree on a component I almost certainly won't use on the final PCB.

    Thanks for your help!

    Addendum: It looks like an accelerometer could be used as a vibration sensor, and they tend to be able to talk i2c. This might well be a preferable solution for the less electronically minded of us - IE me.
    Last edited by Pensive; 01-11-2016 at 08:45 PM. Reason: addendum

  3. #28
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Or my last option - i wont clog your thread anymore!

    https://www.adafruit.com/index.php?q...page=adasearch

    The top 3 items are 3 sensitivities of shock sensor. I could just query the three digital pins when a button is pressed to get velocity of 33%, 66% and 100% and map those to suitbale midi velocities - it would give the feel of velocity detection. Far from ideal though.

    This one is the easy way out, but it would work after a fashion. No way of calibrating though!!

    It wouldn't be hard to build an arcade button with velostat mounted inside affording velocity and aftertouch.......hmmmm.....

  4. #29
    Quote Originally Posted by Pensive View Post
    Or my last option - i wont clog your thread anymore!
    Not clogging at all, but if you would rather start a new thread let me know what the link is and I can start replying there. Or feel free to just email me directly.

    Quote Originally Posted by Pensive View Post
    https://www.adafruit.com/index.php?q...page=adasearch

    The top 3 items are 3 sensitivities of shock sensor. I could just query the three digital pins when a button is pressed to get velocity of 33%, 66% and 100% and map those to suitbale midi velocities - it would give the feel of velocity detection. Far from ideal though.

    This one is the easy way out, but it would work after a fashion. No way of calibrating though!!

    It wouldn't be hard to build an arcade button with velostat mounted inside affording velocity and aftertouch.......hmmmm.....
    Do your arcade buttons return some sort of pressure value? Or would you be mounting a piezo on / underneath / touching each button to use for the velocity value? The electronics part seems easy, but I can't wrap my head around your physical build.

    As far as prototyping is concerned, it would be very easy to prototype the peak detection (I know cuz that's what I did!) ;-) A normal 4x op amp chip with two caps and two diodes will give you two channels with peak detection and buffering. Add a couple more potentiometers if you want amplification / calibration, but that is not required. If you want to get all 16 buttons prototyped, you could probably fit it all on 2 breadboard panels, or just leave the prototype at 2 channels. (That's what I did... if it works for one it will work for a million, right? ;-) )

    Cheers

  5. #30
    Junior Member
    Join Date
    Oct 2018
    Location
    France
    Posts
    8

    Smile

    Do you have any rough idea how long until the audio library will work with Serial Flash?
    Quote Originally Posted by PaulStoffregen View Post
    No, there's no reliable time estimate. But it ought to be within the next couple months....
    Hi Paul,
    I'm interested in playing music and sound simultaneously:
    I was quite stuck with Arduino... as far as I understand the system described here, I could use Teensy + SPI flash chip + Audio board? or it still requires some evolution of the library quoted above?
    Thanks

  6. #31
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Quote Originally Posted by Mat13 View Post
    Hi Paul,
    I'm interested in playing music and sound simultaneously:
    I was quite stuck with Arduino... as far as I understand the system described here, I could use Teensy + SPI flash chip + Audio board? or it still requires some evolution of the library quoted above?
    Thanks
    That’s all long since working fine.

    With a teensy 3.6 you’d be able to use an sdcard at the same time as “music” if by music you mean synth sounds.

    If by music you mean mp3 decoding....you’ll only be able to do that on a teensy 3.6.

    3.2 is only just man enough to play mp3s back although Frank might have optimised it further - not sure.

    Can you define “music” and “sound” by file format and bitrate/bitdepth please?

  7. #32
    Junior Member
    Join Date
    Oct 2018
    Location
    France
    Posts
    8
    Sorry for the lack of details
    I meant reading several .wav files at the same time...

    Not sure about quality: 16 bit - 44 kHz would be nice but something equivalent to a mp3 quality of 196 kb/s is fine.

  8. #33
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    You're comparing apples to pears. The MP3-bitrate (by the way- AAC is way better) has nothing to do with samplerate or bit-depth (but it has to be encoded with 44.1kHz for Teensy 3.x)
    You can play a MP3 with 196kb/s with any Teensy 3.x - with 16Bit/44.1 kHz. MP3 decoding needs lot of RAM,so the decoder allows only one file a time.
    Playing RAW from Serial Flash works best. Don't remember exactly, too long ago that I tried it, but I think more than 10 files simultanously were possible - on a Teensy 3.2

  9. #34
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,576
    When playing WAV files from the SD card, the Arduino SD library is only capable of reading about 3 files simultaneously.

    Someday we'll have a better library, but for now the SD library is limited to a 1-sector-at-a-time approach which is far from optimal for modern SD cards.

  10. #35
    Junior Member
    Join Date
    Oct 2018
    Location
    France
    Posts
    8
    Many thanks for your fast answers

    I'll try to rephrase my question (sorry english is not my native language):
    ► my need: playing multiple audio wav files (up to 4 simultaneously) in 16 bit - 44 kHz quality

    I've read here https://hackaday.io/project/6881-dru...memory-working from @thebigone
    that reading from SD card is not a viable option but that flash chip is the way

    ► my question: what hardware setup would do? and with which library please?
    - Teensy LC
    + Audio board
    + SPI flash chip (like W25Q128FVSIG 128Mbit 16M x 8bit 7ns Serial-SPI 3V/3.3V) flash chip is 3,3V like Teensy LC

    thanks for your expertise,
    Mat

  11. #36
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    I’d recommend a teensy 3.2 absolute minimum but for the price - a teensy 3.6 is so much more powerful. I like sledgehammer engineering. Hit it with much more than you need!

  12. #37
    Junior Member
    Join Date
    Oct 2018
    Location
    France
    Posts
    8
    I've found 2 posts about this memory chip used in conjunction with Teensy, so I guess I could have a try
    https://forum.pjrc.com/threads/33189...-Audio-adapter
    https://forum.pjrc.com/threads/52486...ment-Work-Fine
    I've just ordered some chips at aliexpress

    sledgehammer engineering ?!
    "when you only have a hammer, every screws look like nails!"

    Does Teensy LC have enough horsepower?

  13. #38
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,534
    The Teensy LC has a Cortex M0+ core which does not support all the DSP instructions used by the audio library and the audio board. Thus, you absolutely should have a Cortex M4 processor as in the Teensy 3.2, 3.5 and 3.6 boards which offer full audio library and audio board support.

  14. #39
    Junior Member
    Join Date
    Oct 2018
    Location
    France
    Posts
    8
    Thanks @Theremingenieur for your clear explanation!

    merci
    Mat

Posting Permissions

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