I really like the division of tasks between the generated code and the written code; the generated takes care of the not-so-fun task of creating all the necessary objects and linking them together (which would normally require searching through a bunch of docs), and then you have quick and easy access to what you need within those objects.
This video is inspiring. I just ordered my first Teensy after watching this. My daughter and I do Arduino projects normally but this looks like a lot of fun.
If you want to go deeper into what makes Fourier transforms tick, 3Blue1Brown has an excellent video explaining it with easy to understand animated visuals.
This is the tutorial that got me HOOKED on Teensy and the entire community. Thank you for all you do! Also, does anyone else have these songs stuck in your head? Asking for a friend...
Guys...Paul, Alysia, I just came across Teensy 10 days ago, and immediately bought a 3.2 unit plus the Audio Board, and built a signal processing unit for a DIY boombox around these. But first.. done this tutorial... Words cannot describe how enthusiastic/maniac I became after going through the material :)! Ideas just started to bomb my mind. This SGTL5000 is just more than I wanted.. I cannot stop experimenting with all the library elements. So hats off and a huge thanks for..: 1.) Teensy with all the A+++ docs/libs (a powerful, yet really easy 32 bit device) 2.) audio design tool/ audio libraries (they just simply cover everything :)) 3.) Last but not least, this very well constructed tutorial (to get up to speed in a few hours) .. PS: I will spread the word..
What a wonderful tutorial! Thank you so much. I really appreciate that you took the time to mix in the Teensy's audio, and include relevant visuals (like the explanation of windowing in the FFT). Great work!!
Dear Paul and Robin... I want to thank you for creating Teensy. I have personally still not purchased or used Teensy. But I have plans to create a midi drum trigger project, and was researching how to do this with Arduino, and there are plenty of projects that have gone along these lines on Arduino. But for midi applications, there is extra work to do, either you have to work out getting midi out of Arduino and then using a separate midi to usb interface to get this midi into the PC, or you ahve the extra work of trying to get serial to midi working on an Arduino so that you can pull the midi off through usb... THE TEENS DOES ALL OF THIS! NATIVELY! I will certainly be looking at Teensy as the beginning of my midi project. And it is affordable as well. So thank you thank you thank you.
Truth is the Node Red folks did all the heavy lifting on the graphical interface. Thankfully they published as open source. I reused their code to make the design tool.
Yes. The current beta is adding better frequency modulation and phase modulation for 9 waveform types and better reverb (freeverb) and a few other new features. It's on the forum and download page now, and will soon release as version 1.42.
You peeps are full of awesome :) I'm makin an n99 mask to pass thru n augment voice to sound like robot... spectral leakage is my new favorite phrase. 'why doesn't this cat6e cable work' 'Spectral leakage' Sounds way better than sun spots or auroraboreallis
Hey Paul, first off: amazing work on the Teensy! I'm having difficulties using the DAC as an output on my teensy, is there a simple tutorial on how to do this available somewhere? Thanks!
Sorry, haven't (yet) made any more tutorials. Probably should.... There's some info about how to use the DAC in comments in File > Examples > Audio > WavFilePlayer If that doesn't solve it for you, best to ask on the forum. When you ask on the forum, put a little work into really showing what you've done so far. Post the code and even a photo of how you've wired things. Questions that really show what you've done are far more effective than "it doesn't work" without any info.
I have tried successfully using the builtin DAC on teensy 3.6, just connect small electrolytic cap (aroungd1uF-10uF) to the DAC output pin (the positive electrode) and then connect the negative electrode to a 1k resistor, then connect the audio jack: dac_pin->cap->resistor->audio_jack. I got 12 bit stereo audio output with just with just additional 2 resistor, 2 caps, and a stereo audio jack.
Sorry, but can you directly change the pitch or tempo of a single track playing off an sd card? Also, would it be possible to have polyphonic audio support with a 3.6 + prop shield, or do I need the audio adapter? Thanks!
Since this video was recorded (9 years ago) many more capabilities have been added, including 4 channel input and output. When you use the design tool, look for those in the outputs section. As with all the audio features, documentation appears on the right side panel when you click that feature. Look in those docs for the input about how to connect the hardware to achieve 4 channels rather than only ordinary 2 channels.
Guys you are awesome. Thank you for the video. Paul. I've tried to do stereo mic with this amazing tool but it doesn't work out. Sketch with 1 ADC channel works fine but with 2 ADC channals hangs dead. Need your advice on that.
+pin pin So far, the ADC object only supports a single pin. A second ADC object using the other ADC inside the chip is planned, but unlikely to happen before July 2016. Of course the code is all open source, so in theory anyone could try adding this, but the DMA stuff is pretty complex. So far only 1 person (besides me) has contributed that kind of code to the library.
This is great. I got all the stuff, but now I need to make the time. It's been on my to do list for a while. Several time in the video you both say "gains greater than unity will clip", but that assumes that the software does limiting vs. allowing the arithmetic to overflow. Does it limit (I could check the code, but this is a lot faster).
Yes. Except for part 1-5 (because of the LED conflicting with SPI SCK) everything in this tutorial video works fine when Teensy 4.0 is used with the Rev D audio shield.
Hey guys, the teensy 4.1 seems great. I'm wondering if there is a datasheet or manual. I'm a maker and a musician and I've just heard of teensy, well seen what it can do. I've gotten back into making after a long absence and I'd really like to adopt your platform. I have a 4.1 ordered and an audio board.
Hi Paul - I am interested in the Teensy 3.1/2 for an embedded high power speak unit which uses a sensor to trigger a sound effect, which is just a very short length sample (< 1 second) which I will store on an SD card. The output of the Teensy DAC will go to a class D amplifier and then to a 15W RMS 2 inch speaker. I would like to know if it's reasonable for a program to read a short sample into RAM on start-up/init, and play on demand with as little latency as possible - is latency and issue if I were to try and stream on demand this sample, or is it indeed better (as I mentioned earlier) to load the sound file into RAM and just play it from that? Can the Teensy audio library support this sort of behaviour? Thanks for your time, and your amazing work on the Teensy family of devices and support for them. edit: I see the audio board for the teensy, it looks like that's what I need rather than using the DAC myself - this would then go into the Class D amplifier such as this one: www.dx.com/p/y148-audio-amplifier-module-93121?tc=CAD&gclid=CO76zbGLxswCFQQbaQodKocPgw#.Vy2DIFgrKUl From the looks of it, i should be able to manage reading from the SD card into RAM and then playing the audio stored in RAM using the SD + audio board. Neat!
+Craig Hollabaugh Much of my inspiration came from Puredata & Max/MSP. The idea to use Node-Red was first suggested on the forum by "syso2342". Here's the original post. forum.pjrc.com/threads/24793-Audio-Library?p=50653&viewfull=1#post50653
This was very informative! However, is it possible to work with sound - e.g. to do granulation of a sound sample and output the sound - without the audio shield? Thank you for the response!
Yes, lots of other input & output hardware support has been added over the last six years (since this video was made). But nearly all the examples are for the audio shield, so to use other ways you need to explore the other options in the design tool and dive into DIY hardware.
Great video and very informative. I would like to follow this tutorial for myself, but I can't seem to find the part where it is explained how to connect all the hardware on a breadboard.
I have connected all the hardware, and loaded up part_1_02_Hardware_Test. However when I run Serial Monitor I see this: Knob (pin A3) = 151 Knob (pin A1) = 194 Knob (pin A2) = 237 infinitely repeating and filling up the window, while in the video they only show when you press one of the buttons. What could I be doing wrong?
You've almost certainly not connected the pots correctly. We have a great forum for helping with these sorts of problems. You *MUST* post a photo (or multiple photos from different angles) of how you've actually wired everything on your breadboard. Nobody can guess where things went wrong without photos of the wires, so please make sure you put good photos in your message when you ask on the forum.
I just found out about the Teensy, I've been working with an Arduinio Uno project to control RC cars, and now I want to add sounds to now and it seems really limited. I'm looking to sell my final product on its own custom PCB board. I would love to move the whole project over to a Teensy but is that possible to use the Teensy and this audio shield using that audio library program onto my own custom PCB to sell? What kind of license is everything under? Also curious if that audio library works with the UNO, because on your main page I found it a little confusing "All audio is CD quality (16 bits, 44.1 kHz) and streams automatically as your Arduino Sketch Runs" Or does the Teensy use the same Arduino IDE? Thanks!
Wow amazing, this would be my next toys... Is it possible to protect our firmware in teensy 3.6 if I decided to make a commercial audio processor device using it?
Yes, locking the chip is possible if you edit mk20dx128.c, but comes with some caveats explained in the comments within that file. Here's a link to the info. github.com/PaulStoffregen/cores/blob/master/teensy3/mk20dx128.c#L36
Hi there, when I try to follow the video the examples are different on the 4.1 code examples, is there anywhere I can find the code specifically for the filters or the FFT
Thank you Alysia and Paul for an excellent tutorial. I have a question regarding playing sound files that are stored on an SD card or on the Teensy itself. Do you know the approximate delay from the time code executes a "play" command to the time the sound is actually output to a speaker? Can one assume retrieval from an SD card takes longer? Thanks.
+sonic8176 TL;DR = About 6 ms. If the card has many hundreds of thousands of files, and if the audio system is taking a *LOT* of CPU time for other work, timing for opening the file can vary. Some SD cards, like genuine Sandisk Ultra, are much faster than the non-name or Sandisk counterfeit cards, so that can make a difference. Slow SD cards cause the audio library to impose more CPU overhead. Latency can also vary 0 to 3ms, depending on when your Arduino sketch happens to issue the request, relative to the ~3ms (128 sample) audio update interval.
+PaulStoffregen Adafruit makes a nice breakout of the VS1053 chip (and library) that I use for making MIDI drum sounds based on timer interrupts. (A project to help baseball batters with swing timing.) I would like to convert my project from a Mega to Teensy 3.1(2) and I always wondered if it would be better (not necessarily faster but more predictable latency) to play actual sound files loaded in the chip's memory. I didn't know about the audio update interval...Thank you again.
Thank you for responding. I am new to this world of micro controllers but im eager to learn. I opened the example you suggested but not sure what to do next. Im not even sure if the board is being recognized. In the Teensy Arduino, it has all the examples I installed, but not sure if im connecting correctly. I am to assume to connect to ground and pin 0. Once that is done, how do I test to see Im getting a response?
PJRC forum is the place to ask for more help. When you post on the forum, very important to show what you've actually tried. Copy the complete code from Arduino to your forum message, and show a photo of how you connected the hardware.
Great work! Thank you. Is it possible to process a voice or musical instrument so that one stereo channel becomes a reference and the other channel is frequency shifted by XXX HZ, dynamically? Thus I could create a constant beat frequency of (for example) 7 HZ (the alpha brain wave frequency) from a variable frequency source. The result is that the beat frequency heard in stereo is constant no matter what the source frequency is. Normally, for example, if you put a constant tone of 200 HZ in one ear, and 207 HZ in the other ear, your brain will "hear" a 7 HZ beat frequency. But, I want to create beat frequencies dynamically, from the source content such as music/voice, instead of from a constant frequency (such as 200 HZ in my example). Why do this? Your brain wave frequency will follow/entrain to the (7 HZ) beat frequency and induce an alpha state which is known to be relaxing/hypnotic. Thus I could record my voice speaking a hypnotic induction, and the beat frequency of 7 HZ would be induced automatically. As far as I know, no one has yet tried this method of dynamically creating beat frequencies. I want to experiment to see if this a superior method. Now, I simply add a 7HZ tone in the background of my hypnosis recordings, and that works OK. I'd like to try a fourier-based approach that transforms my voice in the left channel into a version that is frequency shifted by 7 HZ in the right channel. Can it be done with your library? Interested in exploring the possibilities?
Here's a copy of the reply I wrote for you on another site. Reposting here for anyone who sees this and is interested. You could try this on Teensy 3.6 using notefreq for detecting the fundamental frequency in near real-time and the granular effect for pitch shifting. How well it would work is a good question. The really hard part is most sound that is interesting to hear has rapid changes in frequency, so whether the YIN algorithm (of notefreq) is fast enough to keep up with rapidly changing material is a good question indeed. The other lesser issue is pitch shifting by granular processing can sometimes give poor results. Then again, sometimes it works pretty well. Someday I'm planning to add a pitch shifting effect based on FFT & iFFT called phase vocoding. But it requires a tremendous amount of CPU power. A Teensy 3.6 might be able to do it, but probably not at the same time as also running the YIN algorithm (which is the very best for frequency detection). This sort of project will probably become much easier in a year or two when we have good support for much faster Cortex-M7 chips......
Hi Paul, Thank you for the video. We are trying to use teensy to make an automatic guitar tuner and we were wondering if we can use your method without an audio adaptor?
Yes, the library supports using the on-chip ADC and DAC. Using the design tool, you can just drag those input & output objects onto the canvas, rather than the I2S input & output which communicate with the audio shield. You can even use them together, for simultaneous input/output by the on-chip pins and the audio shield. Details for each object's features & usage can be found in the design tools right-side documentation panel. The PJRC forum is the place to ask detailed tech questions. When posting on the forum, it's generally expected to write a more detailed question with specific info about what you're trying to accomplish.
Hello, Mr. Stoffregen. Thank you for this video. We are also using the teensy 3.6 for our project and we are still working on our programming. We are into how to produce an audio output at speaker from a microphone through teensy. Can we personally contact you to have more information in using teensy and how will we use it to finish our project? We are currently an ECE students from the philippines. Thank you very much!!
Have you measured the input/output latency and is it possible to reduce buffer sizes? The delay seems pretty long (maybe 50ms?) when she talks into the microphone. Is it easy to implement custom filter algorithms (e.g. LMS)? Thanks :)
Quick answers: The passthrough example has been measured at approx 7 ms latency, from analog input to analog output. Most of that is 2 block lengths. Smaller blocks are possible by editing the library. Most of the code adapts to smaller blocks, but some parts break because they depend on the 128 sample block setting. Longer answers: To discuss this stuff in more detail or talking about special filter algorithms or other developments, let's chat using the forum. forum.pjrc.com/forums/8-Audio-Projects
7 лет назад
Thanks a lot for the fast answer! I guess I will pick one up and experiment a bit :)
I just purchased my teensy 4.1 along with the audio adaptor board for my thesis project. I am just wondering, will installing the adaptor on top of my teensy prevent me from using the (teensy) pins it's soldered into? I don't quite understand how that works.
Quick answer: yes for the pins the audio shield uses, no for the others. Longer answer: ask on the forum and give context about your project and other hardware you wish to use. The forum is great for long answers and detailed discussion. Social media replies... only good for quick answers.
Hi, Paul I'm thinking of getting a teensy for my organ pedalboard midi controller. I would like to play 2 notes simultaneously as in a chord. Is this possible, please
Hello is it possible to make a sensor just like the breath controller, with a sound sensor, volume sensor ?? let's say, playing with a real acoustic instrument saxophone, and with the saxophone microphone volume signal, generate the volume signal to control the sample?? is it possible??? as if it were a digital potentiometer controlled by the volume of an acoustic instrument ???
Hello dear friends. I am carrying out a project that requires hardware that is capable of speech recognition of 15 monosyllables (which will always be the same) at a speed of recognition of each monosyllable between 5 and 15 milliseconds. After recognition, it must send a 4-bit data to a port where it knows which of the monosyllables has been recognized. I wish I could buy that development. Thanks in advance.
Where do you get the header pins to connect the audio board to the teensy? Like a dummy I soldered headers to my teensy 3.6 but am waiting for the audio board in the mail and don't know how to fix my screw up. Desolder the pins and find the right double deck headers? Or ghetto rig and solder headers on top of the other headers? Any help?
Don't try to desolder the pins. That almost never ends well. Maybe some people with amazing skills and the best gear can pull it off, but usually desoldering ruins the pads & nearby traces. Best to get mating sockets and add them to the other board. There's no rule saying one board must be above or below the other. The electrons won't know the difference, as long as the pins line up correctly.
Is there an audio library PDF or similar as tyo what all the possible calls are etc? I want to download to a fire when go on a train and use it as a reference for all the different function. Cannot seem to find a link to one.
All the function calls are documented in the design tool. If you've installed Teensyduino, you already have a complete copy of the design tool on your computer. It works without the internet. To learn how to access it, turn to page 9 in the tutorial PDF.
any idea how to do fft in form of bar graph . and use teensy as spectrum analyser. will be very helpful in looking at harmonics in electrical system . thanx in advace
+Tejeshw Vardhan In Arduino (with Teensy selected, as the File menu change depending on the selected board), look at File > Examples > OctoWS2811 > SpectrumAnalyzer. It displays the 1024 point FFT on a big LED board as 60 bands/bars, each 32 LEDs tall. Of course, you could use pixels on a LCD. Look at File > Examples > Audio > Analysis > SpectrumAnalyzerBasic. Or check out this project: ruclips.net/video/IUbECxGWvFw/видео.html Hopefully you can get some inspiration from these, to adapt to whatever way you would display the FFT info.
Hello Paul, I am planning to do a project that involves the TLC5940 and This audio shield. The problem is that the pins overlap. Is there any way to rewire either the Audio shield or the TLC5940? Thanks in advance.
The audio part should work fine, but you won't be able to use the SD card or optional memory chip if using TLC5940. The old library for that chip doesn't use SPI transactions, so it won't share SPI nicely. However, if you use Teensy 3.5 or 3.6 you could use it's built-in SD socket which is native SDIO, not SPI-based SD, so no conflict with TLC5940. Short of massively editing that very old lib, I don't see any way to use both that chip and the SPI-based SD socket on the audio shield.
Hi Paul, I still can't get the Teensy to pause the music after several tries. I could do next and previous functions only. I have assigned button to 1 but am unsure of what code i need to add in...
Today, no. The USB host library does not yet have a driver for USB audio devices. I'll probably create this someday, but 1 to 2 years is the likely time frame. When/if it happens, that sort of device driver might depend on future Teensy boards which will have asynchronous sample rate conversion hardware.
Paul, underrated geek and mastermind, huge respect for him!
I really like the division of tasks between the generated code and the written code; the generated takes care of the not-so-fun task of creating all the necessary objects and linking them together (which would normally require searching through a bunch of docs), and then you have quick and easy access to what you need within those objects.
This video is inspiring. I just ordered my first Teensy after watching this. My daughter and I do Arduino projects normally but this looks like a lot of fun.
I wish all tutorials were made with this much care. Thank you.
I learned a lot about the mechanisms behind FFTs. Thanks for that! Well-produced video.
If you want to go deeper into what makes Fourier transforms tick, 3Blue1Brown has an excellent video explaining it with easy to understand animated visuals.
This video has motivated me to continue diving deeper into sound art by opening many paths of inquiry I had not considered. ありがとございます! ⛩
Paul. Thanks for all your work for the community. It is appreciated.
This is the tutorial that got me HOOKED on Teensy and the entire community. Thank you for all you do! Also, does anyone else have these songs stuck in your head? Asking for a friend...
Guys...Paul, Alysia, I just came across Teensy 10 days ago, and immediately bought a 3.2 unit plus the Audio Board, and built a signal processing unit for a DIY boombox around these.
But first.. done this tutorial... Words cannot describe how enthusiastic/maniac I became after going through the material :)! Ideas just started to bomb my mind. This SGTL5000 is just more than I wanted.. I cannot stop experimenting with all the library elements.
So hats off and a huge thanks for..: 1.) Teensy with all the A+++ docs/libs (a powerful, yet really easy 32 bit device) 2.) audio design tool/ audio libraries (they just simply cover everything :)) 3.) Last but not least, this very well constructed tutorial (to get up to speed in a few hours) .. PS: I will spread the word..
I agree. Please what boombox and signal processing do you refer to
Thanks for making stuff like this.....
Thank you for making this!
This was both very informative and inspiring to watch.
Awesome tutorial. Just finished going through the whole tutorial on my Teensy4, thanks Paul and Alysia for the resources!
PLEASE! Make more videos like this. I wanna learn more about self-build audio interfaces and FFT.
Teensy 4.x and the Audio library is an amazing piece of work.
BEST ARDUINO - TEENSY TUTORIAL PRESENTATION EVER!
It is so cool that you guys have made a really great tutorial on this! Well done! Hope to see more of these.
I got my 2 teensy 4.1 boards today and realized I didn't buy the audio board. I did buy the flash though. Great product guys!!!
What a wonderful tutorial! Thank you so much. I really appreciate that you took the time to mix in the Teensy's audio, and include relevant visuals (like the explanation of windowing in the FFT). Great work!!
Dear Paul and Robin... I want to thank you for creating Teensy. I have personally still not purchased or used Teensy. But I have plans to create a midi drum trigger project, and was researching how to do this with Arduino, and there are plenty of projects that have gone along these lines on Arduino.
But for midi applications, there is extra work to do, either you have to work out getting midi out of Arduino and then using a separate midi to usb interface to get this midi into the PC, or you ahve the extra work of trying to get serial to midi working on an Arduino so that you can pull the midi off through usb...
THE TEENS DOES ALL OF THIS! NATIVELY! I will certainly be looking at Teensy as the beginning of my midi project. And it is affordable as well. So thank you thank you thank you.
thank you for this video & your huge contributions to the artful side of technology.
Hey Paul,
I love your work! You contributed so much to the community.
Thank you!
Amazing. Just bought a Teensy LC. Looks like I'll be buying a few other Teensy's as well. Thanks.
This is awesome! Thank you for making the Teensy and these videos!
Thank you so very much for this. I have ordered two teensy boards + audio shields for my project because of this.
Very polished tutorial. Thanks Both!
Really great work Paul! I love the audio design tool. Looks like a lot of work to get it looking that slick.
Truth is the Node Red folks did all the heavy lifting on the graphical interface. Thankfully they published as open source. I reused their code to make the design tool.
And nice job on the Teensy sticks. Can't wait to get some audio projects going. Do you have anything new planned? Great stuff!
I
Yes. The current beta is adding better frequency modulation and phase modulation for 9 waveform types and better reverb (freeverb) and a few other new features. It's on the forum and download page now, and will soon release as version 1.42.
Thanks Paul! I'll check out the forum and v 1.42
thats mor understanding synthesizer then a programming workshop!
Great Job! :)
This is amazing! The Crossfade blew my mind.
☮️❤️🌈
This is great for anyone getting into audio projects! Really comprehensive, thanks!
You peeps are full of awesome :) I'm makin an n99 mask to pass thru n augment voice to sound like robot...
spectral leakage is my new favorite phrase.
'why doesn't this cat6e cable work'
'Spectral leakage'
Sounds way better than sun spots or auroraboreallis
Fantastic tutorial! Thank you.
Thank you for an inspiring, well-paced tutorial!
That FFT is IMPRESSIVE !
Fantastic project and tutorial! Thank you!
this is such a brilliant system. thank you so much for making it!!
This was such an interesting and inspirational video. Thank you very much for making and sharing it.
I'm more than a teesny bit grateful for this tutorial video!
Thank you so much for the informations. You are in the exact right range form newbie to nerdy. ;-)
I guess it's more interesting to build a VST synth with some help of your tutorial... I'll definitely check it out again when I'll come to FFT theory!
Dang this is cool I just ordered two audio boards can't wait to start messing around with it
well, you are just awesome. I really really like teensy. Actually I'm doing some industrial automation projects with teensy.
This teensy thing just keeps on giving. To bad i am broke
I love how she says it's flying...
Awesome work! Thank you very much for your contribution ! :-)
Hey Paul, first off: amazing work on the Teensy!
I'm having difficulties using the DAC as an output on my teensy, is there a simple tutorial on how to do this available somewhere? Thanks!
Sorry, haven't (yet) made any more tutorials. Probably should....
There's some info about how to use the DAC in comments in File > Examples > Audio > WavFilePlayer
If that doesn't solve it for you, best to ask on the forum. When you ask on the forum, put a little work into really showing what you've done so far. Post the code and even a photo of how you've wired things. Questions that really show what you've done are far more effective than "it doesn't work" without any info.
I have tried successfully using the builtin DAC on teensy 3.6, just connect small electrolytic cap (aroungd1uF-10uF) to the DAC output pin (the positive electrode) and then connect the negative electrode to a 1k resistor, then connect the audio jack: dac_pin->cap->resistor->audio_jack. I got 12 bit stereo audio output with just with just additional 2 resistor, 2 caps, and a stereo audio jack.
so glad you made this video - thanks!!!
Loved this! Thank you so much!
If you want to do this project with Teensy 4.0/Audio Rev. D then consider using the hardware SPI connections with CS and DC on PINs 3 & 4.
Are you the same PaulS that is on the Arduino forum ?? If so I want to thank you for all your helpful answers
This Tutorial is really cool!
Sorry, but can you directly change the pitch or tempo of a single track playing off an sd card? Also, would it be possible to have polyphonic audio support with a 3.6 + prop shield, or do I need the audio adapter? Thanks!
This is actually my problem now. To play 2 stereo synced tracks simultaneously! But I want to put 2 stereo aux outs.
Since this video was recorded (9 years ago) many more capabilities have been added, including 4 channel input and output. When you use the design tool, look for those in the outputs section. As with all the audio features, documentation appears on the right side panel when you click that feature. Look in those docs for the input about how to connect the hardware to achieve 4 channels rather than only ordinary 2 channels.
Those green eyes-wow
This is amazing! Thank you!
Guys you are awesome. Thank you for the video.
Paul. I've tried to do stereo mic with this amazing tool but it doesn't work out.
Sketch with 1 ADC channel works fine but with 2 ADC channals hangs dead. Need your advice on that.
+pin pin So far, the ADC object only supports a single pin. A second ADC object using the other ADC inside the chip is planned, but unlikely to happen before July 2016. Of course the code is all open source, so in theory anyone could try adding this, but the DMA stuff is pretty complex. So far only 1 person (besides me) has contributed that kind of code to the library.
Very cool audio design tool. Well done. 1 person thumbing has no appreciation for what you have done.
This is great. I got all the stuff, but now I need to make the time. It's been on my to do list for a while.
Several time in the video you both say "gains greater than unity will clip", but that assumes that the software does limiting vs. allowing the arithmetic to overflow. Does it limit (I could check the code, but this is a lot faster).
Yup, time is always the limiting factor!
And yes, the mixers and other objects with gain do properly limit/clip/saturate.
Thanks for the info ..can you plz kindly why there is delay between consecutive analogwrit
es
Really cool stuff here😎
Hi, Great video.
Is it possible with Teensy 4.0?
Yes. Except for part 1-5 (because of the LED conflicting with SPI SCK) everything in this tutorial video works fine when Teensy 4.0 is used with the Rev D audio shield.
and the final part with the display may need 2 of the display's control signals moved to different pins which Teensy 4 uses for I2S digital audio
Hey guys, the teensy 4.1 seems great. I'm wondering if there is a datasheet or manual. I'm a maker and a musician and I've just heard of teensy, well seen what it can do. I've gotten back into making after a long absence and I'd really like to adopt your platform. I have a 4.1 ordered and an audio board.
This is so awsome! Thx
Hi Paul - I am interested in the Teensy 3.1/2 for an embedded high power speak unit which uses a sensor to trigger a sound effect, which is just a very short length sample (< 1 second) which I will store on an SD card. The output of the Teensy DAC will go to a class D amplifier and then to a 15W RMS 2 inch speaker.
I would like to know if it's reasonable for a program to read a short sample into RAM on start-up/init, and play on demand with as little latency as possible - is latency and issue if I were to try and stream on demand this sample, or is it indeed better (as I mentioned earlier) to load the sound file into RAM and just play it from that? Can the Teensy audio library support this sort of behaviour? Thanks for your time, and your amazing work on the Teensy family of devices and support for them.
edit: I see the audio board for the teensy, it looks like that's what I need rather than using the DAC myself - this would then go into the Class D amplifier such as this one: www.dx.com/p/y148-audio-amplifier-module-93121?tc=CAD&gclid=CO76zbGLxswCFQQbaQodKocPgw#.Vy2DIFgrKUl
From the looks of it, i should be able to manage reading from the SD card into RAM and then playing the audio stored in RAM using the SD + audio board. Neat!
Amazing stuff!
Paul,
Awesome use of node red for c code generation. Did you see this being done somewhere or is this your idea?
Thanks,
Craig
+Craig Hollabaugh Much of my inspiration came from Puredata & Max/MSP. The idea to use Node-Red was first suggested on the forum by "syso2342". Here's the original post. forum.pjrc.com/threads/24793-Audio-Library?p=50653&viewfull=1#post50653
This was very informative! However, is it possible to work with sound - e.g. to do granulation of a sound sample and output the sound - without the audio shield? Thank you for the response!
Yes, lots of other input & output hardware support has been added over the last six years (since this video was made). But nearly all the examples are for the audio shield, so to use other ways you need to explore the other options in the design tool and dive into DIY hardware.
@@PaulStoffregen Thank you for a fast response Paul, I will do some research! Cheers!
Great video and very informative. I would like to follow this tutorial for myself, but I can't seem to find the part where it is explained how to connect all the hardware on a breadboard.
Look at the "Breadboard Assembly Instruction" PDF here:
www.pjrc.com/store/audio_tutorial_diy_parts.html
Thanks!
I have connected all the hardware, and loaded up part_1_02_Hardware_Test. However when I run Serial Monitor I see this: Knob (pin A3) = 151
Knob (pin A1) = 194
Knob (pin A2) = 237
infinitely repeating and filling up the window, while in the video they only show when you press one of the buttons. What could I be doing wrong?
You've almost certainly not connected the pots correctly.
We have a great forum for helping with these sorts of problems. You *MUST* post a photo (or multiple photos from different angles) of how you've actually wired everything on your breadboard. Nobody can guess where things went wrong without photos of the wires, so please make sure you put good photos in your message when you ask on the forum.
Will do, thanks!
I just found out about the Teensy, I've been working with an Arduinio Uno project to control RC cars, and now I want to add sounds to now and it seems really limited. I'm looking to sell my final product on its own custom PCB board. I would love to move the whole project over to a Teensy but is that possible to use the Teensy and this audio shield using that audio library program onto my own custom PCB to sell? What kind of license is everything under?
Also curious if that audio library works with the UNO, because on your main page I found it a little confusing "All audio is CD quality (16 bits, 44.1 kHz) and streams automatically as your Arduino Sketch Runs" Or does the Teensy use the same Arduino IDE?
Thanks!
Wow amazing, this would be my next toys... Is it possible to protect our firmware in teensy 3.6 if I decided to make a commercial audio processor device using it?
Yes, locking the chip is possible if you edit mk20dx128.c, but comes with some caveats explained in the comments within that file. Here's a link to the info. github.com/PaulStoffregen/cores/blob/master/teensy3/mk20dx128.c#L36
This is brilliant
Hi there, when I try to follow the video the examples are different on the 4.1 code examples, is there anywhere I can find the code specifically for the filters or the FFT
Thank you Alysia and Paul for an excellent tutorial.
I have a question regarding playing sound files that are stored on an SD card or on the Teensy itself. Do you know the approximate delay from the time code executes a "play" command to the time the sound is actually output to a speaker? Can one assume retrieval from an SD card takes longer?
Thanks.
+sonic8176 TL;DR = About 6 ms. If the card has many hundreds of thousands of files, and if the audio system is taking a *LOT* of CPU time for other work, timing for opening the file can vary. Some SD cards, like genuine Sandisk Ultra, are much faster than the non-name or Sandisk counterfeit cards, so that can make a difference. Slow SD cards cause the audio library to impose more CPU overhead. Latency can also vary 0 to 3ms, depending on when your Arduino sketch happens to issue the request, relative to the ~3ms (128 sample) audio update interval.
+PaulStoffregen Adafruit makes a nice breakout of the VS1053 chip (and library) that I use for making MIDI drum sounds based on timer interrupts. (A project to help baseball batters with swing timing.) I would like to convert my project from a Mega to Teensy 3.1(2) and I always wondered if it would be better (not necessarily faster but more predictable latency) to play actual sound files loaded in the chip's memory. I didn't know about the audio update interval...Thank you again.
Thank you for responding. I am new to this world of micro controllers but im eager to learn. I opened the example you suggested but not sure what to do next. Im not even sure if the board is being recognized. In the Teensy Arduino, it has all the examples I installed, but not sure if im connecting correctly. I am to assume to connect to ground and pin 0. Once that is done, how do I test to see Im getting a response?
PJRC forum is the place to ask for more help. When you post on the forum, very important to show what you've actually tried. Copy the complete code from Arduino to your forum message, and show a photo of how you connected the hardware.
Great work! Thank you.
Is it possible to process a voice or musical instrument so that one stereo channel becomes a reference and the other channel is frequency shifted by XXX HZ, dynamically? Thus I could create a constant beat frequency of (for example) 7 HZ (the alpha brain wave frequency) from a variable frequency source. The result is that the beat frequency heard in stereo is constant no matter what the source frequency is.
Normally, for example, if you put a constant tone of 200 HZ in one ear, and 207 HZ in the other ear, your brain will "hear" a 7 HZ beat frequency. But, I want to create beat frequencies dynamically, from the source content such as music/voice, instead of from a constant frequency (such as 200 HZ in my example). Why do this? Your brain wave frequency will follow/entrain to the (7 HZ) beat frequency and induce an alpha state which is known to be relaxing/hypnotic. Thus I could record my voice speaking a hypnotic induction, and the beat frequency of 7 HZ would be induced automatically. As far as I know, no one has yet tried this method of dynamically creating beat frequencies. I want to experiment to see if this a superior method.
Now, I simply add a 7HZ tone in the background of my hypnosis recordings, and that works OK. I'd like to try a fourier-based approach that transforms my voice in the left channel into a version that is frequency shifted by 7 HZ in the right channel.
Can it be done with your library? Interested in exploring the possibilities?
Here's a copy of the reply I wrote for you on another site. Reposting here for anyone who sees this and is interested.
You could try this on Teensy 3.6 using notefreq for detecting the fundamental frequency in near real-time and the granular effect for pitch shifting.
How well it would work is a good question. The really hard part is most sound that is interesting to hear has rapid changes in frequency, so whether the YIN algorithm (of notefreq) is fast enough to keep up with rapidly changing material is a good question indeed.
The other lesser issue is pitch shifting by granular processing can sometimes give poor results. Then again, sometimes it works pretty well.
Someday I'm planning to add a pitch shifting effect based on FFT & iFFT called phase vocoding. But it requires a tremendous amount of CPU power. A Teensy 3.6 might be able to do it, but probably not at the same time as also running the YIN algorithm (which is the very best for frequency detection).
This sort of project will probably become much easier in a year or two when we have good support for much faster Cortex-M7 chips......
How to connect the audio board to the teensy 4.1, i don't find any information about this.. Please help me out
Does this work on newer boards?
Hi Paul, Thank you for the video. We are trying to use teensy to make an automatic guitar tuner and we were wondering if we can use your method without an audio adaptor?
Yes, the library supports using the on-chip ADC and DAC. Using the design tool, you can just drag those input & output objects onto the canvas, rather than the I2S input & output which communicate with the audio shield. You can even use them together, for simultaneous input/output by the on-chip pins and the audio shield. Details for each object's features & usage can be found in the design tools right-side documentation panel. The PJRC forum is the place to ask detailed tech questions. When posting on the forum, it's generally expected to write a more detailed question with specific info about what you're trying to accomplish.
Hello, Mr. Stoffregen. Thank you for this video. We are also using the teensy 3.6 for our project and we are still working on our programming. We are into how to produce an audio output at speaker from a microphone through teensy. Can we personally contact you to have more information in using teensy and how will we use it to finish our project? We are currently an ECE students from the philippines. Thank you very much!!
We have a forum for questions, support and general conversation about projects.
@@PaulStoffregen Thank you very much!!
So is the audio library using onboard DSP hardware, DSP instructions inside the CPU or just performing all FFT operations in pure software?
CPU using special DSP instructions
It can run m8 headless?????
how would I go about making a GUI that controls these audio parameters? Do I have to use MIDI?
Nice job.
Have you measured the input/output latency and is it possible to reduce buffer sizes? The delay seems pretty long (maybe 50ms?) when she talks into the microphone. Is it easy to implement custom filter algorithms (e.g. LMS)? Thanks :)
Quick answers: The passthrough example has been measured at approx 7 ms latency, from analog input to analog output. Most of that is 2 block lengths. Smaller blocks are possible by editing the library. Most of the code adapts to smaller blocks, but some parts break because they depend on the 128 sample block setting.
Longer answers: To discuss this stuff in more detail or talking about special filter algorithms or other developments, let's chat using the forum. forum.pjrc.com/forums/8-Audio-Projects
Thanks a lot for the fast answer! I guess I will pick one up and experiment a bit :)
Awesome!
I just purchased my teensy 4.1 along with the audio adaptor board for my thesis project. I am just wondering, will installing the adaptor on top of my teensy prevent me from using the (teensy) pins it's soldered into? I don't quite understand how that works.
Quick answer: yes for the pins the audio shield uses, no for the others. Longer answer: ask on the forum and give context about your project and other hardware you wish to use. The forum is great for long answers and detailed discussion. Social media replies... only good for quick answers.
holy
this is cool!
From the last freesound.org, it should be: 201159
I need to connect high speed adc chip (40 msps). can teensy handle it?
Hi, Paul I'm thinking of getting a teensy for my organ pedalboard midi controller. I would like to play 2 notes simultaneously as in a chord. Is this possible, please
Yes
Hello is it possible to make a sensor just like the breath controller, with a sound sensor, volume sensor ?? let's say, playing with a real acoustic instrument saxophone, and with the saxophone microphone volume signal, generate the volume signal to control the sample?? is it possible???
as if it were a digital potentiometer controlled by the volume of an acoustic instrument ???
Yes, it's possible.
Here are some projects were people have used those sorts of sensors...
www.pjrc.com/open-woodwind-project/
www.pjrc.com/woodwind-midi-instrument/
Hello dear friends. I am carrying out a project that requires hardware that is capable of speech recognition of 15 monosyllables (which will always be the same) at a speed of recognition of each monosyllable between 5 and 15 milliseconds. After recognition, it must send a 4-bit data to a port where it knows which of the monosyllables has been recognized. I wish I could buy that development. Thanks in advance.
Where do you get the header pins to connect the audio board to the teensy? Like a dummy I soldered headers to my teensy 3.6 but am waiting for the audio board in the mail and don't know how to fix my screw up. Desolder the pins and find the right double deck headers? Or ghetto rig and solder headers on top of the other headers? Any help?
Don't try to desolder the pins. That almost never ends well. Maybe some people with amazing skills and the best gear can pull it off, but usually desoldering ruins the pads & nearby traces. Best to get mating sockets and add them to the other board. There's no rule saying one board must be above or below the other. The electrons won't know the difference, as long as the pins line up correctly.
Hm, how can i use the Audio-Data-Stream for own projects (in assembler)?
Is there an audio library PDF or similar as tyo what all the possible calls are etc? I want to download to a fire when go on a train and use it as a reference for all the different function. Cannot seem to find a link to one.
All the function calls are documented in the design tool. If you've installed Teensyduino, you already have a complete copy of the design tool on your computer. It works without the internet. To learn how to access it, turn to page 9 in the tutorial PDF.
@@PaulStoffregen Thanks. I was looking for a PDF to explain, ref the calls. I see the tool etc but it assumes you know what all the bits do.
any idea how to do fft in form of bar graph . and use teensy as spectrum analyser. will be very helpful in looking at harmonics in electrical system . thanx in advace
+Tejeshw Vardhan In Arduino (with Teensy selected, as the File menu change depending on the selected board), look at File > Examples > OctoWS2811 > SpectrumAnalyzer. It displays the 1024 point FFT on a big LED board as 60 bands/bars, each 32 LEDs tall. Of course, you could use pixels on a LCD. Look at File > Examples > Audio > Analysis > SpectrumAnalyzerBasic. Or check out this project: ruclips.net/video/IUbECxGWvFw/видео.html Hopefully you can get some inspiration from these, to adapt to whatever way you would display the FFT info.
thanx
Great!
what is the bitrate and sample rate for this? just curious on sound quality.
44100 Hz
@@PaulStoffregen oh that’s pretty good. is it 16 bit or 24 ?
Hello Paul, I am planning to do a project that involves the TLC5940 and This audio shield. The problem is that the pins overlap. Is there any way to rewire either the Audio shield or the TLC5940? Thanks in advance.
The audio part should work fine, but you won't be able to use the SD card or optional memory chip if using TLC5940. The old library for that chip doesn't use SPI transactions, so it won't share SPI nicely. However, if you use Teensy 3.5 or 3.6 you could use it's built-in SD socket which is native SDIO, not SPI-based SD, so no conflict with TLC5940. Short of massively editing that very old lib, I don't see any way to use both that chip and the SPI-based SD socket on the audio shield.
PaulStoffregen thanks Paul, just need to know, how do I do that?
Ask for details here:
forum.pjrc.com/forums/2-Project-Guidance
Hi there, is there a way to implement a pause/play, next, previous function in the teensy?
Yes. In fact, much of this is covered in the tutorial. In Arduino, use File > Examples > Audio > Tutorial > Part_1_05_Do_More_While_Playing.
Oh I missed the part! Thanks for replying :)
Hi Paul, I still can't get the Teensy to pause the music after several tries. I could do next and previous functions only. I have assigned button to 1 but am unsure of what code i need to add in...
Can I record audio using an external usb microphone with teensy? and connected via USB host?
Today, no. The USB host library does not yet have a driver for USB audio devices. I'll probably create this someday, but 1 to 2 years is the likely time frame. When/if it happens, that sort of device driver might depend on future Teensy boards which will have asynchronous sample rate conversion hardware.
@@PaulStoffregen Wow, thats great to know, Thank you!!