TEENSY-Synth EXTRA: Do we need the Audio Board?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys it's your pal dave from notesvolts.com some of you may be following my teensy synth video series where i teach you how to make a synthesizer out of a teensy 3.2 microcontroller so in this project we are using something called a teensy audio board and here it is here so it's a little add-on board that sits on top of the teensy 3.2 and gives you 16-bit kilohertz audio stereo out and it's a really nice board but it does add a little bit of cost to the project so the teensy itself actually has a 12-bit audio output and i was wondering how that sounds as compared to the audio board and is it good enough to stand alone so we don't actually need this the only way to truly find out is to wire up both versions and hear how they sound so let's do it but before we continue i'd like to take a minute and thank the sponsor of this video skillshare skillshare is an online learning community that has thousands of classes for creative people such as myself you can pick up some new skills or get better at stuff you're already working on if you're watching my stuff you're probably into technology and they have a lot of courses on electronics from basic theory to programming to arduinos to fpgas the sky's the limit or if you're musically inclined you can get courses on production electronic music and learning various instruments i'm currently taking a class called music theory exploring sound rhythm and melody on the midi grid by fernando arruda it's got some really cool concepts on syncopation complex meter and extended chords and i'm hoping it's going to spice up my songwriting skillshare is designed specifically for learning so there are no ads to break your concentration and they're constantly adding new premium classes so there's always something new to check out and if you want to check out skillshare and see what they have to offer the first 1 000 of my viewers can click on the link in the video description and get a free trial membership so thank you once again to skillshare for sponsoring this video all right so here we are at the workbench and i have to apologize i've been working on a million things so please ignore all of this area here and let's just focus here on my my vintage radio shack breadboard so i've had this since i was a little kid uh that's pretty cool right yes no okay never mind here's our breadboard we have the two teensies so here we have the tc with the audio board attached so we got them sandwiched like this and this is what we've been using for our teensy synth project basically this guy here on the other side we have a bear tnc 3.2 and we're going to try to take the audio directly out of here and compare to the audio from here now first of all if we look at the specs of the two boards the audio board gives us 44.1 kilohertz audio at 16 bits which is basically cd quality audio and it also has a stereo output so you can get left and right channels the bare teensy board has a built-in dac but it is 44.1 kilohertz at 12 bits and it is only one channel so you can only get mono sound out of this now if we were listening to music files that might make a a difference because the 16 bits is going to give us a little higher fidelity sound but for the stuff we're doing with our synth stuff we're just generating simple sawtooths and square waves and what have you is there going to be a noticeable difference now the audio board costs around 15 u.s so you can take that into account too there's a little extra cost to use the audio board so the only way to really find out is to hook them both up and do a a b test between them let's take a quick look at the boards on the pjrc website and they're giving you the specs yes it is 16-bit 44.1 kilohertz now here's a very important point they have just recently released the teensy 4.0 so my my tutorials were all based on the 3.2 which was the best tnc available at the time but now they have the 4.0 this is very important please notice that there are two different audio boards one for the three point whatever and one for the 4.0 they are not pin compatible so if you have a 3.2 make sure you get the 3.2 audio board and not the four because it will not work also notice on this board there are two audio outs we have the headphone jack right here and we also have a line out so here's our line out pins we have a left channel ground and right channel and we are going to use these because i find the line out gives you a much better signal if you're using a line out which just makes sense on the teensy 3.2 here is the 12 bit dac pin right here and that's where we'll be taking our audio out for this guy okay so let's get our teensys wired up for sound and load some software in and get them making some noise so like i said we are going to take the audio from the line out pins on our audio board and i've soldered a little header pin uh three pin header right here so we can easily do that what i'll do is i'll take some male to female jumper wires and i will just jump them to my breadboard so we're going to use a black wire for the ground which is this middle pin and we'll just go to some random spot on our breadboard and then i'll use this white wire to uh this channel here we're only going to run it in mono so there you go and we'll just put it somewhere next to it so now i'll take a little uh 1 8 inch headphone jack and i'm going to just connect it so i'm going to connect my uh ground or my shield pin to the ground from my uh audio board and then i'll take one of the channels and i'm going to connect it to the signal pin and this extra audio channel we're not using so i'll just kind of park it in a spot right here and there you go there's our audio hooked up now for the program we are going to use the little test program we did in part one of my teensy synth series and if you haven't seen it already please check it out but here it is so it's a very simple program it basically is just going to output a sawtooth wave and kind of sweep it up some frequencies just to test that we're getting audio out of this thing so if you look at the code here is the part that generates the connections for the tnt audio board and i'll show you how this was generated in a moment we've basically got some basic housekeeping here this basically turns on our sound chip in the audio board sets an initial volume sets the waveform to sawtooth sets a amplitude and a frequency and a pulse width and then this little loop just kind of sweeps it from 50 hertz to 500hz okay so to upload the program we are going to get a usb cable and we'll plug it into our tnt board so now we'll go to our software and we'll make sure the board is set up correctly so we'll go to tools board tnc 3.2 yes port make sure that it is available in the port so there it is it's showing up as com8 we'll just select that and finally we can leave the usb type as serial because we're not using any midi for this we're just it's just a a basic audio out so once all that's done just hit upload all right takes what it takes a while to compile so just be patient and once it's ready your teensy programmer window should pop up if you get this message the teensy did not respond what you have to do is you have to push there's a little white button on the teensy uh you push that so mine's under the audio board but i can still access it so i'll just push that and then it reboots and the code goes through so sometimes it just goes through sometimes you just have to push that little button to to make it do the last step okay so now we'll just grab a audio cable plug it into our jack i've got the other end plugged into my mixing board and let's see uh what we get oh yes [Music] perfect so we've got one of our tnts up and running so let's unplug this now let's get our second tnt up and running but before we upload the code we are going to have to change it to the built-in dac instead of the audio board so here's the audio board stuff this uh control sgtl 5000 that's the audio chip in the board in the audio adapter board here so that's the chip they're using this controls it uh i2s1 it's a i2s output so that's how it's connecting to the board so we're going to have to get rid of this and change it into the built-in dac for this guy so how do we do that well luckily there's a tool online for at the teensy website that makes it pretty easy so let's let's go take a look at that okay if we go to uh pjrc.com t slash gui slash index we get to this super cool tool right here that just lets you drag various modules onto the screen and make the connections that way what we can do is if we go to our code here is the stuff that it generated when i did this the first time we can just copy this and we can just go to import and then paste it in this window we want to make sure that import copy code from arduino ide is checked and then we go boom and there you go that is the connections that were in my original program now if you notice it's very simple we've got a waveform generator here i've got uh two outputs going to the stereo outs of my audio adapter board so it's the i2s connection and then we also just need this guy here so this little module is the controlling module for the chip on our audio board okay so that's how easy it is to do these connections and then when i'm done just go to export and it will give us the code we just copy and paste into our software but like i said we don't want to use this uh sgtl chip anymore we want to use the built-in dac so what we'll do is we'll just select this guy and the cool thing too it also gives you some information when you select the module it will kind of tell you how it works on the side here which is a really nice touch so we'll just select the i2s1 and delete it and then we'll select this guy and delete it and we're just left with our waveform module now if we go to output here we want to go down to dac and that is the tnc board's built-in digital to analog converter so we'll drag one of those onto the screen and there it's going it's telling us a little information about it showing us what pin it uses now all we have to do is connect the two so i just click on this node here and drag a line and then connect it to that load that node there and boom we are done now a couple of things if we look at um the information here it's showing us there's the dac pin it is saying the voltage the output voltage has a dc level some applications like especially audio applications require dc blocking capacitor so we are going to use this they're recommending a 10 microfarad capacitor and we are going to use that uh it says the positive terminal should be connected to the teensys dac pin so i'll we'll show i'll show you that when we actually hook this up okay so there's our very simple setup let's go to export and there's our code so let's just copy all of this and then i can go back to my program so you notice this whole section this is what was generated from that that website so we'll select all of that and we'll just delete it and i'm going to paste in the new version we just made so here is our waveform generator here is our dac and here is a patch cord that is basically connecting these things together now one thing i'm going to have to make sure i do is get rid of this sgtl 5000 information here so if i just run this as is it's going to generate an error because i didn't define the sgtl anywhere in my code so it's not going to know what it is so why don't i just comment this out and that way it's not going to generate an error everything else can be the exact same so let's go back to the board and upload the code to our bear teensy so we'll just plug in a usb we'll go to the tools menu so it's a new board so we're gonna have to set it up so it's 3.2 again we can leave it as serial and the port make sure now you see this tnt is on com3 so we'll make sure that's selected and we'll just hit upload again and once again it's saying it didn't uh respond just hit the little white button and there you go perfect okay so let's let's make the connections to our teensy 3.2 so if you remember this second pin from the corner here is our dac pin so we're going to i'm going to use one of these little j hook adapt cables to hook up to that these are very handy for for experimenting so i suggest you pick some up if you don't you could always solder a wire to that pin but just make sure you don't short it to the breadboard because then it's going to short to this pin right next to it which will be very uncool so we're going to use this little connector here so i'm just going to connect it to the j or i'm just going to connect it to that pin and there you go now i'm going to take our capacitor so this is a 10 microfarad electrolytic capacitor electrolytic capacitors have a positive and a negative side and the negative side is usually marked by a stripe or a negative sign or something like that the positive side is not marked so they only mark the negative side on this one which is fine so we're going to do is take the positive side and we're going to connect it to the other end of our little cable here okay so basically we have our dac pin going to the positive side of our capacitor and we're going to place it in our breadboard just any any open pins like that so now we're going to take an audio jack and this is an rca jack but these little things here are super handy to have so these things i think are used for security camera installations and av installations and they're basically a jack you can get different you can get like headphone jacks or you can get power jacks or whatever but they basically break them out into these little screw terminals so you can just screw some wires into those and then you have the jack on the other end so i'm going to grab this i have a wire hooked to the negative side which is the shield and i have another wire hook to the positive side which is the tip which on rca is the inside of this hole so i'll take the positive side the tip and i'm going to put it to the other side of my capacitor which is the the negative marked side all right so basically we've got our dac pin going through this wire to the positive part of this capacitor and then on the negative leg it's going into the tip terminal of our jack here now we'll take the ground terminal and we're going to hook it to the tnt's ground so you can find a ground there's a couple of locations but there's a real convenient one this first pin right in the corner so we'll just hook that right into there and there you go there's our audio circuit now we'll take a suitable cable in this case an rca cable and we'll just plug it into our mixer and now we'll power it up and let's see if we got sound perfect so now we're going to do a test we're going to do a listening test and see if we can hear any obvious difference so sometimes you know the specs are the specs but can your ear hear any difference so let's plug in both boards and let's hear what we can hear so here is the audio board [Music] switch back and forth [Music] that is trippy [Music] so just by ear i can't really hear any difference like i've got the mixer both channels set up the exact same way no eq no nothing and the volume seems the same and the the tone seems the same i i was listening for any high end weirdness i couldn't really hear any so uh that's looking pretty good for the uh dac out on its own for the teensy board all right so i just want to take a quick look at the waveform on a scope and see if we can see any obvious differences so let's modify the program uh to just put out a single uh frequency so we'll just select this little loop here and we'll just comment it out for now and then we'll set our waveform frequency to 440 which is uh a i believe an a note okay so here are the two waveforms on the scope so the top one is the teensy audio board and the bottom blue one is just the bear tnc 12-bit dac and if you notice the the 12-bit dac is actually a little cleaner than the the teensy audio board so the audio board is introducing a little bit of ringing on the transitions here whereas the the 12-bit dac is pretty much rock solid so hey that's a that's a real surprise so i think we've learned that the onboard dac on the teensy actually sounds pretty good so i think the next step for me is to build up a version of the teensy synth using the 12-bit audio output as always i'd like to sincerely thank my patrons on patreon for supporting this video thanks a lot guys let's enjoy your names on the way out so i will see you guys very soon [Music] so [Music] you
Info
Channel: Notes and Volts
Views: 18,750
Rating: undefined out of 5
Keywords: Synthesizer, Electronics, Midi, Arduino, Teensy, Microcontroller, Tutorial, DIY, DAC, Audio Board, CD Quality, 44.1Khz, 16 Bit
Id: c39e8FvTYRA
Channel Id: undefined
Length: 23min 38sec (1418 seconds)
Published: Thu Jan 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.