 Hey, hello, welcome to the show, it's me, John Park. It's time for John Park's workshop. Thanks for stopping by. We have our chat over in Discord. If you're wondering where that's at, check it out right here in Discord. It's at adafru.it slash discord and we're in the live broadcast chat channel. And I am very pleased with myself because I've been meaning to for ages to set up some camera layers that do this sort of thing so that I'm not stuck hiding behind the windows I bring up. So now we can see me side by side with much bigger windows for at least a few of these things. Also, one of the reasons I did this or one of the things that enabled this is a friend of mine showed me a trick that Google Chrome has in it that they debuted somewhere around the year 2012 that I just found out about that makes this really helpful just in the context of broadcasting with Wirecast. And that is in a Chrome browser, you can turn a page into essentially a Chrome app by going to the three dots and there's like a save shortcut as and you can pick open it in its own window. So now I have separate apps that were normally just tabs or windows in Chrome which made it way harder to do this sort of thing and then come back next week and have it all still work. So I think this is how Chrome, Chromebooks work. They just save Chrome pages as a separate window thing. So go check that out. If you're interested, I'll show you show you how that works sometime but it has made my life easier. It also means I have distinct icons in my dock down at the bottom taskbar or dock for these things and it's not just like one instance of Chrome and then bazillion tabs that you can't find. You can all tab through them and so on. Super pleased about this. So yeah, interesting, right? I thought it was a revelation. Maybe I'll show you how it works. Yeah, check this out. So here, here's a browser. And right now this is just a regular old browser. Can you see this? Let me see if you can see that. Will it show a pop-up window? Oh, it won't. No, it's not showing the pop-up. Okay, but you can see I clicked on those three dots in the upper right corner and then you go to more tools, create shortcut and then a create shortcut window pops open and you can choose a checkbox for open as window. That'll turn it into this kind of Chrome app. So there you go. That's my tip that I'm super happy about. Let's talk about jobs. We've got a job board here at Adafruit. If you go to Adafruit, sorry, jobs.adafruit.com, you can take a look at positions that are open. It's free to use, free to go look for a job. It's also free to post if you're looking to hire someone and it's free to post your resume. So here there's some new ones up here since last week, there's a hardware engineer position, part-time with a potential for full-time CTO. They got big plans at Bright Smart Rings in Chicago. Also a systems administrator at Pratt Institute in Brooklyn, New York. So go check those out, see if they are for you. That's jobs.adafruit.com. Let's see, what else? On Tuesdays, I've got this show right here which is JP's product pick of the week. I just had it two days ago, Tuesday. And on it, I like to show a new product pick or an oldie but goodie and give you a huge discount on it if you buy it during the show, 50% off in this case. And I do about a 15 minute show and tell of it, show you how it works, pick around some of the hardware, software, circuit, how you put it together, code it if it's that sort of thing. This week we had one of my favorites which is this terminal block feather wing. So here's a little one minute recap, check it out. My product pick of the week is the terminal block feather wing. This is fantastic, this breaks out all the pins of your feather plus some extras onto screw terminals so you can add wiring and get a really nice and secure connection. Every one of those pins that you might be tempted to use on a breadboard and have wires fall out on you and then it's sad, instead this is happy because you get these nice secure terminal blocks that you can screw down wires. I wanted to use one of these, right? How are you gonna plug one of these into your feather project? Well, this is kind of a nice way to do it. So I've got the NeoPixels plugged in, I've got the analog throttle plugged in and then I also have some controls here with the D-pad just lighting different numbers of LEDs on here depending on which buttons I press. It is the terminal block feather wing. Yes, it is indeed. Over in the chat, I saw that DJ Devin3 said there are Arduino R through screw shield is on the way. Yay, thank you so much. That's the one that Todd and our friend Brian Jepsen and I designed many years ago and we get a tiny little piece of that action when you buy one of those, so thank you. It's also a very cool board. Do you know which one I'm talking about? I showed this during the show. Where's one? Here's one, here's one with stuff plugged into it. Super useful also, same idea. Terminals plugs into your Arduino, in this case, Uno-shaped Arduino. Gives you lots of terminals to plug your stuff into. All right, let's see, next up. Why don't we do a circuit Python parsec? I have I think a really cool and useful one today. I like to think they all are, but this one I'm particularly happy about because it fits into the project I'm working on. So check it out. Yes, circuit Python. Here we go, let me get set up. All right, for the circuit Python parsec, today I wanted to talk about sorting lists. So sometimes you have lists of things. In many cases it will be a SD card directory which leads into a project I'm working on where you can list the contents of something and then you wanna do things like sort it into a alphabetical list or other criteria. So how do you do this? If you look here, I've got this OS library installed. So importing rather, import the OS library. And then what I'm doing here is creating a list called fruits and then down at the bottom I'm just skipping ahead to printing that list out. So if I hit save on this, you'll see right here on my Pi badge I've got the list printed out in the order that I typed it into that list. If I want to sort that alphabetically, all I do is take that list and I'm essentially gonna rebuild the list but this time in alphabetical order. So fruits.sort, that's all it takes. When I save this, you can see same list is printed but after being created it's now being sorted and it's alphabetical. You can also use sorts, whoops. You can also use the same command fruits.sort and then reverse equals true and that's gonna, you guessed it, reverse that list so now I can print them out, reverse alphabetical order. And then you can also do some really sophisticated things by creating functions that get called by the sort. So this is going to sort it alphabetically and it's going to sort by the length of each element. So if you look here, I've got this function called length sort element, return the length of the element. So when I hit save on this, now they are sorted by the smallest to the longest word in there and you can do things like reverse that and add on to this. But this is a really simple way to take lists and sort them so they are more useful to you and that is your circuit Python parsec. The circuit parsec. All right, hope that's a useful tip for people and let me bring my discord up so I can see what's going on in there and hey over in the YouTube chat, hello, I see Gary T, you almost missed it. Well, I'm glad you're here. Thanks for stopping by. Oh, Liz says, but city DIY, hello Liz says I've been doing a lot with lists lately intense how much you can do indeed. All right, so let's see next thing we're gonna do I wanted to do a gear report. So this is actually a thrift store report a thrift shop report. So let me change over to a bench cam view of the world and bring up a little view there and I'm gonna head over here. So I was over at the local thrift store. Let me focus this a little better. Actually I have to change it when I flip this gizmo up and usually I don't pay too much attention to stereo equipment. A lot of it is like big CD changers and things that I just don't have space or too much interest in but check out what I got for $14.99 plus tax. This is an audio source model EQ eight series two. So this is a stereographic equalizer and a spectrum analyzer in the middle there. So if I power this on you can see we've got a bunch of lighted knobs, which is super cool. I've got a stereo input here that I have I'm playing out of an iPad over here with Spotify on it. What I'll do is I'll play some Bartle beats and what you should be able to hear is I'm gonna be able to boost certain frequencies or cut certain frequencies. So that took the bass out of it and it pushes the highs. I'm not running stereo right now so I'm kind of ignoring that side there. But it's cool you get to see the frequencies that are being pushed. So I had some peaking there and some of the mids, mids to trebles. All right, super cool. And one of the things about this is when I got it it was missing one of these knobs and one of the knobs didn't have its little LED working. So I went to take a look at it and I looked in one of the knobs. You can see this very bright one here or sliders rather, the focus there. The reason this was fixable is that the knobs are LEDs. They have a little plastic cover and a little light pipe, little lens. And then it's literally a straight up five millimeter LED or maybe a three millimeter LED with contacts inside of the fader slider handle. So since it was missing one, I'll leave that one in there. I've got it jammed in there and heat shrink to it. I just took an existing LED I had. I should have put a little plastic in front of it to dim it a little bit. But I just put some heat shrink over it once I had that inserted. And now I have knobs on all of them. One of these was just loose over here. I think it's this one here that's maybe the contacts need to be cleaned inside of it. So this is my little find here. It's got a little bend in the cover and that's about it. That's the only other thing wrong with it. Probably got dropped at some point. So I'm gonna bend that back. There you can see that just needs to get set on a two by four and hit with a rubber mallet. This thing's gonna be my approach there. I'll see how that works. And then inside, I don't know, I haven't looked up any of these chips, but this is what we have inside. Giant transformer, not giant, but big transformer here. A whole bunch of audio I owe. The whole switch scenario here is interesting. It's a really big board. Let me zoom in. Really big board with mechanical extensions to the switches. So these are little toggle switches, spring-loaded toggle switches that are really far back from here. And they have quite a few contacts on them. So I think these are able to do switching of a bunch of things, which may be how we're switching some of the outputs to just monitor or not run it before or after the EQ, pass the EQ through. This sends it to a different output. And then this has a different set of inputs, which they called video, but it's really for your, let me focus on that a little better. They meant this for like a cassette player in a VCR, seems from the manual, what they had in mind. So this could be labeled anything, but it's just two different RCA inputs, either this set or this set. So anyway, kinda cool and neat little matrix LED board there. You can see it's just got these tiny surface mount LEDs, I believe they are, that light up with the spectrum analyzer. Let's see if they're there again. So cool find, so I recommend check out your local thrift stores if you can. It's a form of ecologically friendly consumerism, I guess, and pretty cheap in a lot of cases. So that's my little thrift store find of the week. And I think these go for maybe 40 bucks, realistically, on reverb or something like that. So it's not like it's a priceless artifact. DJ Devin, why would you intentionally design such long buttons? So weird, yeah, you got me. If anyone has insights on that, I'm curious. All right, so let's pull this apart. We'll see if I find a home for this. I may just set it right underneath my Euro rack. It may fit under one tier of my Euro rack and then send my audio outs off of my mixer to this. So I can have a little extra EQ, which would be kind of fun. But for now, let's set this right here on top of TV. And let's see if I got, there we go. Switch those cameras around. Next thing is the project I'm working on. So you may have seen me demo this last night on Ask an Engineer or rather on Show and Tell. I am in process of building this right here. This, let's see my fritzing diagram of my wiring. I have just wired up the display on my little walk person, as I'm calling it. So it's an MP3 walk person. And I'm going to be doing display stuff, which I haven't done yet, but I've got MP3 playback working. And the thing that is new that I'm excited about is I've got the MP3s playing right off of SD card. So let's see, I could probably grab a cable here for sending out that audio. So let me first show you what I got. I know it's a bit of a mess of wires right now, large. Oh, I'm sorry, this is a bit shaky, there we go. So what we have here, Feather M4. I am sending out digital audio. It's kind of the best possible audio quality that we can get. Digital audio out to an I2S amplifier. So this is I2S decoding, turns it into an analog signal, amplifies it. And I've sort of discovered some things along the way in building this. So first of all, on our little I2S amp, which I'll go over to the computer and show some close ups of this. We have a gain pin, which you can leave alone and you get I think a plus nine DB amplification. You can then use different combinations of resistors or wires shorted to the voltage input and that will change the setting. It's just sort of a startup thing. You can't really do this actively and it's just a few increments. You can't use a potentiometer with it, but I've put a 100K ohm resistor from gain to the voltage in on that and that gives me just drops it down to three DB which makes this work pretty well for headphones and line out. So you can see instead of running to a speaker which is kind of what this one is designed for, I wanted to use it as a headphone amp, albeit it's a mono one. There are ways to run two of these but that then really only works for speakers. So you can use two of these for stereo off of the same set of pins. In fact, you can just tell each one who's being left or right or a mix but that won't work well with headphones because of the type of, this isn't really a ground. This is more like an AC which doesn't work that well for left, right and sleeve TRS jacks for a set of headphones or a powered speaker. So other thing I found out is that this amp really wants five volts. I am not sure exactly why and Lady eight is looking into this because it's actually rated for 2.5 to six or something like that input voltage on this little Max 98357A chip is this one here. For some reason it's really noisy when I have three volts no matter the three volt source I've tried a bunch of them. When I give it five volts super clean, really clean sound, kind of cleanest sound I've gotten off of a microcontroller with an amp. And so to do that right now I'm using this little, we call it the mini boost and that boosts whatever you give it up to a nice clean five volts. So I'm giving it 3.3 off of the battery pin. So this will run off of battery. In fact, if I take off the jumper of the enable pin to ground, this is running now. Turn that off again for now. And then the other connections I have are I'm running a set of transport controls. So next song, previous song, play and stop and maybe I'll adjust what those do this is just a nice set of Neo-Key mechanical key switches. I got some clicky kale box whites and that is running over I squared C. And so I squared C, I'm using this great little since my Feather M4 board here does not have a stem of QT slash quick port. I'm using one of these little spark fun breakouts that has four header pins that go into your breadboard or your perf board or your circuit board and gives you two of these STEM a QT cables. I'm going to be adding a rotary encoder breakout also on I squared C. So it'll be plugged into this and that'll give me volume control. So I'm using the circuit Python audio mixer to be able to adjust the sound level. And maybe the push encoder of it to do other menu-y kinds of things. And then the sort of new cool part is I've got this display here, which currently does nothing. I think the backlight lights up. Other than I am using the SD card on the back of it. So this is super cool. I have one of our, you know, the Adafruit store sells these really tiny SD cards. This one has 128 megs on it. We even sell a 64 meg one. And these are kind of perfect. They're cheap and they're perfect for use as essentially a mix tape. So I want to use this little walk person as a sort of a mix tape thing. Then I'm going to want to be able to have different cassettes of SD cards. And I might even do some cute little tiny cassette graphics for these. So this makes it really simple. With whatever cassette I have in, those are the songs I can play. I'm going to display them. Eventually I'm going to rotate the display sideways and I'll put I think a cassette tape icon, maybe with some animation of it moving. And the name of the song in the mix tape, kind of as tape labels, that's the goal here. And, but I'm really excited because the Feather M4 is a great board for doing this, except it doesn't have much memory. It has two megs of space on it. So you can't really get that many songs on there of any quality or length. It helps them doing mono, but now with the SD cards I could do bigger files and stereo files. So let me do a little quick demo of this. So I'm going to plug in an audio cable. I'll plug this into my little amp here. And so this is very much just a mono thing at the moment. But what I've been testing it with is nice little set of headphones, which works great using headphones. These ones actually, these are the ones they sell in the Adafruit store. I kind of want to get old fashioned Walkman style ones, but these ones in the Adafruit store are great because they have a analog potentiometer, really tiny slide pod on there. So you can do your own volume control, which is great since I don't have volume happening yet on here. Oh, Zee says, use a micro cassette case to hold them. I love that. That's a really cute idea. I'll look at that. I have, I think all of three micro cassettes here. So let me turn my amplifier on here and I'm going to turn on the board. And now I can play. Be nice once I have stuff on the screen telling me the state of things. Okay, so this is another Bartlebeats song off of the album frequency. So we have no worries of copyright strikes, which is great. So I can hit stop. I can use the next, and that's going to play the next song. I think I have four songs on the SD card right now. And go back, previous one there, or loop all the way back around. So that's the fourth or fifth, whatever it is, song on there. And stop. So that's the basic function of it right now. Over in the chat, thank you, C Grover. C Grover reminded me that he's made a really cool PCB that is a Stemma backpack for a featherboard. So it can sandwich right on or under, I guess, a feather and it gives you both a Stemma cable, full size, and a Stemma QT cable, small size. Very cool. Let's take a look now at how some of this is working in code as well as some of the parts. I'm going to unplug this, let me shut it down. I'm also going to add a, instead of this wire for enable, I'm going to add a on off switch to it, I think, just to give us a neat way to turn the thing on and off and save battery. But again, you know, nice project to use feather on because it means that we can do battery and battery charging just by leaving the same USB port available that we want to have available for any type of code adjustments. And I'm also going to come up with a case that gives us this, essentially this will be our interface, the cassette display there and the transport buttons. And ideally leave the case right up open to the edge as a spring loaded SD card. So we should be able to get new cassettes in there with some care there we go without needing to extend that. If we do, I have a little PCB that Adafruit sells that's an extender for an SD card slot that adds about three inches, two inches or so of extension off the edge of the board. So let's see, yeah, let me bring this over and we'll plug it in and check it out. And I'm going to bring up a, how about this view right here will work well actually. Out a little bit. Yeah, I think LeMore has said if and when M4 chips come back into the world there may be a don't ask questions about it but there may be a new spin of the feather M4 that'll have a USB-C and a STEMA QT port on it. I'm not sure about other changes but those will be welcome. Okay, so let me jump over to Adam and let's open up code.py on this board. Is this up and running? To enable cable off of there. So, oh, you know what I may do also, I don't know if to have an adapter. I may show you the contents of the SD card just so you can see how that's laid out currently. I just have them at the root level of the card and I am not using directories or any kind of like text file or anything like that. It might be neat to use text files to sort separate song lists but really in the spirit of it being like a cassette I kind of want to stay away from that and just have you pull out a SD card and put the new one in. So, if you take a look here, first of all, I've got some SPI set up for the SD card and I'll be writing a guide about this. One thing that tripped me up is when I looked at an SD card guide that we have, it mentioned setting up your card, your chip select pin and so that usually looks like this. CS equals and then the pin that you've connected from chip select to your microcontroller. Well, I did that and it kept saying me there's no SD card, we're not finding one. And after a while I was really looking closely at this board here and I realized there's both a chip select pin and an SD CS, that's the SD card chip select. So I was using the display chip select because they're both over SPI by accident so it was confused. So, SD CS is what we actually have to connect in this case and so here, I mean I'm naming it that way just to prevent confusion, this could be named CS but more to the point I was plugged into the wrong pin on this display so be careful about that. So we're setting up SPI for the SD card just like the SD card breakout, it works the same and then we're setting up the file system, it's a fat file system and we're mounting it and we're mounting the drive essentially called SD. I haven't done much of this stuff in Circuit Python before and it works so well, it works really easily, it's really straightforward, I was pleased at how quickly I was able to go from having a couple of tiny test files on the feather itself to putting full big song MP3s on the SD card and running them right off of there. Next I'm setting up my NeoKey which is what I'm using here for transport control, I'm setting that up over I squared C, setting some pixel colors and some key states and then MP3s, if you look at how I was doing it initially that's this right here, I'm gonna zoom in. Nope, not like that, I'm not, there we go. So initially I had a folder on the feather called MP3, it's actually still there and I had these two MP3s here that are tiny. Then when I switched to using the SD card all you have to do since I mounted it up here, where did we go? I mounted it as slash SD, to mount that I think is anything you want but I've mounted it as slash SD, now I'm able to just start pulling that list off of the SD card, pulling MP3s off the SD card. And then the next step for this of course and you'll see this in some of the Adafruit projects that do MP3 stuff, there's a really great Jep player from Jeff Epler, FOMI guy, has the Winamp style, Pie Portal player, any of the older Adafruit music maker feather wing or music maker shield projects that are done in Arduino typically. We'll have this moment where they just check the file system that you're using, so in my case the SD card and grab the names of everything there, which is gonna include a whole bunch of junk and then throw away the junk and just keep the stuff that's got a nice name that starts not with a dot or an underscore and ends in dot MP3. And so this is a version of that that I was about to dive into when Todd bought our good friend Todd Currant said, hey, here's a very simple snippet of code that'll do just that. So thank you, you saved me an hour I'm sure. So if you look at this bit right here, I'm creating a list called MP3s and then in this loop for each file name in this OS, there's that OS operating system library again, OS list dir and then the name of the directory, which is our SD card, if the file name ends in MP3 and doesn't start in a dot, then that's the list we're gonna grab. And I'm appending each of those good names, not all that junk to this list. So actually let me connect to this board. Hopefully that's the right board. Let me unplug my camera switcher. Okay, I think it was. Reload here. So you can see when it boots, it prints out SD file name and so on. If I take this and run that, let's see, do I have an easy way to do this? I don't, I don't wanna do that. But if I ran through all of those before doing this, you would see a whole bunch of files that have crummy names. Let's see, can I do, let me see if I can do it this way. List index out of range. Why? Or file name and OS list? Okay, I'm not gonna mess with that. But, point being, we now have this list, let me re-save that, that is the good clean names. This is also why I got into this whole sorting thing. So my next thing I did was sort these alphabetically. So you can see when I print out that list of what's on the file system, it may be date based, it may be the oldest to the newest that it printed. I'm actually not quite sure what it sorted it by. But I want to be able to put my songs in order. And so what I think I plan to do on the SD card is simply name them with zero one through 12 or whatever, I have 12 songs on the tape. And if I do this MP3 sort, it takes this list that I'd already created and it recreates the list this time alphanumerically. So a zero one should happen before a zero two and so on. So this is the proper list right here. This was a short lived moment, if I jump ahead of me calling it the walk muffin with lowercase u and a lowercase n. Now this is gonna be the walk person like that. There we go. Walk person. Let's see, so after I create the list and sort that properly, and here I'm just printing it for fun so we can see the list there. Now I'm setting up a variable called track number and this is what's gonna keep track of which one we're on. The first one is indexed to zero, so it'll be the first track. The name of the song is My List of MP3s and the first entry in that sorted list. So the track number zero. Then we set up the audio bus. So this is using, excuse me, this is using I2S out. So that's that I2S output set of three pins I think it is for clock, a couple for clock and data. And that is like I said capable of sending stereo. It sends the left, right, the data on the left and the right pins sort of interleaved I think. Sorry, on the data pin interleaved with a clock that says right now we're sending a left bit, now we're sending a right bit and back and forth. Then you can decide to use the thing in left mode, right mode or mixed mode I think are the choices there for how it actually outputs over its single output. So I2S output and then we set a pin. So we're telling it the bit clock pin, the word select pin and the data pin. And actually, Lamora was talking about this last night on Ask an Engineer cause she was talking about a couple of chips, maybe this one and another one or a revision of this chip that's on here. What is this one? The Max 98357A. And unlike some I2S chips, this one does not require what's usually called the master clock. This one just doesn't need that and I didn't catch why. I was trying to look and see can I use one of these which is the teensie audio breakout adapter or teensie audio adapters made for teensie. It could probably be wired to run on other things. And it's got a nice little headphone out on there and it has a SD card on it. So it covers a lot of the bases. But this one will not, as far as I can tell, work without having a master clock pin and I don't think we have that worked out in our libraries. So for now at least that one's not gonna work for me. So then I set up my MP3 stream object as an audio MP3 so I have that library imported, MP3 decoder and then I open the song which was this MP3's list item zero in I think that's raw binary mode. And then I create a mixer object. So you can play MP3's without it but by creating the mixer object now we'll be able to adjust volume and do other fun tricks. You can play multiple streams which would make it kind of tempting to crossfade. So when you get to the end of a song somehow, I don't know if it's really possible, but somehow if you could know that you're getting to the end of a song then you could start the next song a little early by having it be a second voice in the mixer and then do a crossfade between them which would be kind of cool. But I'm not sure about that part of being able to know where you are in the track. Maybe it's possible. Let me know in the chat if you've ever run into something like that. And I gotta move my window out of the way. See, so when I set up this mixer I'm just setting a voice count of one. You could do multiples of those like the breakbeat breadboard project used I think eight. I had eight voices playing at once. Setting the sample rate to 22 kilohertz. Channel count is one and that means that I'm reading mono files. So you could have this B stereo files or mono files but I'm choosing like I've said for various reasons to do this mono. Bits per sample, 16. Samples signed is true. I'm setting my level really low. So you can see 0.05 and that was plenty loud. You could hear those when they're playing. And then finally I set the audio to play the mixer object. And I'm also setting this play state to false. So this means nothing is playing. The machine doesn't think that it should be playing anything when we start. So what I do next is I say if the play state is true well it's not, so let's skip that. So the play state isn't true when we start. So now we jump down to checking our Neo keys and I'm just looking at all the keys and if one is getting pressed and it wasn't currently pressed so this is kind of a debouncing then I'll set the key state to true and I'll light it up for whatever color it is. And right now this needs to be optimized but I essentially say if the key is key zero that's the reverse key. So it will change my track number by decrementing it, subtract one. Modulo, however many MP3s there are so we can loop back to song four or whatever when we go all the way through the list. Same going forward. Then I change what the MP3 stream is playing. I open up the new song. I am not looping it so it'll just play it once. And I've set this play state to true. The reason this matters and this is the way all of them work except for stop. Stop just stops it, sets the play state to false but let's look at the play button which is this white one here. This is button number two, zero, one, two. High print play. I'm playing a song and I've set the play state to true. When this finishes so let me plug in so we can hear some audio on this. And I was testing this with some little five second long songs because otherwise I'm gonna wait two minutes for this to get to the end but let's turn on a little speaker I have here. Okay so you can hear. Okay so it's playing this little song. I'm gonna talk while it finishes and you almost don't need to hear it but what you should see when it finishes up is that this is gonna move on to the next song. And the way that does that is if we look at this first thing that I skipped this loop if play state is true. So the play state is true currently because it's playing and I said so I pressed a button and made it say that play state is true. We can check if the mixer is playing or not. So the mixer playing is true while it's while the song is on and it's false when the song stops. So that's our easiest way to just check and see is this thing running. So when that song ends this is gonna become true. Oh sorry this is gonna become false. Mixer is not playing. So then I'm printing for myself next song increment the track number do the same same exact thing we did with any of those buttons. So this means it's just gonna play forever. Now in true cassette fashion it might be fun to have that end on the last one. So do another check to see which number we're on and if it's the length of the list then we stop on that one. Also fun since we have mixer to add some rewind sounds forward sounds other things like that would be fun and possible with this. Let's see it sounds like this song is nearing its end. We'll see how long that outro is there. The Fabulous Bartle Beats. Oh it's got legs. I'm gonna check the Discord chat just in case anyone knows of a way to ask a file if it's nearing the end. Come on song you can do it. Actually you know what let me show you how I'm doing this as I develop because I still have those short songs on the feather even though I have the SD card in there we can use those instead. So check this out here I'll hit stop. Oh wait this is about to end I bet. No it's not. This song doesn't wanna end okay I'm gonna end it. So here I can do something real simple. I'm gonna make my MP3s list just be the feather itself so if you don't go and mount some other file system this should just pull songs off of the feather and I have an MP3 folder on the feather. Okay so I'm gonna hit play. Now watch the text output it's gonna end in like a second. There you go next song. Got five seconds of daisy. Now it should loop back around. Next song okay so that's just a tip I have there for testing this you don't want an actual song length song in there all right. So if I reload this we should be back to the SD card and I really should put like some debug flag that flips between these that would be neater than just commenting stuff out but this code is pretty short so it's not too much to keep track of. Let's see so Dexter says position of a playing MP3 I don't think there's a way. So I'm curious if I could do extra work like create metadata before I put the SD card in that run a program that grabs the length of the MP3 and includes that in a little piece of like side text with the playlist or something. And then we can do it based on that. Sounds complicated though. Blitz CDDY says could maybe do something with the samples decoded oh interesting all right. We'll keep those suggestions coming. I will try some stuff because I think that'll be really fun to be able to know the length of these. Could even do graphics based on that like how big the real is of cassette that's shrinking in the animation if I get that ambitious with it. But I think that's what I've got to show. So let me know if you have any other questions about how that's working so far and where it's headed. Let's see what else is going on in the chat. Yeah Todd says you could store the length in the file name. That's way simpler than what I was thinking of having a little sidecar file there. Track one four minutes 33 seconds dot MP3. I like that. Let's see. Oh one other thing I saw that. So this was inspired by project. I'm not going to go grab it right now. Inspired by project I've talked about before that was an MP3 player that looked like an old desktop cassette tape recorder. Beautiful great project. That was part of the inspiration for this. That one included some code to store the position of where you are in the MP3 when you stop which means you can pick back up again without just restarting it. They were using it as an audio book. They wanted to be able to do audio books really important in your 17 hour file to be able to save that bookmark or that position. So I'd be curious if that's straightforward to do. It is not that important for this project and I'm not really trying to do fast forwarding part way into songs or anything like that although obviously that could be a possibility as well but let me know if anyone has ideas about some of these more advanced MP3 topics and I'll take a look at Jepler and FOMI guys code and talk to them a bit, see if they have any suggestions. They made full blown like really sophisticated MP3 players so mine is quite simple by comparison. All right, I think that is going to do it. Have I missed anything? It feels like the show. Thanks everyone for stopping by. I appreciate you hanging out and hanging out in the chat as well. Stop by tomorrow, Friday for a deep dive with FOMI guy we'll be back on Tuesday with my next JP's product pick of the week and then Wednesday, 3D hangouts, show and tell, ask an engineer, another one of these, another one of those and on it goes. So we couldn't do without you. Thank you everyone for stopping by, hanging out, supporting us and that's gonna do it. So I will see you next time. Bye bye.