 Welcome to the show. Thanks so much for stopping by here on John Park's workshop. I just got distracted because I noticed that where'd my lower third go? Hey, there's, hey, go get a logo. And the title of today's show, which I'm so excited about, which is going to be the Cat Piano MIDI Mod, also an update on the guitar pedal friendly line out mod on a different Cat Piano. It is just Cat Pianoville around here. I have so many Cat Pianos. In fact, I just realized with that lower third there, you can't see that Lars is just chilling with another Cat Piano. It's just Cat Pianos all the way down. I'm so excited about it. So what else have we got? I've got a coupon code for you today, so you can go buy some great stuff on the Adafruit shop and get yourself 10% off. I will reveal that soonly. I've got, what else, a little recap of the JP's product pick of the week from this past Tuesday, just a couple days ago. I've got a really snazzy circuit Python Parsec for you, featuring a brand new library from America's sweetheart, Todd Kurt. I've also got, what else? I don't know, let's just get to it, shall we? So first of all, I mentioned a coupon code. So if you head on over to this place right here, Adafruit.com, and you head to Products. You can see we've got the feature products, you've got the new products, you've got a bunch of categories there. If we head over to the new products, in fact, it's a bunch of cool stuff that just went up in the store. Rick H mentioned over in the YouTube chat Metro M7. I don't know, is that up? We had a handful of those available, I think. Oh, it says more info, yeah. So if you head over to that Metro M7, that thing is still baking, still in process, I think, but you can click on more info there and sign up to get an email when that's in stock. But anyway, if you find some stuff, new or old that you wanna get, and you wanna get yourself a nice discount on that, then use today's coupon code, which is cats meow, that will get you a nice 10% off discount. That coupon code should be good through to the end of the day, East Coast Time. Hey, David G, soonly, yeah, I don't think that's really a word, but it's fun. So yeah, head to the store, get yourself some stuff and get a nice discount with cats meow. That's good until midnight tonight, East Coast Time. Let's see, let me look at my notes. What else have I got going on? Free stuff, yeah, did you know also? If you had, let me go back to this window here. If you head to ateafruit.com slash free, that'll let you know what free deals there are for different order levels. So if you spend $99 or more, you get a free perma-proto, half-sized breadboard. I love these, I use them a lot. In fact, I've got one in today's project. I actually just had to place an order for some quarter-sized ones, because I think I'm out of those and those are great for certain things, as you'll see. If you spend $149 or more, you get the KB2040 keyboard. Hey, that's another funny coincidence. I'm using that in today's project too. You can get one for free if you spend more than $49 or more. For orders over $200, you can get UPS ground shipping in the continental United States for free. And if you spend $299 or more, you get a BBC micro bit, the two and the stack. So if you spend the full amount, you'll get all four of these perks. So that is our free stuff and you can layer the cat's meow coupon code on top of that to get yourself 10% off in the store. All right, when I say, I'm looking over at the chat, by the way, that's this place right here. That's our Discord. And if you are somewhere like Twitch and you're wondering where's everyone that seems to be chatting with the host of the show, they are very likely over here on our Discord. So you can get into adafru.it slash discord. There's a bunch of different channels there with a lot of stuff going on all the time. But the one you wanna look for during a live broadcast is the live broadcast chat channel. It's up near the top. It's one of the top ones up there. And that's where all these lovely people are hanging out, trading quips, answering questions, having a fun time. So head over there. I'm also keeping an eye over on the YouTube chat if you're there. I can see that chat as well. What else? So we also have a jobs board. And if you head over to jobs.adafruit.com, you can check out what's available. These are job openings across the whole makerverse, including a couple of jobs that are open at Adafruit right now. We've got a position for a junior bookkeeper and an employee resource assistant for benefits and payroll. Those are open positions. Those are in person. Most of the time there might be some offsite stay home days, but that is not a remote position and it's full-time. But you will find a lot of other job openings in the jobs board, which are remote, part-time, contract, freelance, full-time, but remote, telecommuting, all the different permutations are available there. You can post if you have a job opening, go to jobs.adafruit.com. You can post the job opening that will get vetted by Lady Ada and Mrs. and Mr. Lady Ada, but not Baby Ada because babies have poor judgment. But those are all vetted positions. So you can trust them, head on over there and look for some work in it also. You can also post your resume if you're looking for work in that available for higher section that you see up there. So that's jobs.adafruit.com. Why don't you go check it out? I don't know, just do it. Someone asked, I wonder how many different coupon codes Ada Fruit has produced, maybe a hundred a year? Yeah, you know what? We do a new coupon code every week for at least three of the shows, three hangouts, this workshop show, and Ask an Engineer. I'm not sure if there's a coupon code on any of the other shows, but yeah, so that's easily 150 or so a year just from those shows because they're different ones every week. All right, so I've got this show on Tuesdays. Oh, I got a fleck of something on my shirt too. I've got this show on Tuesdays. You can see the logo right there. That's JP's product pick of the week. During the show, I like to show you something new in the store. Sometimes it's not new, but this week it was a fairly new and updated one. Give you the low down on it, show you some demos and give you a deep, deep discount. This is a case where no coupon code is necessary. We just cut the price, often in half, let you buy them right there during the show. The show appears inside of the product page, so I just give you a chance to head over there if you wanna watch the show from the product page and throw some stuff in your cart. And I like to do a little one minute recap of the show. This is what the show looked like this week with this really cool little boost converter. And here's the little recap. The mini boost, five volt at one amp. Let's see here, I've got a two AA battery pack. And right here I have a Metro mini. So any of your AVR boards, if you're trying to run Arduino Uno or this little Metro mini, those really want five to nine to 12 volts in. I've got my mini boost and it is receiving this roughly three volts from the battery. So that's on its in and then on its five volt out, I'm driving the Metro mini there. And then I have a Neopixel ring here. This is plugged into five volts on the Metro mini as well and it's getting data over IO pin. So this is great. You've also got the enable pin on there. So if you wanna use a power switch, an on-off switch, if I flip this on, you'll see I've got my LED ring there with the full five volts that it wants, boosted up from the three that it was initially gonna give us off of that battery. The mini boost five volt one amp. Yes indeed, that was it. And coincidentally, I may also end up using one of those in today's project. If I go with a battery powered option on it, because it's a, one of the things we'll be looking at is another Miauzik Cat Piano Mod. Of course it is. So by the way, I also found out there is another instrument made by this company that is dog-based and it's not a piano. So if I can get my hands on a couple of those, maybe that'll make an appearance as well. They're killing it. B Real Toys or B Toys, something like that. All right, so, hey, what else? Next up, oh, let me answer this question. Rick H asks over in the YouTube, what is the Discord server name? So the server name is Adafruit. This is it, right here. Whoa, I just, sorry, I clicked on the wrong thing and made it really huge. Let me try to, oh my gosh, the whole world is now just this one Discord chat. Let me try that again. Woo, all right, move that back there. So our server name is Adafruit. Adafruit.it slash Discord is a link that we have up on our blog that'll get you there, get you the invite and head you over to the server. If someone who's actually don't know inside of Discord, if you're looking for it, if you can go to a sort of global search and just look for Adafruit, you should be able to. And then yeah, this channel name is the live broadcast chat channel. And in fact, let me, I'm just gonna open up that cropping on that window for a second so you can see there these channels that I'm always talking about. So here you can see, this is the Adafruit Discord. There's a name there. That should be what you need, right? I don't know if there's a URL for that that's not obvious, but I'm guessing it's just Discord Adafruit. And then you can see the channel. So we've got some welcome and code of conduct announcements and then general chat, the live broadcast announce, which will let you know if live broadcasts are happening. And then there's this one, the live broadcast chat channel. That's the one that's generally most active during a show. And then you can see we have a lot of general stuff like pet photos, we have a bunch of these help with channels. So if you have questions in a certain specific area like audio or radio or Arduino stuff, Circuit Python, those are great channels. A lot of the developers for Circuit Python hang out in this one, Circuit Python Dev. So if you're working on core stuff, libraries and so on, that's a good place to hang out and on and on. So we've got a bunch of channels there, but this one right now is the live broadcast chat channel. Good question, Rick H. Thanks for asking and Tackle the World. Thank you for also adding in there. Yes, live broadcast chat is the channel you'll be looking for. Windows Clip, so you can't see, oh, did I never? Sorry, thank you. I forgot to actually push. I have to actively push that change. There you go. Making everything I just said make more sense, I hope. You can see those there. Yeah, so that's the list of channels that we have. Scroll through there, you'll see it goes on and on and on and on. You can also fold some of these down if you're wanting to hide them, I think. Topics, oh, that's weird, it didn't fold them. It folded one of them. I don't know why that is. The keyboards one is the only one that folds. Freaky. Oh yeah, so thanks, Katni, for mentioning. DJ Devon 3 was trying to add a link, but our robot moderators and human moderators try to prevent links from going up in here because it can lead to a bunch of spam. Okay, so that's enough on the Discord, but keep hanging out there. I'm not saying I'm done with it or anything, just I'll stop yacking about it. And instead, let's get into a super cool, I think, Circuit Python Parsec. Here we go, for the Circuit Python Parsec today, I wanted to show you how you can use the noise library. So the noise library is an implementation of two-dimensional Perlin noise, which has its roots in computer graphics going back into the 80s. But it's a really great noise function that gives you smooth transitions, as you can see from this image here, here's an image of some Perlin noise, smooth transitions between values. And so that's something that we can use all over the place. I'm gonna show you a demonstration using both some ASCII art in my console, as well as a NeoPixel. So if you look here, I've got a little QT Pi, and it's got a NeoPixel on there that I'm gonna diffuse with a little bit of acrylic. And I'm gonna go ahead and just restart the code here. And what you'll see is a smooth flow of values that are running from negative one all the way up to one, and sometimes not making it to the end, sometimes hanging out in certain areas, but always a smooth transition rather than random jumps. And you can see the effect on the LED there is that we get these nice glowing undulations that are different from a flicker. We don't have that sort of randomness of sudden on or off and bright jumping. It's always gonna transition smoothly, which is really cool. The ASCII art isn't gonna look so good on this video, I know, but if you try this demo out, and we'll have a link to the code, you'll get a really nice flow of these little asterisks, and then I also have the values that I'm translating those to for the NeoPixels. So the way this works is, I've imported the noise library, and that's something you can add using SIRCUP. So SIRCUP install noise, we'll grab it from the community bundle. And then I am taking the noise value in my main loop here, I've got some notes here. Noise is a 2D map that has x, y coordinates. What we're gonna do is just traverse a line just on the x-axis, and you can see in that little image I put a green arrow on there. So essentially we're moving across this thing, and we're grabbing values that are gonna be anywhere from a negative one to a positive one underneath that point in the line as we increase i, or in this case, noise value, which equals noise, and then the x times, and I'm making it move sort of slowly through there. So x times 0.02, and then y I'm leaving alone. Then I also remap that. So I'm using the map range function to turn that negative one to one that we'll get into zero to 255, which is what I'll raise and lower my RGB values on the NeoPixel. And then I set the NeoPixel to those values. Then I'm also doing all this print stuff. And then I'm incrementing x by one. So that means we're just gonna travel forever on this endless 2D noise pattern, which gives us this really nice glowing effect on the LED as well as these sweeping pixels. And so that's how you can use the noise library to make really beautiful transitions in values. And that is your circuit Python Parsec. Yes, circuit parsec. And I saw a note from David G. He said, I hear no noise, which you know sends me into a panic because that makes me always worry that my audio is stopped working. But I think you're just saying, yeah, we're not doing any audio noise from this. We're doing sort of visual noise in adjusting the asterisks, which is really just mapping the value to a number of spaces in that print statement. And then we also have the nice noise of the values on these RGB LEDs. By the way, you can also set those to be just on a single color if you want. If I do something like this, you'll see I can just glow and undulate and pulse that red diode on the RGB LED. And this, by the way, Todd wanted to make sure that I made it clear was an implementation. He implemented the existing code of the Perlin noise in a circuit Python library. It's not an algorithm he created from scratch. So just to give credit where credit's due. If you want, look up the Wikipedia entry for Perlin noise. It'll tell you about Ken Perlin and the creation of this use on Tron and then throughout computer graphics in my whole career in computer graphics, the essentially the default noise pattern that you would use for things like materials and texture maps and effects was variations on Perlin noise. Super, super useful. All right. So let me stop that thing from updating. By the way, oh, so let me show you in the chat. So if you're wondering where to get the code for this, I'll include a link when I post the repost of the one minute excerpt or the two minute ish excerpt of the circuit Python parsec on YouTube and a blog post. But you can see there, Todd thinks he posted a link both to the article on the Perlin noise or simplex noise and the GitHub repository for grabbing the library and the code example that I showed there. And then I just added the LED code to it. But Todd's example will show you the Asterix dancing in your console there. All right, so let's see, what's this get us to? I wanted to give an update actually. So I'll jump over to the bench cam now. And I wanted to give you an update on the NES emulator that uses Pico that I've been building. So let me hit over there. I'm also gonna actually increase the exposure here a little bit. Oh, I know what's up. My main light is not on over there. Let me grab that remote. Oh, you know what? I moved that light somewhere and took the remote with it. So I'm gonna do it the old fashioned way and walk over and turn it on. I may need to grab the diffuser for this too. Yeah, whoo, turn that down. One second. This is the problem when your studio lights are also your location lights. It's time to get to move ground. Just throwing a little diffuser in front of it. Okay, that'll be a little better. So let's see, if I turn on some lights, I may not need to adjust that camera. No, that's good. Okay, there is light. So this is where this started, which is the Pico, the DVI breakout, and the SD card reader, as well as a little enable switch. And the code, which was from Frank Codemakers, it's pico-info-ness plus is the emulator. Sorry, I know that that's too tiny to read. Initially this used a USB game pad and it was limited pretty much to a PlayStation DualShock 4 or DualSense from the PlayStation 5. Expensive controllers, so I wanted to see if we could get something generic. That's actually kind of hard to do. Phil B tried to work on making generic USB game pads work and ran into some issues with it. Also, I noticed there was a bit of input lag with USB. I noticed that mostly once we switched to using a proper NES controller. Again, Phil B added the code to this emulator, this Pico emulator, so that we can use the shift register style of a original or clone NES controller and the SNES controller, which actually is compatible with it. So I had grafted this on, used Phil's code. Phil's code got released into the mainline of the emulator. So now you can use either USB or NES type of control. You can actually have them both plugged in at the same time, which is kind of wild. And this is a Nintendo emulator. The ROMs go on our little SD card and the DVI output in the shape of an HDMI plug sends video and audio to your television set. So after this worked, I made a revision on the board and I think I showed this on the show. This is what the revised board looks like. So you can see mostly I just added three little sections here, which are this NES controller port, which is what one of those there looks like. This is a right angle one that mounts right on the board, has some nice plastic standoffs that sort of snap in there, as well as an SNES controller, which you can see right there, that type of port also found some 90 degree angle ones, just on AliExpress. And then I also added a breakout for header pins in case you wanted to experiment and try other stuff. So that breaks out the pins that are on the Pico that are being used for these shift register style controllers. I also put some pixel art there. Please don't sue me. And I put one together and it works. So I actually, we'll take this apart a bit, but I realized since I had put some neat art I wanted to see and I didn't have a case for it, I could just screw the exact same board on as its own case. So if you order, you know, you can't order fewer than five of these. So you could have two and a half of these that actually make their own case if you want. And I put some rubber bumper feet on the bottom there. So I wanted to show it in action. So I can plug the NES controller right in there like that. I'm gonna give it power, which I'm just using a USB power bank, but it could be any USB power supply is how I have this configured to work. And put this in the off position. So the power is just powering the Pico. And then we've got USB. And you know what, I'm just gonna open up my chat because I'm always, wanna make sure that there aren't any questions or emergencies with my audio in particular. Okay, so now I've got a USB cable that's gonna plug into the DVI port plus audio. And then I could plug this into a regular old LCD panel and I probably should because it's much brighter, but I do have a little cheap converter that'll take HDMI and go out to composite, which will work with this little JVC-CRT. So I'm gonna go through this little converter. I'm gonna see if I can switch to this view. Oh, that blocks it entirely. So hold on, let me move a window for you. I would love to have brought a bigger TV over, but that's a pain in the neck. So this one at least can go on a camera stand or a lighting stand. Okay, so this is on, this is on. I'll turn on the little enable switch there. And you can see it's gonna negotiate the video resolution and NTSC. You'll see a big bar running through it, which is just a mismatch between refresh rate and camera shutter, but you can at least see if I launch a good old Super Mario here. We should get audio as well. It says just a little speaker in it. So yeah, definitely, it's harder for me to show it here than just playing it, but I definitely found that we have less lag for the controller input with this little version of it that uses a proper Nintendo controller versus the USB, which is nice. I'm not playing well enough to make any of that seem true, but it's, I'm probably getting a little bit of lag from the HDMI converter there. In fact, you know, I've shown this enough so I don't need to plug it in somewhere else. You'll just see an NES game getting played. But the more exciting part, honestly, is just this. The fact that we've now got, pause this, now got the NES controller working with it. Nice, neat kind of assembly of the board there, let me pull off the top PCB there. Hey, Tyeth, love to hear that old tune, absolutely. Yeah, I wish during pause it would keep the song playing. That would be kind of nice. I can't remember. I think the attract loop is muted on it. So let me zoom in a little closer there. And there you can see it, it's running still, it's live. And so now we've got our NES plug. I can't remember if this, I think this does not mind if I go ahead and hot plug. I could be totally wrong though. I think I tried this and at least didn't ruin it. So I'll hot plug in a SNES controller there. Yep, just in time to get killed. But yeah, so now I actually have both plugged in, which I think it kind of doesn't mind. You could get real creative and actually do two player left hand direction, right hand jumping. Let's try that. If you're real lazy and don't want to keep your hands together and have them slack because you're lying on the sofa or something like that. Let's try it. This should work. Get these in camera view. Oh, nope. Let me see if I gotta restart it. Let's try powering it on while both are plugged in. Oh no. No, I'm totally wrong. It doesn't work. Huh. I wonder why it selected the SNES pad. They're both plugged in the exact same thing. Okay, so probably I shouldn't be doing this. So I could unplug that. I did get it working. I mean, it does work if you have USB controller and one of the SNES or NES controllers that'll work. Oh, by the way, I found out, I think in the UK, SNES is the shorthand for Super Nintendo Entertainment System, SNES. So another question here from David G. The emulator does not support two player, yes or no? I don't know. I don't know if it does. If it did in the original, it would have had to have been through some sort of like on the go hub. And I don't think it did. I think this particular emulator, maybe in the Linux version, but my suspicion is when this got reworked to run on the Pico, that it was single player only. Someone can correct me if they know, but I suspect that this was single player only. And these are not configured as two different ports. So in code, that's something that I didn't even ask Philby to look at. So I don't know what the difference is. I'm assuming you just need a whole separate set of what clock, latch, and data pins for the second controller port for that to work. So none of that is configured. So this is really not a two player machine. That would be cool, though. So maybe something to look into. But anyway, yeah, that's the board. And you can see I didn't solder on any headers for the little breakout, but that's just exactly the same ground, power, and clock, latch, and data that the controller ports use. And I did, since the specification on both of these has two other pins, I did run those to open pins in case we want to try to add functionality later. I believe what those are used for are things like the joystick controller, maybe Rob, the robot, and maybe some others use two other data pins for what they call special joystick functions or special gamepad functions. But I don't know a lot about it. Anyway, that's this. I'm gonna put this board up on the GitHub for the project. So that's fhodemakers slash pico-info-ness plus. I'll put that link up in the Discord after the show unless someone wants to throw it up there now. But that's got Phil B's code in it that allows us to use the NES controllers. And then I'll put the board Gerber files up there so that if anyone wants to make some, they can. All right, so that's that project. Let me head over here and get set up for the next stuff and see if anyone's got other questions or thoughts before we move on. Needs more Zelda. Yeah, I don't have a Zelda on there. That's a good idea. I did actually on the green board there, that. I mean, it's on the SD card so I could pop it over into there. Yes. Okay, so let's see. Next up, we'll dive into some cat piano, meowsic stuff. But before I forget, you know what? Since I said cat piano, let me remind you, if you wanna buy some stuff in the store today, you can head over to Adafruit.com, go to the products page, it's the main page, you'll get to chuck some stuff in the cart, maybe just at random or maybe specific things you want. I don't know how you live your life. I'm not gonna tell you how to do that, but if you wanna get 10% off, type cat's meow into the coupon code box at the end on checkout, you'll get 10% off. So cat pianos. Last week, I had pulled apart one of the little, one of these guys, one of these little cat pianos, grab one for reference. And this was modification number one and what I'm planning to do actually is, I think a couple of different guides that will cover these sort of two main scenarios. So cat piano here by default, if we turn it on, all right, we can play. Cat noises, songs that are built into it, some percussion stuff, speak into this microphone except I cut the wire on that because we're getting tons of feedback. When we do the other thing, and that's what I did last week was add a line level output for guitar pedals and guitar amps and that whole sort of ecosystem plays well with other music gear for sure. You can run it through other stuff as long as you have ways of gaining things up to the proper levels, into Euro rack or semi-modular or other synth stuff or audio interfaces to put it onto your computer and run it through Ableton. Any of those kinds of things are possible. On this, I was using a quarter inch switch, Kraft guitar plug jack, guitar jack. And after the show, I went and mounted that. So I've got a level for that. I've got the output that we plugged guitar into and I mounted the stomp switch there so that you don't have to stomp it. You can use your fingers. It's actually a not very hard to press one but any sort of single pole, single throw switch, SPD single pole dual throw switch would work for that. A switch, not momentary. A Hanoff switch would work for switching between onboard speaker versus line out and then I showed how to solder all that stuff up. Last week, I just wanted to show you that I've now got it nicely mounted. I found some nice spaces in there that that stuff works and with this particular, there we go, this particular knob that I've got on there. It's kind of classic knob. It's like a jaunty little fascinator for the cat, cute little cat, tiny cat hat, right? So that's meowsic number one. I won't play this one through amps and stuff today. We did a bit of that last week. I'm gonna get, I'll do a demo video of it going through like a reverb and a delay so it sounds extra lush and fun. So that's the first way. So what I wanted to do though is leave that one alone because that one uses the built-in sound engine, the synthesis engine on a chip that's in the cat piano and just lets us get a nice clean output to do other stuff with. But what I got curious about was could I tap into the keyboard matrix that the keys run to the little board and just hijack that so that I could turn it into my own MIDI keyboard? So what I wanna do is show you how that process went and the results of where I'm at and some demonstrations and stuff. So let me head back over to the bench here and I'm gonna just fix one of these camera guys here. All right, so for this one, say goodbye to the Nest here and turn off this TV too and unplug that, let's set this over here in the Nest stuff corner and Liz says, is this tapping into the matrix or clawing into it? It's definitely clawing our way into the cat piano matrix. That's for sure. So let me set one more controller over there. Okay, so here is a fresh cat piano. I'll zoom out a little bit more there and this one just arrived from Target. In fact, my wife was out of Target and she said, hey, they have four more of those cat pianos. Do you need some? I said, actually, yeah, I could use two more. Whoops, so these are the many, many screws that hold the case on in the back and it's actually a good idea to have two containers just to keep some sanity because there's one size of screw used for all of the case back. So all of those are the same size screw, thankfully. And then there's a couple different sizes of screws on the inside, but it's kind of obvious which they are. So, but this is my first time opening this one up. So it shouldn't be any surprises. Okay, yeah, that's pretty much exactly how the other ones have been. And so what we have is battery, four AA battery pack there and they run a couple diodes right here, I guess to prevent a short circuit if you put them in backwards. So they just put two, presumably like shot key diodes or something right there on the inline with that wire that goes to the battery pack. And what I'll do is I'm just gonna lift off, they have some of this tape that they use to make assembly easier so that cables don't get pinched, wires don't get pinched. I'm gonna remove those just so that I can kind of fold up the bottom underneath it a little bit better just to get part of it out of the way there and make this more compact. Okay, so now what we get is the billion other screws on the inside to deal with, but what I wanna do is talk about the keyboard matrix, how it works. I'm actually gonna pull this one fully apart so that we can see it. And then I'll show you the other one where I've actually done the assembly to make it work as a MIDI controller. So let's see if this bit is small enough to at least let me quickly, nope. We get, this is gonna be the unscrewing montage here that will happen at normal non-montage rates. So what I'm gonna take out are just the keyboard mounting screws. And what we'll find is the same sort of elastomer button pad, just like a rubber dome keyboard or a video game controller, the inside of the CNC, they all use the same sort of switch which is a PCB that has copper traces that are sort of fingers that are near each other and that's representing two sides of the contact that's open and then the rubber dome has a conductive pill on the bottom of it that when it gets pressed down, it reduces that resistance enough to close that circuit, short that circuit. One of the interesting things I noted is that if you look at the ribbon cables, you can see there's kind of these three ribbon cables, four ribbon cables here. There's a bunch of buttons on the front of this. All of these, you can see them right here. All of these buttons and volume knobs and stop button, the tempo, the voice selection, all of those are running on one, I think. I haven't figured out these guys down here yet, but all of these buttons here, just like four or five buttons here, they're all in the same matrix as the keyboard itself. And so if you look at this ribbon cable here, that's what actually takes all of the five buttons right here and brings those to the keyboards, keyswitch, PCB, and then runs that down to the main board. So the main board is actually just getting from the keyswitches, these two ribbon cables, but some of that is actually being shared by these buttons down here, and then same with this little one off to the side. So this little one off to the side, I'm not using those or these onboard buttons I'm not using. So let's see, that should be that. So I'm going to remove more tape. I kind of like this. This is like the world's thinnest packing tape. I kind of like this stuff. I should figure out what it's actually called and get some, but it's a really thin non-residue leaving behind, doesn't leave much residue behind tape. Okay, so the reason there were so many screws on that was just all of the force of a intended user, typically kid banging on the keys is being applied to this. So this has a lot of screws to hold it in place. It's a pretty strong but slightly flexible plastic to deal with that abuse. And the, let me see if I can get it out without removing the main board here. And then we'll see if I can flip it upside down because what we want to get to is what those plastic keys are hitting when they kind of lever up. So pressing those keys kind of makes them lever. Okay, so I will have to take out these button boards that are for the stop button and the two little song buttons. So there's like three and two screws each, holding those and just get those out. So far, these have all been the same screw. I think it just gets different. The speaker screws have a much wider diameter head. So those ones are easier to keep track. And then I think there were three little super short screws in another place. I took photos of these as I went so I think I can get them assembled properly on the way back, it's kind of a crucial step there. Okay, just one more. Thanks for your patience with all the unscrewing. David G said the shop, the target where I've been getting, they're gonna think that there's a huge increase in this market for this product and get boatloads more. Fine, if they will keep selling them, I'll keep buying them. Oh, those are shorter. Okay, yeah, I'll keep that in mind. I think some of those little button ones, you can see they have sort of smaller little bosses that they screw into. Okay, so this should allow me now to flip this upside down and zoom the camera in a little bit. Okay. So you can see here, there's this strip of elastomer. And I can pull that off. It actually is pressed in with these little stepped nubs here. Those just get pulled through to the other side. So you can put it back on and get it exactly right just by pulling those back through. So those are little elastomer domes. They're springy, they press in return. And they have a little black conductive pill at the bottom, which is what makes the contact on all of these little pairs of traces, these little sort of fingered pairs of traces. So often you'll see these circular, these happen to be rectangular, doesn't really matter. And so these are labeled on here, S123 up through 28. So those are the, I presume there's 28 keys on this. So those are all the keys. When any of these keys get pressed, you can see they lever up and they have a little cross shaped post, which is what contacts that rubber dome to press that to make it press the elastomer down and close the contact. And if we look here, here's an example of, here's one switch off to the side, which was one of those play a song switches. That is also part of this matrix. And I can see here the buttons coming from under the speaker side, there's the piano bells, meow organ and banjo buttons. Those are also taking place in this matrix party here. They're labeled with pin numbers, which some of them are actually overlapping. This is a P zero and this is a P zero. But if I look at these two here, this one actually had to remove the hot glue on these because I desoldered these two cables to plug them into my KB 2040. The pin numbers were, I think obscured by the hot glue, so you can't see them on here. Is that right? Yeah. But these are P zero, one, two, three, four, five, six, seven. And then these are connected to the board right here. So that's our first matrix and actually it's labeled here, same thing. P, oh that's funny, these are not the same numbers on it. So there's a mismatch there. I don't know if that's the same with the one I just did, but yeah. So this is a row of eight and this is a column of six or vice versa, I forget which one it is. What I think is that there's actually two more unique wires from the side here. And so this is my suspicion kind of hoping that it's an eight by eight matrix, which will make life easy. So I'm gonna check which are the unique lines here with just a continuity tester, just checking each of these points and each of these. And if I find two, I'm gonna plug those in as the other two columns and see if that allows me to pick up those buttons, button presses as well. But what I did on the one that I've grafted into MIDI over here is I essentially just used these ribbon cables, actually desoldered those and put my own. But you really just, you could cut and reuse these ribbon cables to get a set of eight pins for column and six pins for row or vice versa. And that'll get you to exactly where I am right now. So I'm gonna move this one out of the way and let's take a look at the one I have performed that surgery on. I've got to find a way to tell this phone to step, fall asleep, hold on one second. Where is that energy setting? Hold on, here let's do a camera change just for fun. Settings, display and brightness, auto lock, never. Okay, now I can keep an eye on the discord. I need to get that iPad back that I had over here. I don't know where that one went. Actually I do. So, discord, there we are. Oh, that's cool. Here's the Pepe. He's Pepe? He's some sort of crocodile or something? Yeah, it looks like the same exact keyboard though as far as functions and stuff just doesn't have the microphone, which is fine, I don't like the microphone. So here is one that I have made that surgery to. So what you'll see, let me plug some things here, is I have a little more room here now. Oh, it's on so it's little drums just started. So what I have here is, remember I said I just cut those two six and eight conductor ribbon cables and ran my own so I've got eight conductors here that are running from pins two, three, four, five, six, seven and eight and nine. Is that right? Is that eight? And then around the other side here, I've just gone into the SPI pins and just I'm using them as regular GPIO pins. So like MISO, MOSI, CLOCK, A0, A1. Is that right? Is that six? And D10 I think is the very first one. So we've got six there. I suspect I'm gonna end up going to A1 and A2 with two of the lines from here. And ignoring everything else on it, ignore the resistor here, resistor here, this other wire with just this setup, what I have is USB MIDI capability. So using the keypad library, and I can show the code in a second, using the keypad library, I can read those as a set of column pins and a set of row pins. And the keypad library is fantastic. If you happen to get the order right, which I think all I had to do is switch row and column to column and row. Once I got that, it just works. So these identify themselves as key zero, one, two, three, four, five, up to 27. When I press them, since these are shared, I also get these three buttons here and these four buttons here. So all of those come in as unique button presses. And then I can just simply map those to MIDI notes to send out. In this configuration, ignoring the extra circuit there, that works for USB MIDI. What I decided to do this morning, and I had that working yesterday, I showed that on the show and tell last night. So if you wanna see me playing just a software synthesizer on the computer with that, that's what I did. That would also work great for an iPad. So if you use the little camera connector kit thing, USB on the go kind of thing for the Apple ecosystem, power and data of this going to the iPad. Now you have a USB, I haven't tested it. So there's always a chance it doesn't work because it's drawing more current and Apple gets mad. But there's a really good chance that I've done this with some other projects that you can plug this in and get your Apple iOS device to play any of the bazillion great synthesizers, free and paid synthesizers. Animug is a really good one that's usually free from Moog, Animug. So that is how I had that working last night for show and tell. What I did since then is I'm gonna go ahead and close this back up here so we can demo this. I looked at Liz Clark, Blue City DIY, has the excellent MIDI for Makers article and I always have to, or learn guide, I always have to reference that to remember the right way to hook up a UART TRS MIDI output, which is what I've done here. So this is a stereo 3.5 millimeter jack. I have the tip, ring and sleeve. I color coded them red, green, blue just cause I think of those in an order. So red, green, blue are my tip, ring and sleeve. Tip goes through a small resistor, I think 12 ohm or something like that to the three volt power supply on the KB2040. Ring is the UART TX line. So that's actually sending the MIDI data, the MIDI messages and then sleeve is going to ground there. So with that, I can now plug in either one of these kind of adapters and get to full DIN5 MIDI, which is excellent, great. Sometimes you may need to futz around with USB-A type A or type, rather, sorry, TRS type A or TRS type B MIDI. I've been using type A now cause it really has finally been sort of standardized by the MIDI consortium. So type A, you can get converters, I built a converter that lets me sort of swap A and B if you need to. But a lot of devices now, like my little nano box here use the 3.5 millimeter TRS cable and can auto switch. So I think this one can detect A or B and just do the right thing. So you can't lose there. So if I plug power into my KB2040 now, that means that we're now gonna be reading this key matrix and it means that I'll be sending out the TRS MIDI to this little synthesizer here. This is a little nano box from 1010. It's actually also sending USB MIDI. So if I just plugged this only into USB and I'm actually just having it send both. So much, much, much cooler sounds than a stock meow out of the cat piano. This thing is kind of an endlessly fascinating wavetable synthesizer. It can be polyphonic. That sound doesn't really sound great polyphonic. Let's find something that is. Any pad? New age memory, that'll probably sound good with chords. Ooh, that's not what I expected at all. That's not new age sounding to me. Let's see, how about Buzz Organ? Woo! That is a dissonant organ. It also didn't have any reverb on it. This thing has reverb built in, so drama for nothing. All right, how's this? By the way, how's the level on that? Can you hear that? Like I said, these buttons here, I can read them. They just show up as my button presses. I'm not doing anything special with them, not filtering and saying, hey, let's do something different with them. So right now they'll act like other notes. That one's real high. I think that's what makes me suspect that these are the missing buttons that are not in that eight rows or eight columns that I'm not picking up yet. They're not, those are not connected. But I don't have to use those as notes. So what I may do is actually say, okay, if key event 28 or whatever this shows up as comes in, don't use that for sending a MIDI note. Use that for sending maybe a MIDI program change, which means I could have bank select, so I could pick between like five different sounds on the MIDI synthesizer, MIDI controlled synthesizer, so long as it has, accepts those kinds of messages, program change messages. You could also send CC. A lot of CC wants to be a knob and nothing on here is a knob, but some things you could make a CC essentially on-off zero to 127 with some of these. So the sky's the limit, really. You could code this little KB2040. This is all in circuit Python, by the way. Code that to accept MIDI or rather button presses and do whatever you want. They don't all have to be MIDI. So that's kind of where I'm headed with that software-wise. My next step is just gonna be see, can I get these also? Right now, the funny thing is, I didn't do anything other than disconnect those two sets of ribbon cables. So that means when I power this on, the guts of this are sort of an independent other thing. So I'm playing MIDI over here, but I'm playing the silly little, if you combine the two hacks, then we could do a line-out and you could actually hear that terrible little drum coming out and put it through some effects. But I think I'm gonna wipe all that out. I don't really have a plan for the microphone. Actually, that's still hooked up, so you can do some little feedback. That's the terrible, terrible microphone. So feedback is possible with that. And now with these little, this is a nice little, I forgot the nut for it in the house, but this is a nice little threaded TRS 3.5 millimeter connector, which means I can drill a little hole somewhere, maybe in the ear or something like that and add the MIDI output. If this were to be a pure TRS classic serial MIDI keyboard, then I could run the KB2040 off of the batteries in here, maybe go through that little mini boost again, maybe steal the use of this on-off switch, and then it's just a self-contained battery-powered MIDI keyboard that costs $30 plus another like $15 in parts or something like that, which is great, and it's unique looking. If I wanna also allow the capability of USB MIDI, then I'm gonna need to put probably a USB-C port on here somewhere or a different USB type and some adapting on the inside, so I'm not sure yet. I have one of the little, we have the DIY USB and HDMI cables and connectors in the store. This is one that I have USB or rather a MIDI on right now, but you can see these are these nice little PCB boards and ribbon gates, so if I internally need to do a little bit of adapting, these are kind of a nice way to go. Also the KB2040 is pretty unique in that it has, let me pull this off the board. I put some headers on here just so I could take this off and use this sort of breadboard-ish, sort of perma-proto-ish. Oh, there's the snoring. That's the terrifying after like two or three minutes of not using it is snores and go to sleep, and that happened to me when I had it plugged into a delay pedal and an amplifier and all of a sudden this, that sounds like it's freaking me out. If you take a look at the bottom side of, no it's actually right here on the top, there's the D minus and D plus, and then we have raw and ground. So if you jumper raw, which I actually do have jumpered here, you could power this and send data over four wires instead of a real USB cable. So that means whatever your solution to adding like a panel mount thing, you no longer, I always hate this on the inside of a project and you've got a full blown, I mean it takes up quite a bit of space and you're always trying to like route these things. So you could literally hack this off and just solder those four wires here on the inside if you wanted to make this something that just had like a little cat tail and it's not a removable USB cable, it's just kind of a permanent one that might be a fun way to do that. So KB2040 really great for these kinds of MIDI projects. It's not just for keyboards or mechanical typing keyboards. So let's see, I think that's it. I think that's where that's going. Like I said, I'm gonna put together a couple guides so you can do the guitar line out version and use the built-in sounds or the full blown. This is now my MIDI keyboard that I can do anything I want with it version. So I still have two others. I don't know if those are gonna get different treatments. I could circuit bend one. That might be kind of fun to just warp the heck out of the existing sounds. But we'll see. There's always more cat pianos, more musics. Ooh, Sea Grover, nice idea. Put an accelerometer inside the microphone for variable CCs. I love that. That's really smart. That's really good. Yeah, because the microphone cable is two wires. So we might be able to get some data from that out to the KB2040. I probably need more than three, right? Or more than two, I probably need three lines. Yeah, or four for I squared C. But yeah, interesting. I could just replace that cable too. Let me know other ideas. Yeah, there's USB panel mounts. We do have some USB-C panel mounts about that big so I could put a nice three-quarter inch or inch hole in the top of it, pop that in there and you can just plug in USB. That's the nicer way to go probably than a permanent cable. David G asks if, I wonder if TRS MIDI is something from the 80s. Hint, there's a retro computer joke, TRS-80. Indeed. I had a TRS-80 model one and model three as the first two computers in our house. Actually, I'm fond of them. I don't have any now. Unlike Ann, I am not collecting retro computers. I'm collecting a bunch of CRTs for some reason, but I'm trying to stay away from. Yeah, Liz says TRS MIDI is the rudest MIDI. It is the rudest MIDI. So rude. At least there's not a third type that puts the sleeve on the tip or something. At least they limited the number of permutations, right? All right, well, I think that's gonna do it. Is that everything for today? Just to mention again, if you wanna go get some stuff in the store and get a discount, 10% off with Kat's Meow, head on over there and pick up some cool stuff and also remember we got some free giveaways with different price points, 99, 149, 200, and I think 3299, you get free stuff in the store. Yeah, David G says now we need the RP2040 to make the sound and be a synth. I think Todd Kurt has a Pico doing that with the RP2040, right? You're doing, if you're in the chat, Todd, let us know. I think you have some onboard synthesis happening now. So not just sending MIDI, but actually being its own synth, which would be cool. All right, well, that's gonna do it. Thanks everyone for stopping by today. I hope you have an excellent Friday and weekend and we will be doing, I believe a deep dive. There should be a Tim Fome Guy deep dive tomorrow. And I'm not sure if there are other deep dives. Scott, I'm not sure if he's up to his hijinks yet. I'll be back with another product pick of the week on Tuesday. We'll have 3D Hangouts on Wednesday plus show and tell. Come on by and ask an engineer and then I'll be back with a workshop show and I'll probably have this thing buttoned up so I'll be able to show you some of the other functionality. Hopefully I've figured out the rest of that keyboard matrix there. Oh, and I'll show you the code for it. I forgot I was gonna show you it and I didn't this week so I'll show you that next week. All right, thanks everyone for stopping by. Freight of Fruit Industries, I'm John Park. This has been John Park's Workshop. Goodbye.