 Hello, and welcome to the show. It's me, John Park, and it's time for another episode of John Park's Workshop, which is why I'm here, and this is my workshop, where I'm at. Hey, Dave Odessa over in the YouTube chat, and hello to all the people over in our Discord, Andy Calloway, Lawrence Jim Hendrickson, with Citi DOA, hey Liz, Andy Calloway, Mike P, Rich Sad, nice to see you all. If you are watching this over on Twitch, or LinkedIn Periscope, that probably doesn't still exist. BlipTV, that's long gone. But any of those other places where I'm not looking at the chat, then you might wanna head over to our Discord server. It's at adafru.it slash discord, and you'll get a free instant invite. You can then head on over to our live broadcast chat channel, which looks just like that right there, and there are people waving and saying hi and throwing up emojis, et cetera. So that's the place to be. Hey, Bizarro builds over in YouTube. I do keep an eye on the YouTube as well. Liz, that's a very nice compliment. Thank you, you enjoy the beginning synth jam for JP's workshop. That was something I wrote on a little Norns script. Norns slash monome, fates, generative Raspberry Pi-based thingy. And I enjoy playing that and hearing it, so thank you. Let's see, what else is new? We've got a job board over at jobs.adafruit.com. I implore you to go check it out if you're looking for work of any kind. If you head on over there, you will see a bunch of positions that are open, including someone who's looking for Matrix Portal Project Utilizing Wi-Fi Help. You are module for RP2040 and on and on. There was also this AV content coordinator gig at the New York Historical Society, sounds excellent. So go check that out. That's the search jobs section. You can also click up here on available for hire. And you'll see a bunch of people have posted their relevant info, CV, resume and so on and so forth. And it is entirely free to use, whether you're looking for work or looking to get hired, go check it out. That's jobs.adafruit.com. Let's see. Next thing I'll mention. Oh, hello, Johnny. Hello, Johnny Bergdahl. Nice to see you over there in the YouTube. We also have a show on Tuesdays that is that right there. JP's product pick of the week. That's the logo for it. That is this week's not disturbing thumbnail image for it. Trying to grab eyeballs over on YouTube. That's what we're all about. So many eyeballs, right? Before I jump into that, I'll say when I posted that, I got comments from a couple of people that it looked like a queen album cover. There was a queen album. I think the last queen album that had four heads of the four band members stitched together. And look it up because it was done early enough that I was like, hey, this is not Photoshop. Photoshop was in about version one when that was done and it didn't even have layers. So I said, I bet that was done on a Quantel paint box and it was and look up a Quantel paint box if you haven't before. It was basically a main frame based application super high end, very expensive. Used a big Wacom tablet kind of thing to do very impressive compositing. Also used in video stuff a lot. I think with some of the commercials and Peter Gabriel videos and stuff for using the paint box later Flame and Flint I think also from the same company. Anyway, there's also Metallica album cover that looks like that someone told me so. But enough about that, let's talk about this product pick of the week. So on the Tuesday show, I pick a product. In this case, I picked two different products. It was a twofer in the sense that these go hand in hand. I like to show how you use it, do a little demo or two, show code examples or assembly or both. And you get a big, big discount during the show is 50% off both of those items. No coupon codes required. Just chuck it in your cart and off you go. And then I like to do a little one minute recap video and show it to you now. So here it is. A&O navigational scroll wheel rotary encoder and breakout board, clicky clicky. I have soldered a Itsy Bitsy RP2040 onto it. I can use the click wheel plugged into the iPhone and now I can go and choose, let's say, cover flow. Scroll back from MF Doom to Bartlebytes or that won't get us in trouble. I can click on that. So now I can click through, pick a song, hit play. And all I'm doing with this, let me kind of pause that, is using the controller as a USB HID device. Like sure, yeah, that's convenient because it's already in your pocket, but this, this is actually fun. A&O rotary encoder scroll wheel with navigation buttons and breakout PCB dual product picks of the week. Hey, there's my audio, yes indeed. That was the product pick, go check that out. By the way, I was wondering why is it called A&O? That is the product ID from Zippy. Zippy is the company that makes those and they make about, I don't know, six or seven different types of scroll wheels and lots of other stuff. Some are lighted, some have the navigation, some don't. And each of their little product lines has a three letter designator. That one happens to be the A&O. And that's all I have to say about that. So let's see what else. This is the time where I like to show a little tip and or trick in Circuit Python. It's called the Circuit Python Parsec. Here we go. The Circuit Python. All right, so for the Circuit Python Parsec today, I want to show how you can set the real time clock on a Circuit Python board using NTP. An NTP or national time protocol, is that it? Network time protocol server. So how to set the RTC clock using the network time protocol. And then you have a really accurate clock, which you can go and check on intervals when you're connected. But it's a really nice way to get any type of clock projects or projects that have to do things maybe with Adafruit IO that need a timestamp on them. This is a great way to do it. So first of all, you can see I've got some libraries to import time RTC for real time clock. This board that I'm running it on is an ESP32S2, which has a real time clock built onto the chip. Then I'm grabbing some network things, Socket Pool, Wi-Fi, the Adafruit NTP library, and then some supporting things to be able to display on this lovely little TFT. I've got a little time offset here, based on my time zone, that may vary. Then we're doing some network connection, grabbing my Wi-Fi info from the secrets.py file, and then turning on the Wi-Fi radio, connecting to our NTP server and grabbing the date time. So once that's been grabbed, I do a little bit of display setup, and then the real time clock has the time, and then it can tick forward and give us the proper time. So all I'm doing in my main loop, you can see here it is displaying and updating every second. I've got the date at the top and the time at the bottom with hours, minutes, seconds, and I'm also printing some of that stuff here in my serial output. Then the way we do that is set up some parsing of that local time that comes from initially the NTP server, and then it's on the real time clock into those sections, hours, minutes, seconds, and so on. I display that using the little text area update for the text and the text area for the date, so the clock is in one spot and the date is in the other. And then every second I display that. This timekeeping here doesn't affect the clock, it's just how often I'm changing the display, but internally it just keeps ticking. And so that is how you can set a really accurate real time clock using the NTP protocol, say that again. So that is how you can set the real time clock using the NTP protocol, last time. And so that is how you can set the RTC clock using the NTP protocol inside of CircuitPython, and that is your CircuitPython Parsec. Tick, tock, tick, tock. Okay, by the way, pro tip that I didn't follow. If you have trouble saying something twice, don't say it the same way, like flip the order of your words around because otherwise you can just keep boom, boom, boom, bouncing off of that tricky. What time is it? That's a really good question. I think it is 1.12 and 57 seconds here in California. So yes, enough about real time clocks, I'd say. So let's move on now. And by the way, if you're wondering about that code that happens to be mostly taken from, if you look at the top here, an example that's at docs.CircuitPython.org slash projects slash NTP and on and on. So if you just Google Adafruit NTP for CircuitPython, you'll get to the docs and this example is one of the docs in there. And also very conveniently, this was called to my attention by the excellent Todd Bot tips and tricks for CircuitPython page. So I will update our guide to include that. That's a great new tip. So thanks Todd for pointing that out. And thanks to Scott and gang, Brent maybe also, Dan, bunch of people who were interested in getting some accurate way to grab the time from an NTP server that won't go away, won't expire, no one will get mad at us. We have permission to use an Adafruit. If you look at the library, I'll show you where it's grabbing it from. All right. Let's go back to that view there. There we go. Okay. So for a project today, I actually last week, I showed some of my eight by eight NeoPixel implementation of the patchwork boy bi-directional MIDI sequencer, step sequencer, or a gate sequencer stuff, trigger sequencer stuff for VCB rack. Just a quick update. I'm not gonna do anything on it today actually. I said I was yesterday and then I changed my mind. I have some work to do to add support for the NRF 52, not the NRF, the RP2040 feather, which I fit into there. One thing I'm excited about though, if you look there with any of the feathers that have a Stema QT slot on it, you can get one of our JST SH to JSTPH Stema to Stema QT cables and go direct with no soldering to the feather. That's hard to point at, which is cool. You still have to of course solder together all of those boards, but it's a very neat connection to the feather. So original version that was on an M4 required the use of some MIDI USB libraries that are not compatible with feather. So I am working on changing it over to use the tiny USB implementation of USB MIDI. And so I'll give you an update on that once that's hopefully working. Another thing I'd like to do with this by the way is do some bi-directional MIDI stuff to get the notes out of here and the light sync, the NeoPixel sync back to here and do a version, a simplified version in Circuit Python. So look forward to that too. And then what I wanted to do is actually give a little bit of a video, composite video update, as well as forge ahead with something. As you can see here, the title of today's show, Glitchy Video Mixer. So we'll take a look at that. First thing I'll do actually is let me bring back my browser here. And if we go to learn, I forget sometimes to point out when I've got a guide published. So if we go to New Guides and View All, you'll see here I've got this guide that I just published called Video Nubshank. It's the ESP32 QT Pi composite video injector. So you will recognize this from past two episodes ago. There's my little weird Sony video Walkman, a video eight Walkman, with the little nubshank, video nubshank shoved into there using the ESP32 Pico. And it's got the BFF on it for power. If you want to use a battery or charge the battery with that. Also gives you an on-off switch, which is really nice. And it gives you the form factor to wrap the whole thing around the little connector. So in the guide, I'll show you how to build it. So here's a little hookup. That's the sort of simplified version. You just really need to get the DAC analog out to the positive or center of the composite video plug and then ground to the negative. Show you how to put that all together, the way I had put it together, and then a couple of use cases. And then we've got code. So for the code here, this is the ESP32 Dolly Clock by Marcio T. I hope I'm saying your name properly. And that is actually, if I recall, no changes. So this is, you can just use that as you'll get it from his GitHub. There's no changes to that, it just works. The update, and I showed this a little bit on show and tell, you can see it back here is doing a, let me switch the camera actually for a second. Doing a color bar, sort of a SIMPT, Society for Motion Picture and Television Engineers. SIMPT, NTSC color bars. This is how broadcast and television were typically calibrated to check that you had colors within legal broadcast ranges. Make sure that your geometry was proper and so on. So this one is kind of a hack. The colors are definitely not accurate because this is using the RGB332, so they're not actually accurate, but it's just useful for looking neat and for LeMore's needs. She asked me to put this together so that she could, when she builds displays, make sure that she's got her geometry right if she needs to sharpen things up to get the text looking good. You can do that. You can tell when it's off the screen. Typically with a CRT, you will always fall off the screen edge. And that's part of an accepted standard with a CRT on an LCD or modern display. You'll see the full image. And interestingly, the pixel output, since we're not talking about scan lines really, we're putting out a progressive image, not an interlaced image, is the same dimensions as the SNES. A lot of these 8-bit video projects use those which are, I believe, 256 by 240 is the actual image, so not, I don't think that's four by three exactly. So that is an update that I will be adding a page to that guide, same video nub guide if you're interested. And one of the things about that is that rather than try to do an image conversion and go back and forth with starting with an RGB bitmap, trying to tune the colors, dealing with whatever it does to it, I made that with Adafruit GFX, the graphics library. So those are all rectangles and text. So it's just up to you what you want to display on there. You can use any of the Adafruit graphics, libraries, lines, rectangles, circles, filled, not filled. And I just used it to make an approximation of those simpty color bars. The next sort of progression of this, if you look there, what's going on there? So this question comes up sometimes about, can you mix a couple of signals just by kind of summing them together? Can you connect a couple of composite video signals, in this case, analog composite video signals, and have it work? And the answer is largely no. You won't get any proper syncing unless you have two video sources that are synced to each other, which is way outside of the purview of what I'm trying to do here. But it was discovered at one point as people started to hack low end video mixing gear and video editing gear that was made in the 90s and 80s. Some even earlier people started to get old broadcast stuff or old home editing stuff and tinker around and essentially circuit bend them and see if they could turn little title generators into weird glitchy artifact generators and so on. There was a design called the Dirty Video Mixer by Carl Klump and I will show you the schematic for it because it's dead simple. I'm actually making a version that's even simpler, but you can see here what we have is two composite video ins which are going through a couple of switches which I've omitted because we don't really need that. That's a way to essentially turn off one source if you want to just essentially fade to black. But I'm just mixing between two video signals that are unsynced and so the key here is this 1K potentiometer in the middle and then the wiper is going out to your video display. So in this case, the CRT. So you can look up Dirty Video Mixer and you'll see a bunch of examples of this that people have done over the years, but this is my version of it which you can see. I'm gonna hop back here and let's do a little demo. Like that, say it first and I'll show you how it's put together and also take you through some trial and error and things that I did as I was working on this. So what you'll see first is I have two sources. One is the color bars and the second is gonna be my DVD player. Let's see what it's on. Okay, so that's a menu screen there. That's probably safer to show that menu screen, but I'll play a little, let's play a little content and hopefully don't get into any kind of copyright strike trouble. I gotta come around this way and see the display. There we go. So this happens to be a Blu-ray player. It's playing a standard resolution DVD and I'm outputting over composite video to the little mixer. So you can see here we get really funky, non-synced mixing between the two sources. So I can go to my color bars. I can go back to the Beastie Boys there as they kick off their video. And there's not a lot you can control about it. This is a composite signal. You're not gonna adjust individual colors or anything like that, but it is kind of a fun effect. And some people like to add little kill switches so they can drop one source in and out. Or like I said, if you wanna be able to go just to mostly black, so this is the unadulterated, pretty much the clean image, and then I can fade that to a second source that is nothing right now. So it's really just dimming my image, not fully to black, but kind of an interesting effect there almost like a brightness knob. So if I take a different source as an input, let's instead of the color bars, I'll add my other little video nub there. Now we get the clock. Hey, more clocks. This one's accurate. I set that one as well. At least it started out life accurate. It's not connected to my wifi, so I have to connect to it once and set it, and then it's just based on the internal clock. But here you can see again, we've got a pretty cool mixing effect. You can get some really good glitchy stuff on a CRT. I'll show you in a moment. It's interesting, the circuitry in an LCD, I have one over there that I can show, does different things. It's not quite as satisfyingly glitchy. You don't get as much of this weird sideways sync stuff. I think maybe the TV is trying to add its own opinion to the sync or something like that. I don't understand it, but you'll see we get some different effects. So if we take a look at how this is put together, I'm gonna go ahead and switch my video cameras here. So what I'm doing there when I'm changing that is just to have this 1K potentiometer. And you can see it is fully left right now, which means we are allowing this right source, which is the video nub with the clock on it. And as I turn to the right, I'm bringing in this second source, which is my DVD player. So this gold connector black cable here, that's my DVD player. And then this is the output here. So I'll point that out. And if I line these up like this a little bit, it's a little more like that diagram I showed. Oops, I just fell on my screwdriver, which is upside down, which is kind of like that. So we have the right input, the left input, the output, and a potentiometer. You can see that. So that's my simplified reduced version where I've taken out the switches from that. So that means that if we just plug in a different source, let's say we get the beasties out of there, and I put the NTSC bars, and like that, that is coming from a second minimal version. I didn't make the whole nub thing. This is the minimal version. Oh, let's see, did I just break something? What did I break? I got that wrong. Confused myself. This was the input I wanted. This is the output I lied. That's the out cable there. All right, let me rearrange this. This is a problem with doing it as a big, wiry mess. So output is going here. Inputs currently are the, oops, clock on one side, there we go. And let me just move this over here to the left. I'm powering both of these off of a big USB battery at the moment. There we go. How many people, raise your hand, have a workbench that looks as messy as this while you're working and you get confused? So there I've got a separate different source. Okay, so now that I have that a little more understood, oh, what did I do? Hello? Make sure that power didn't just die. Oh, it's getting close. All right, let's try the DVD source. I think the battery died on that. So that means this is running just off of its own lipo. I'll move this off to the side. Okay, so simplified version. This one on my left is the DVD. This one here is the clock. And now mix between them. Whoop, okay. So let me leave it as those and then show you some experimentation I did. First of all was what's with this particular resistor? This is a 1K. So I wanted to just try out. So here's a 5K resistor, 5K potentiometer. And what I'm gonna do is unplug. You can see here, I've just soldered some leads with DuPont connectors to the potentiometer. That's my 1K. That one works great. This one, I'm just gonna sort of jam these onto the solder tabs there. So center is the output. And then left and right or right and left doesn't really matter. Okay, and so what you find with the 5K is that it just goes to black pretty much in the middle. I'm turning right, I'm turning right, I'm turning right, I'm turning right, I'm turning right and then I pick up the other source. So this one's kinda neat because it's actually a little more like a proper fade rather than a cross fade. It's like a dissolve or a dip to black. So it goes to the middle, there was nothing. And then it comes back up. You can see my TV whining about, hey, I don't have a video input. So it pops up that little on-screen display thing. That can be turned off with my remote. So that is what we get out of a 5K. So it's interesting and different. What is this one? This one might be a 10K. This is a little red board friendly potentiometer. So same sort of thing. There is no sweet spot in the middle. It just very quickly goes to nothing and then back on. I don't have anything smaller that I might have a 500. Let me look real quick and see if I have a 500 ohm resistor. I'll plug this back in so we can have something display. Good, good and glitchy. Let me swap those. And I'm just gonna check a couple of potentiometer bins real quick and see. Panel mount, 10K, dual log, 100K. I don't have them sorted any better than this. If I have a 500, I think it's one that I yanked out of an Atari paddle. I think those are 500. What are you? 5K, 1K, yeah, most potentiometers you run into are. Let's see, I don't know what that one is. Let's try that one. And I think with a log pot, you're gonna get out of your, you're gonna get very quickly to the mixed center. See, yeah, this one, it's an alpha. These little funky ones are alpha pots. Unmarked, 10K, 1K. All right, let's just see what this one does for us. These do work surprisingly well with the DuPont connectors. A lot of these, okay, so it's connected. Yeah, this must be some high value one because it's going very quick. So I'll pop this one back in. So those were some little experiments I did. Hey, I think my friend, Money Mark is in this video. Hey, check the guy in the keyboard. He's a super sweet guy. So the next thing I wanted to try was what if we used a digital potentiometer? Let me switch cameras again. So digital potentiometer, we have two of these in the store. They use this Dallas Semiconductor chips. One of them is the log pot and it actually doesn't have both wipers. So it's a variable resistor, but it doesn't have as much of a potentiometer function as this one, this is the linear one. It is the DS3502. So I've soldered some, let me zoom in here actually. I've soldered some little right angle headers there so I could plug in. And then I have some code on here that is sweeping minimum to maximum with some pauses in between. So what I'll do is find USB-C power and take my same arrangement here. So we've got a left wiper, a ground or center common and the right and just fit those in. And it doesn't work. It tries, you can see that there's some changes and the timing of it is what I had. So I think it's second or so to sweep, two seconds to hold, second or so to sweep. So come back and forth like that, but if you look at the screen, it definitely never gets to where we see the full image. I don't know what the deal is with that. I think there was, there might be, it could be an interesting discussion in the chat if anyone has ideas about it, but fundamentally this doesn't work. It doesn't mix the video signal. One thing is I think the, I tried just going to like 10% of its range because it's a 10K, I think it's a 10K digital pot, but that didn't change anything about it. It was pretty similar type of image. So I was hopeful because that meant that you'd be able to do digital control over this mixing, which would be fun, have it be based on inputs of some kind, MIDI input, audio interface, something like that. It could be cool. It's a neat different kind of glitch, but it's not a dirty video mixer or a glitchy video mixer. It's just straight up glitchy. So the next thing I'm going to do is just show you sort of the difference if you look at a LCD. So I'm going to bring this over here. Set that back to the clock and what I'm going to do is just run my output. So I'm going to pull that from the CRT now and I have a long composite cable that I will plug in over there. I'm going to switch the cameras and I'll plug into this monitor. And so image looks pretty good. Really good, actually. I'll start to glitch it. You'll see it actually, for some reason, is really bright. The image is way bright on this and I don't think that's the case if I plug in directly. So let's try that first. I'm going to just go straight from my video nub to that monitor and I think it is, yeah. No, it's just as bright. Okay, so I think that brightness on that monitor just must be set high. So going back to video mixing this, if you look now, plug that in a little nicer. Oh, it got mad at it. Let's see, did I run out of power on that little nub? Okay, so that's working well. If you look at the type of artifacts you get less of that horizontal shearing or diagonal shearing, you get some horizontal glitching. And I also noticed when I get to a mixed image here, sometimes you'll see one of them sliding sideways. So there's a horizontal sort of sink thing that happens that's pretty wild. This is not a bad look for the Beastie Boys, actually. Same with here, if we go into our clock, you can kind of see a sideways drift that didn't happen on the CRT. So some difference in the, I think there's a difference in the circuitry between those two TVs of how it's trying to rectify this terrible out of specification image. Let's see, let me check out the chat for a second here. Bring back the discord in the YouTube. Hi Brent, Brent stopped in. Had to pop in this project as neat. Hey, thanks. Remember VHS, remember DVDs? Let's see. Sea Grover says some digital pots can only deal with signals within the digital pots power voltage value. That's interesting. And of course, got to check out this awesome GIF from Yanisgu7, very cool. Yeah, Sea Grover, that is, that's interesting. I think, I don't have any idea what the voltage range is that the mismatch is there, but yeah, that's certainly a possibility. And I think you could try different things, like I know Lady Aida showed off some of those motorized sliders, slide potentiometers. It'd be kind of cool to do that. I did hook up to one of my little 10K slide pots, and it did the same thing that the 10K did, which is it just went to black about there, stayed black, stayed black, stayed black, and then faded it back up. But that about covers it. So clearly it's weird, it's out of spec, it works best on, a lot of people say it works best on a CRT rather than, in fact, let me bring it back over to the CRT rather than a more modern TV, and it may just fail entirely. This is a, I don't know, 15, 20 year old, oh cool, LCD. So it's different in lots of ways from a more modern one. So you may find more modern ones just go, yeah, I don't see a signal there that's worth trying to show, so it'll bail. But I've always wanted to make one of these. I called it the glitchy video mixer because a titled dirty video, anything on your YouTube is probably gonna bring in a weird crowd, so I avoided that. But I've been told for years from friends of mine to try out one of these, and now I have, it's lots of fun. So if you wanna learn more about these in general, look up Dirty Video Mixer or Carl Klump with K's, Carl Klump, I'll bring that image back up there. I don't know if he published it anywhere that's easy to find, but you'll find other blog posts where people show their experiments with them, so just Google that, and you'll find, here's another nice, so I think this image was published on a forum or something like that, and people have a lot of fun doing video games into them as inputs. I have some older consoles that have composite video, all of your Raspberry Pi's have composite videos, that's another potential source, and then any VCR, DVD player, some Blu-rays, we'll still have that, so. I think that's gonna do it. So thank you all for stopping by, nice to see you all in the chats, and I will be back next week Tuesday with a product pick of the week and Thursday with another John Park's workshop. In the meantime, check out our Friday, we'll have a deep dive with Tim C, so go check that out, and then take a look at our shows next week, starting on Tuesday and on through. So thanks everyone for stopping by, and I will see you next time, bye-bye.