Hey, hello, welcome to the show. It's me, John Park. It's time for another episode of John Park's Workshop. And I would like to, first of all, thank everyone for stopping by over in our Discord. If you're wondering where the chat is, you can head over to adafru.it slash discord and go to the live broadcast chat channel. That is one place. Also, I'm keeping an eye over here on the YouTube. So hello, Kriston, Gary T, Charles, Dave. Welcome. Thank you for stopping by. And I think that does it. So let's get going. Let's see. First things first, I will mention that we've got a jobs board over at jobs.adafruit.com. And you can head on over there if you're looking for work. Also, if you're looking to hire someone. So that site that I'm hidden behind right there, let me squeeze that down a little bit smaller. That is jobsadafruit.com. And that's the open positions. What do we call that? Available search jobs and available for hire is the other one. I don't think I'm logged in, so it's not gonna let me go there. But if you're logged in, you can go and look for people who are looking for work. So always free and always vetted. So good stuff there. Check it out at jobsadafruit.com. Also, Tuesdays, I've got this show right here. And that is JP's product pick of the week. And I usually take about 15, 20 minutes, to show you a new or not so new, but cool product that we have a deep, deep discount on. With no coupon code required, just throw one or 10 of them in your cart. Buy them during the show or a little grace period after and you'll get a deep discount. This week was 50% off on this beauty right here, which is the dot star matrix. And I've got a little one minute recap of the show here. This is this week's product pick of the week. It is the dot star eight by eight, 64 pixel LED grid. It's a little one inch by one inch square. It's got 64, it's eight by eight of the little dot stars on there. And you can see there's these little mounting tabs. You can snap those off or you can use them with M2.5 screws to attach them to something. I'm running this under some diffusion acrylic. So it's gonna look a little bit blobby. I'll turn my exposure down so you can see a little better there. So here I'm running some scrolling text across here as well as just some flashing colors. And what I'll do is I'll show you how that's set up. There's a lot of ways that you can code these. You can use in Arduino fast LED in circuit Python fancy LED, LED animation library. That is my product pick of the week. It is the 64 LED dot star grid, eight by eight. Hey, there's my audio working. And in fact, I like that one so much that I wanna show a little more specifically how you can code it. So that's gonna be the star of this week's circuit Python Parsec, which we're gonna jump right into now. For the circuit Python Parsec today, I wanna show you how you can use the Pixel Frame Buff library to write to a dot star or a neopixel matrix. So here I have a neopixel or rather here I have a dot star matrix. And in my code, you can see I am importing both dot star and Adafruit Pixel Frame Buff. Now frame buff allows you to treat a matrix or kind of any strip of neopixels or dot stars like it's a display. So it makes sense if it's in a grid. And here what I do is I set up my dot star grid and then I set up pi pixel or rather than I set up pixel frame buff. I tell it to use my dot star grid. I tell it it's eight by eight for the dimensions. And then we can set where the strip starts. I'm starting in the upper left. So I say reverse X and alternating is gonna allow me to use a snake like pattern as if it's not a snake like pattern. You'll see here in a second what that means. Then I'm setting up some color definitions. And here are the commands that I can use to display. So I'm just gonna uncomment and save. So this is pixel frame buff fill and I give it a color. We have an individual pixel draw. So here I can say pixel frame buff, pixel and then a coordinate in XY. So four by four, I'm telling that to draw. Next I have a line and this one's cool because you can, whoops, one second. There we go. Next we have a line. So for this one I do pixel frame buff line and then I give it an XY coordinate for the start and an XY coordinate for the stop position and it draws a line between those two vertices. Then we can do some horizontal or vertical lines and there you tell it a starting point and a distance that it continues on in. That also works for a vertical line and we can have multiple of these up at a time. I've just been commenting them out for convenience but there you can see horizontal and vertical. And then we can also do a rectangle as well as a filled rectangle. So commands there are rect or filled rect and then we give it a upper left corner, lower right corner in XY space and then the color to use. And there's more that you can do with it but that's just a starter of some of the easy shapes that you can display on a neopixel or dot star matrix using pixel frame buff. And that is your circuit python parsec. One thing I like to do actually is give you a little bit of a bonus after the circuit python parsec, the extended parsec. And for that I want to just show what some of this reverse and alternating stuff is all about. So let's say we do, how about a vertical line? So I'm gonna uncomment my vertical line here and let's make this the full height. So I'll start at zero on Y and I'll go eight pixels. So here if I save this, you'll see we've got a line that starts at the top and heads down to the bottom. Now let's in fact start this at the upper left corner. So I'm gonna put X to zero. Now if I change the reverse to false, you'll see that this physical first pixel is actually on the other side. So it's right to left, which may work for some uses but I wanted to start left to right. So I use that little flag reverse X. And then alternating, if we say true to this, it will treat every other line as if we are wrapping around in a snake-like pattern rather than straight up and down. And again, depending on how the physical layout wiring of the dot stars or the neopixels are, you may need to set this to the other boolean there in order to get expected results. One other thing I'll show you, a neat little bonus here is with something like the line. I did a very nice neat one by having this start at zero, zero and end at seven, seven. But if we move in just one pixel, you'll see, well, you can't really draw a straight line on a grid, so we're gonna get some sort of unexpected sort of aliasing there. And as we move this around, you'll see different fun results that give you funky, wiggly things that are the spirit of the line, but it's not, it's never gonna be a straight line because we're dealing with fixed grid points in space. I imagine if you wanted to get creative with it, you could add some anti-aliasing to that so that you end up with some dimmer pixels that thicken it but make it look straight. But this is really cool. And I had honestly never seen or played around with this, but it's great. I think Melissa created this and it's a way of treating a dot store or a NeoPixel grid as if it's one of our RGB matrices, some of the same commands and sort of like our display IO stuff as well. So, very cool. Yes, Jaggy, Dexter, very Jaggy. Gary Z asks, where can I find the example code for the circuit Python Parsec? Unfortunately, I don't usually publish these just in the interest of time, but they are so, generally so short and sweet that they can be copied just from looking at a couple frames of the video. Usually I've got the full code up here most of the time. So, sorry about that. Not an easy copy paste, but it shouldn't be too bad. Sometimes they are, this is not one of these cases, sometimes they are taken from the Learn Guide or Todd Bot's GitHub page for the Todd Bot tips and tricks and in those cases you can copy and paste nearly the same. Sometimes I'll make small changes, but nearly the same code. All right, so let's see. Next up, whoops, let's just say we're coming up next. Next up, I wanted to do a little bit of a gear report. I don't always do these, but I got a cool kit in the mail that I had ordered from someone on Tindy. And I wanted to show you the webpage for it and then dig into the goodie bag of the kit that we got or that I got. So, let me jump over to Chrome here. Where'd you go, Chrome? And let me, actually, you know what I'll do? I'll be wise and find it before I try to open the page because sometimes the search process leads you weird places. Let's see, I'm gonna go to, here we go, I have found it. All right, so this is, I'll say this is, there's one left. So if someone gets excited about this, jump on it because there's just one, I'm sure the maker is gonna make more of them. But this is the Enigma Lamp Board Kit and the goal is to make that. So it doesn't come with a wood case, so that's part of the fun is building your enclosure or repurposing an enclosure. But what it is, is it looks like the upper half of a World War II German encryption machine called the Enigma machine. And with it, you would, after setting your crypto key settings, it had a typewriter at the base of it and when you would type in a letter, it would light up the encrypted version of that letter and then you would send it, write it down, morse code it, however you were gonna get it out to someone else. So this upper half is a series of lamps underneath this circuit board here. So I wanted to show you how gorgeous, I can't wait to build the kit, I haven't yet, but I wanted to show you this gorgeous kit here. And this is from Hack Modular on Tindy. Hack Modular is in London building a bunch of cool stuff. I think you can also buy a pre-made one. There's a few of those in stock, but just one left of these. So I put it in my own cigar box because I may build it into this box before building one. But check it out. Here is the circuit board for the top of it. You can see on the back there it says enigma and it has some Morse code here. These are PCB fiber FR4 material that has some silk screen holdouts for the letters. So if you shine a light through there, I don't have my flashlight, but I could use my phone one. The effect of this is gonna be that you can light up these letters. One second. And actually, if you'll hold one second, what I'm gonna do, I'm gonna show the video from this so you can see the effect that we're going for. So this is a voltage-engined character display based on the illuminated lamp board of an enigma cypher machine famously broken at Bletchley Park with help from the Turing World School Bomb. It's a bit of an unusual URAC module because it doesn't make any sound of its own. It's purely a visual display. It's part of a series of modules exploring early computers and telecommunications by this paper tape reader relay switch and thermal cypher machine. It's very simple. It's got one voltage-controlled input and a buffered through output so you can just continue your patch through the module to another one. The voltage control is scaled to one volt per octave. In this case, one volt equals 12 characters with each character being assigned to a semitone. So if you play chromatically up the keyboard, it will select each character in sequence. Those characters are encoded in either an alphabetical order or in the international teletype alphabet. That will get a lot more interesting once we're reading voltages off of paper tape. That's selected on the back of the module with choice of two sets of D multiplexer IC sockets. Of course, the real enigma machine didn't send or receive... Okay, so I'm gonna run back over there. You get the idea with that and sorry, I'm not so sure how clean the audio was coming through on that. So let me jump over here and take a look at the goodies that come in the sew. Like I said, we've got the top panel with the knockouts for the lighting. We get all of the very nicely bagged up components. There are some terrific little goodies in here, including, I don't know what this one came from, it says to call exchange, lift telephone and listen, replace telephone only when finished. This looks like it goes into the dial, that little circle on the dial of a phone for like a lobby somewhere. There is a IBM 80 column punch card in here, blank, unused. Got the little enigma badges that go on here and these are, I'm not sure how these were printed. Looks like maybe a toner transfer onto aluminum but they look pretty nice. There's a silver one and a white ivory one. Can attach those to the final build. There is the circuit board with silk on it for everything that's going on there.   These came in cigarettes and tea. I guess this was a tea one. Inventors and inventions, series of 50. I don't know when these were made but pretty cool little collector's card. That was the bag it came in and here's the ribbon cable for power on that for connecting to modular. So I will be putting this together and once I get it together, hopefully we can do some interesting stuff with it because you can use it anywhere from just a straight up voltage meter to see I'm guessing like negative eight to positive eight volts or something like that. But you can get with higher frequency stuff you can sort of print out messages to the display which is pretty cool. So that is my little gear report and I'm not paid for this or anything like that. So if you get the one remaining kit, awesome. I don't see any money from that. I just thought it was super cool and wanted to share that and hopefully I'll encourage Hack Modular to make more of them. So that's my gear report. All right, so let me pop that back out there. Let's see what else is going on. The, oh, the next thing. Okay, so the next thing I wanna talk about. First I wanna do a bit of a demo and then on software and then get into the hardware software implementation of this. So you know I've been going through this journey starting with the cassette player walk melotron with using control voltage and MIDI to adjust the speed on the cassette to going back to the wave files in the audio mixer in circuit Python and Todd Bot's breakbeat little button board. Now I've been working on a more of a droning tape loop project and I showed a little demo of that last week. And one of the things I realized when I was playing back demos of some wave files I had made of these tritone sine waves is that certain combinations that I was playing were giving me really nice sort of phasing, beating sine wave sounds that I really like. And so I wanted to explore that more and I think it makes for a really interesting drone box this drone box idea that I'm making. And what I wanted to do first is just show you an example of how some of this phase cancellation and phase amplitude addition in additive synthesis works. And then I'll show you these examples where I can play two tones against each other and you can hear how these sound and then we'll get to being able to play up eight of them and what that does for creating these sort of beating frequencies. So let me jump over here. I'm gonna turn on a little speaker right here and hopefully you'll be able to hear this well enough. One second. So what I have here just to demonstrate this is VCV Rack and this is free. Free and open source VCV Rack virtual modular software. You've seen me use this before. And what I have going on right now is I have two sort of identical setups that are allowing me to play sine waves, a pair of them at the same time and currently they're in sync with each other and they're the same frequency as each other. So even though there's two of them in this oscilloscope on the left where it looks blue that's actually two overlapping sine waves that are identical. So I'm gonna turn up the sound on this monitor. And that's what that sounds like. Two sine waves identical to each other. Now what I've done is this'll look a little confusing. I've got this keyboard. It's not actually sending full semitones. I'm attenuating it. So I'm just barely bumping up the frequency on this second sine wave. So if we look at it here suddenly you'll see the scopes come to life. And first of all, if you look at this scope right here you'll notice that I have my original blue signal and then I have this new purple one. That's the second one. Those were in phase together. Now that one of them is a slightly different frequency they keep going in and out of phase. They have the same amplitude as each other but they keep going in and out of phase with each other. The combination of those two waves when they're added together and we hear them is this sort of pulsing of the amplitude which is the volume.  So here's what this sounds like if I turn my monitor back on. Where'd you go? There we are. All right, so that's the two waves identical and here's one just being slightly higher frequency. Now this effect is sometimes called heterodyne and it's used in signal communications. What it is on a perceptual level is we have two frequencies. If I play just one of them and now I'll play just the second one. You can barely tell the difference between the two. If I play them both at the same time though, we get this frequency of essentially the phase cancellation in addition that is much, much slower than the frequency of those sine waves. So that beating up and down is this almost sort of third frequency that emerges from this. And what you'll hear if I increase the frequency of that second sine wave is that pulsing is going to increase its speed as well. Okay, so that's the sort of basic explanation of what's going on here. It's this phase cancellation and phase addition that gives us a beating sound and it will vary depending on what I'll call like the base frequency and the second frequency. It's kind of a modulation frequency, but not really. They both have equal importance. It's just we get this third thing, this third beating sound that emerges when we play them. So in my example here, just to keep it simple and I didn't want to copy and paste a whole bunch of stuff, I just have two of them. But with the project that I've been building, I now have, let's go to the bench. I now have the ability to play eight of them. So just pop that guy there for a second and talk about that. So what I've done is I've taken my Feather M4 that I was using and I have a little I2S audio amplifier. So it takes that digital audio signal off of the Feather and amplifies it so I can put it through speaker. I have a little speaker in there. I think it's an 8 ohm, one watt speaker in there. And then I have these eight toggle switches and I'm eventually gonna be changing those out for these 808 style lighted stepped buttons, but right now I've got toggle switches for it. And then I have a little display on there and I've also got a rotary encoder so that I can pick from different banks of wave files. So not to get too convoluted with this, but what I was doing was just recording wave files that loop perfectly. So they start and end through the zero line because these are alternating positive and negative. So I made little snippets of those different sine waves that I just played for you one at a time. So now I can use the audio IO mixer in Circuit Python to play all of them at the same time. They start together, they run in sync together, and then I can just adjust the gain. So I'm essentially mixing them in. Now you can do this with sliders, which would be very cool, but for this one I just have switches. I have banks of or sets of eight wave files that I can sort of swap between. It happens really fast. So these could be eight drum beats or eight songs or someone saying the alphabet up to whatever the eighth letter is, eight or something, but it doesn't really matter what they are, but what I've got here are some different semitones in sine, triangle, sawtooth, or square wave, and this sort of even harmonics one. And then the fifth one is not semitones, it's this idea, which I find much more compelling actually, of having just slight increases in frequency so that we can get these beat frequency oscillations as Dave Odessa called them over in YouTube. Thank you, Dave. So let's take a listen to that. DJ Devin says eight, wouldn't 16 be better? Well, probably, but eight works pretty well for this and kept my hardware to a reasonable size. So let me jump over there and give you a little demo of that. So hopefully you'll be able to hear it well. I might move my mic onto the speaker. I don't have a line out on this, I just have a little speaker on there.  Let's see, first of all, I need a power supply. Did I actually forget to get a, so I'm gonna work, let me grab a battery. Okay, let's plug this in and I'll show you the guts here. I'll take it apart a little bit and show you the guts after we do a little demo. I guess an onboard battery would be a good idea with this. So the screen doesn't flicker in real life, but just based on my camera settings here, you're gonna get a bit of a flicker and I'll zoom in here and I will take my mic and set it down here for a moment to something nearby.  We can go to I think square, definitely square. Here's the even harmonics, some phasing there because that has more harmonics in it than something like just the sine. There's more interplay there than some of those purer tones. And now my last one here, the fifth bank is these sort of microtonal frequencies that we can use to do this cool heterodyne thing. So here we go. Here's, hopefully you can hear this. I'm gonna try to look at the chat real quick. Let me know if that's audible. Otherwise this is not a lot of fun at all. Let me open up my Discord. So let me know, totally audible, thank you. Okay, so this is where it gets cool. This is the part I didn't do over on the computer and this is gonna be more than two of these sine waves that are out of phase with each other interacting. So you'll get these polyrhythms that start to emerge. Interesting rhythms. Well, for some reason that was way louder before. I think I lowered their pitch in code but that's a good excuse to go in there. Sorry, I'll put my mic back here. That's gonna be a good excuse to show you the code because I'm gonna increase the level of the gain. I have intentions of adjusting gain with this knob as well but right now I don't have multiple modes for this but since this is a push encoder we should be able to do multiple modes. So let me turn this off. I've got a little enable switch there and then I will tell you what's what in here. Let me zoom out just a little bit and I think I have just two screws. So this is just very tenuously put together at the moment but I have just two screws at the base here and then I have one long header pin holding the screen display and I thought I was gonna use a ribbon cable for it but it was short enough to just stack some headers. So we can see inside of it. Okay, so main board here is my Feather M4. I've got a little enable switch here and I posted this on Instagram and Twitter last night. I added a little, there's this cool spark fun breakout board, the quick breakout that gives us two of these quick slash STEMIQT ports running to I squared C, power, ground, clock and data. I just did some very tiny little wiring job in there so that you can connect nice easy STEMIQT cables to your stuff. So if I unplug that one there, that's how my rotary encoder and my buttons are connected. I'll show you in a second, a little more about those. Then I have a little breakout here for my display. So all the pins of this OLED display right here, I just added, I stacked an extra long stacky header on there so that I can sandwich that down in when I close it and it connects so I was able to separate those. That's where I thought maybe a ribbon cable would be useful. Then I've got my little I2S amplifier. So that runs to the pins on the board and I'm using the five volt USB power instead of the three volt on board power. Just gonna need to draw more current for the speaker and I was browning it out before. The speaker here, okay, it's the four ohm. It's supposed to be the four ohm three watt. That could be my problem. And I talked about this on show and tell last night. I was very excited to be able to reuse this swatch of Aeron chair mesh from a really old chair. I had to replace the mesh on it and I saved the old one that was torn up and I used that as my little speaker, my fabric speaker cover there. And in fact, this, you can unscrew. So these come apart entirely. So I'll go ahead and do that. This has a little terminal block on the amp so that I can take the two pieces apart. Sorry, I didn't do that on camera but this was me unscrewing that. And so here is the main interface of the board, interface display speaker. The switches and LEDs may look familiar to you because I built this thing and just had it on its own little board using a QT pie. That QT pie is not being used in this at all. It just happens to be there. And I had used a STEMI QT cable on this little IO board. This is a I squared C MCP two three zero one seven which is out of stock now and that chip is gone. So we got to find a replacement for it but that really cool board allows me to have eight of these inputs and eight PWMs for these lights, for these LEDs. And so this was really expedient for me to just redesign the face and laser cut that and add these switches. But ultimately I'll be doing some buttons for that. And then this is our STEMI QT rotary encoder breakout. It's a seesaw board. This is a seesaw board as well. And that's about it. So let me reassemble this. I was very proud of this mostly modular design so that I could assemble it and disassemble it. All of this I did on a breadboard first and in fritzing so I could hopefully get it right before I started soldering. And I mostly did. I didn't have too many mistakes to fix as I put that together yesterday. I did not put any of those little crimp ferrules on these wires and I wish I did cause I'm always paranoid about stray wires touching the neighboring terminal but if you solder tin them they don't really clamp down very well with the screw terminal. So I should use those little crimp ferrules. Okay, so that's the speaker connected. There's the STEMI cable for I squared C and then I've got to get my display lined up and these little spindly stacking header pins are pain. Okay, there we go. I think I got it. Like I said, a bit of a flimsy prototype construction but I'm gonna be revising this and I'll probably make a 3D printable or combo 3D printable and enclosure or something case so that it's easier for people to put together if they don't have a CNC or laser cutter which is admittedly not as common as 3D printers. Okay, that looks plausibly together. I'm just gonna test it here real quick and then we'll go plug it in and take a look at some of the code stuff that's happening right now and we'll boost the volume.  That is one thing I like about this LED plastic is that you can see indicator LEDs even if you don't design light pipes and things for them you can at least see some blinking. Okay, cool. So let's go ahead and shut this off, plug it into the computer and make it louder, first of all. Let me get a little down view of this here. Exposure a bit. Let's fix the focus. It's pretty close. And let's do actually this view here. So let's see. I'm hopeful that the hub I'm plugging into can provide the current necessary to drive all of this. Oh, it looks like it just failed. Yeah, that could be a current thing. I may have to, I thought I had it running off of here yesterday though. There it is, okay. So I'm gonna open up the code that's on there. So it's all circuit Python. One thing I was thinking about with this is the sort of hardware platform here could be really cool for using the teensy audio library as well to do like synthesis on board because obviously right here to keep it lighter weight and running fast in circuit Python. I'm just using the audio mixer and wave files which is easier than generating things on the fly, I suspect. Although there could be some ways with lookup tables to make that work. So here we go, in code. I won't go through all of this, but some key features. I've got this MCP 23017, I squared C board and that's where my toggle switches and my LEDs are all connected. So that is something I can just read all at once and write to all at once over seesaw. Same with the rotary encoder. So we set up a seesaw device for a rotary encoder there. I was thinking about using the arcade button thing, a couple of those for eight buttons which may be necessary if we don't have a replacement chip but I think we do have a replacement chip coming out for that IO board. Then here are my banks of wave files. So it's probably in a more elegant way to do this but all I have are folders on the circuit pi drive that are named signs, triangles, squares, evens and detunes which are the little beating frequency ones and then I have a series of wave files in there. So I'm opening all those up. When I change my rotary encoder, I swap out which set I'm playing. So for out of curiosity, what happens if I bump this way up in volume? It's still not that loud. All right, well, let's, whoops. Yeah, that's better. All right, let me move the mic down here for a second and hear that. So I'm glad that worked out. So much louder in my inside lab but that's the nature of things. Oh, that's got loud air conditioning going on here. So then I make a little set of these sets which I can ask for when I change the rotary encoder to pick a different set. And that's done with this little start waves function here and it just runs through each of the wave files in that little list, opens them with the raw binary method and assigns them to a voice. So we get eight voices there. And then adjusting the gain of those voices from what's in this list, which is 0.9 in this case, to zero is all that the toggle switches are doing. A bunch of OLED setup stuff for my OLED display there. This is actually the four level or 16 level gray scale display. I'm just using only white or black on here at the moment but that one allows you to do gray scale. One thing I've noticed is that once you get gray involved on this, it really flickers on camera. It's fine in real life but the grays really seem to flicker for some reason. Here's some stuff I'm not doing with the display that's just commented out. Right now this is just one frame of my sprite sheet animation. I'm still trying to figure out what I'm doing there if I'm gonna try to make a little rotating tape reel. Then I've got my text label which says drone four in this case. And that just changes that text update. And then this is the main loop. So again, you can see as a section I'm not using but in the main loop here we look at all of the toggle switches from our coming off of the seesaw board there. And if they have changed their values and they're set to true, then we're setting the volume to the volume in the gain list. And if they're off, then we set it to zero. I'm also toggling the LEDs on and off when I do that. And then here's all that's going on with the encoder. We check the position. We see if it's different than the last position which is the state variable we save. I am setting it, sort of clamping it to a range with this modulo function here so that we just keep getting zero through four, zero through four, zero through four. And then here's where I call my start waves function which says, okay, we've just moved to list two and it swaps out the waves there. I'm presuming that it doesn't need me to flush anything. I didn't look at the audio mixer code documentation. I'm assuming that this sort of flushes it. I haven't had any problems where it runs out of memory just because I keep switching so I don't think it's adding on which, I don't think they're all playing, I think just the latest set is playing. Or it could be totally wrong, but it seems to hold up so far. I will look into that. And then just for debugging's sake, I have, if we do a screen, which one is it? Oh yeah, it's this one. Okay, there you can see my position change on the encoder is all I'm recording here and it works forward and back or is all I'm printing here. And then that changes text area dot text to be the word drone plus string of set number. By the way, this is one I had comma in here and comma doesn't work in there. You get like a tuple error. I was being boneheaded about it. Thank you, Todd Kurt for saying, I think you want a plus in there, not a comma. So now it works, but I'm forever making that mistake. So that is it. Cool tape animation there from UNESCO, I dig that. All right, let me see if there's any questions I've missed over in the chats. Thanks, Anthony Bacara and Dave Odessa. I appreciate it. Let's see, getting Philip Glass vibes for sure. Peacory and Hurray send gates for when composed waveform crosses a threshold. That could be interesting for sure. AxWax loves the polyrhythms, way cool. Very satisfying. Okay, good. Thanks for playing along with that. It's been fun developing this. I'm gonna pause on this while we get some parts in. So one will be the IO board switcheroo and the other will be these cool little stepped switches that have LEDs built into the tactile switch cap at the top. And then I have one switch to make in my code that I had been using before so that instead of a real toggle, I'll use a momentary switch like a toggle and it'll just change the LED color depending on which state it's in and we'll hear it or we won't hear it. And I think that's gonna do it. Okay, thanks, Jim Hendrickson. Thanks everyone for stopping by. It's gonna wrap up. I will see you next Tuesday for another product pick of the week and next Thursday for workshop. So for Adafruit Industries, I'm John Park and this has been John Park's Workshop. Bye, everyone.


Ac mae'r bwysig yn ôl yn gweithio, ond rydyn ni'n siaradau bod oes y byddwch amgylcheddau a'r ddweud o gwaith, i ddweud o bwysig o'r ddiwrnod. Ieithio, mae'n gweithio'n gweithio, byddwn i'n ddechrau panel, ac mae'n Gwylch Cats, that is the Vice-President of the Brookings Institute. And Philip Broad who is Executive Director of The Cities . Program here at LSE. And we are going to begin this part of the session by inviting first of all Bruce to comment and react. And then Philip. Ond o'r cyfnodd trwy'r cyfrifio, felly mae'r panellydd yn ei wneud o'r ymddwys gweithio i'w grannu ar gyfer y dda, cael ei gweithio, yn ymdigo'r bod ni'n bod yn fwy amdalau, ond mae'n ddechrau. Rwy'n meddwl. A fyddai'n gweithio yma oherwydd. Yr wych yn ffordd i'r bwysig i'r gweithio. Rwy'n meddwl i'r brinwys i'r ymddwys i'r eurbonet. Yn ymddwys i'r gweithio, ond mae'r bwysig i'r eurbonet. Mae'r eich bod yn cyfafodol o'r effordd sy'n byw yn ymddiad yn ymddiad, ymddiad, ymddiad, ymddiad, ymddiad, ymddiad. Mae'r eich hun i'r hyn o'r roi hyn sy'n gyllidol i'r ffalenthau. So, gwasanaeth yw'r rhanig. Yn gyfodol i'r prydyn ni. A yw'r wahanol, ychydig yr un o ymryd, yn y Llywodraeth yng Nghymru, a ddim yn gallu ffynig o'r perspective americyn. Yn y gweithio'r llawr iawn, mae'n gweithio'r rhanig i'n llwyddiad y platform i'r rhanig o'r rhaglen i'n amser. Efallai eich cyfrifio ar gyfrifio, Ie ddweud i'r cychwyn cyfdreid y mewn cyfnodol yn perthynol'r reger a cyfnodol. Ie ddweud efallai'r cyfrifio sy'n gwneud cwylio, gyda'r cyfrifio, a'r cyfrifio a'r cyfnodol, sy'n ddim yn ynnig o'r mewn cyfnodol yn y gyfrifio sydd y cwylio, a'r cyfrifio yma yn y ffordd. Mae'r fawr, cynnydd i gyd, oherwydd, mae'r prysgol yw Iobama'n oedgylchedol hefyd. There essentially is no national government in the United States today. It is mired in partisan gridlock, and essentially it has sent a signal to the United States to the society. We are basically not acting. And so the rest of you all, cities and metropolitan areas in particular, you're in charge. And so what essentially is happening, because states for the most part are also on a frolic and detour, with the exception of California and maybe a few others. Cities and metropolitan areas are essentially being forced to step up, not just as city governments but as networks of public, private, civic, university, labor, community leaders, and to take the hard actions necessary to the extent that they can to make a difference. So there are three kinds of actions happening in the land of climate denial right now that I think are important to focus on. The first are cities are beginning to invest in a new kind of built environment. So what are we talking about? And Karen had a great slide up there about the various ways of looking at this. Sustainable transit infrastructure match with new land use and zoning. So this is Los Angeles, this is Denver, basically going to voters to basically raise their sales tax to raise tens of billions of dollars over multiple decades to build large state-of-the-art transit systems that then begin to alter development patterns. Now in the past some of those investments were made by our national government. Now essentially cities are having to go to their own citizens and say, well, they're gone, it's up to us. Other cities, Washington D.C., investing in a new kind of clean water infrastructure. Cities like Philadelphia basically investing in new core city infrastructure in the downtown and midtown so that they can grow 10x residential, 5x jobs around Drexel, University of Pennsylvania, essentially the core of the city. So what we're seeing first and foremost are cities using their own financing or going to voters for new revenues or going essentially aggregating public, private and civic capital to do what we all know has to be done, right? More choice and transportation, more density and accessibility, all the things that Karen was talking about. But having to have to be done through local resources essentially or local action that connects to institutional investors. Second piece, what do cities do? They set rules, they set building codes, they set zoning and land use ordinances. They have mandates on reporting on emissions and so that's the second thing that cities are beginning to do. Now, Portland, Oregon has been doing this for decades. They drew an urban growth boundary back in the 1970s and no surprise where has most of the growth gone in Portland, Oregon. We don't compare Atlanta to Barcelona, we compare Atlanta to Portland because Americans generally don't have a passport but that's okay. So not surprisingly, there's been a large amount of reinvestment in Portland, Oregon and because of that reinvestment and because of the sort of tilting of growth and development to the core, you've got the benefits of density that enable you to build out street cars, build out public transit, build out the kind of radical mix use that increasingly not just a new demographics but a new kind of open innovative economy one. Boston has done this on energy efficiency, other cities have done it on a range of other signals to the market. Last bit, and this really may be the greatest contribution of the United States to deal with climate change in the absence of any national leadership which frankly I think won't be coming for quite some time. So you all watch the 2016 election, you must be horrified by the reality show that is going on in the United States, you know, buckle your seatbelts, it's going to be a bumpy ride, right? So what we will contribute to climate change solutions will be out of our innovative sector and that's because the United States still through our advanced research institutions, through our military and through our national labs has an incredible depth of basic science which then leads to the commercialization of ideas, the startup of companies, the maturing of companies that essentially create the new kinds of products and services to help us mitigate climate and carbon emissions at scale. Now is this going to solve the problem? Obviously not, but if you go to Atlanta, which again is the poster child for sprawl, there is Georgia Tech. If you go to Pittsburgh, which is sprawl and a no growth kind of metropolis, there is Carnegie Mellon. If you go to Boston, there is MIT.  The creation of a product that can be then introduced in a Beijing or Mumbai or a service that then can be applied. How can we contribute to climate change solutions? So I think at the end of the day what cities do and the urban age really is at the vanguard of basically showing this. One city innovates, it creates a new norm of how to invest, of how to solve problems, and this goes from relatively, in the scheme of things, simple things like bike lanes to much more complicated large infrastructure solutions, but new norms are established that then get basically spread horizontally across the world. And again cities are centers of innovation, centers of economy that are increasingly the places in which the new products and services will be invented to be applied. So the United States from an outside perspective again must be semi horrifying, or maybe it's just completely horrifying, but our cities and our metropolitan areas are stepping up to deal with climate change and they are inventing I think what essentially will be new norms that will be replicated across the world. Great Bruce, thank you very much indeed. Thank you Tessa. Let me try to bring all of this back to the urban age program and what we have just heard from Nick and Karen is how climate policy has embraced the urban dimension. And I want to reflect a bit how urbanism has engaged with climate using our last 10 years as sort of a reflection point. And I can see two main arguments that can be made. The first one is, and given the particular urgency we have just seen, that we have probably not been engaging as urbanists with the subject enough. And there are a couple of reasons which I want to speculate on why that is the case. First there is the technical language of climate change mitigation and adaptation which tends to disguise the deeply political nature of climate action in cities. I'll come back to this in a moment. There are very strong associations, particularly in some circles and these circles are big in the urban world, where we see that climate policy directly sort of in sync with technocratic top-down government intervention, which not only assumes that efficient governments exist everywhere, but also is at odds with more cooperative forms, post-modern notions of urban governance. And then there's the radical change required to achieve the two degree sort of global warming target, which directly leads us to a tension between what you could refer to as an urban evolutionary process and a revolution. Think of strict building and land use regulations which will probably have to severely limit suburbanisation, conventional car use, and the use of unsustainable building materials, the main point which Karen was making. So as a result and reflecting on our urban age conversations and the cities we have been working in, climate action has remained kind of disconnected from particular daily urban practice we have been discussing from more ordinary city perspectives, issues around urban inequality, poverty and the right to the city. Take one example which we have been exposed to when we were working in South Africa. Post-apartheid housing policy in South Africa, which for very obvious and culturally sensitive reasons, was promoting the ownership and therefore the further proliferation of very low density bungalows at the urban periphery. Now the environmental damage of this policy is fairly obvious and it's enormous. But if we come with our climate change debate to the discussion, we really need to understand the politics of the urban expansion that is playing out. Now from a completely different perspective, and I'm turning now the view, it's absolutely clear that city level sustainability thinking, which actually is maybe even more mature than national level sustainability thinking. And the pushing of the urban sustainability community have led to an entirely new recognition of the role of cities at the national and international level. Karen mentioned that we shouldn't take it for granted that the IPCC chapter has in some ways a chapter on cities although they are not allowed to call it cities, so human settlements. Take the most recent urban SDGs, the Sustainable Development Goals. We can't take these things for granted. They were established for the first time it was a battle. Now as part of the urban age, there were actually very few issues that we discussed over the last 10 years that didn't have a central and direct link with the underlying arguments that connect cities and climate change. In some ways, urban climate action is simply common sense urban development. Let me give you a few examples of how good urbanism equals a better climate. Richard Sennett's elaboration on the universal importance of fine grain mixed and intensely interconnected urban development is one example. But there was also our colleague the Indian urbanist Gitaam Tiwari who constantly emphasized the importance of enabling the most equitable means of travel for social reasons and that is walking. And the late Indian transport expert Fabio Casaroli who worked a lot and informed us on the importance of efficient and affordable public transport. It's exactly these co-benefits, these mutual benefits which we really need to, I think, centrally regard as our notion of hope. Three final examples. Compact, connected and coordinated urban growth which we communicated with Nick so strongly in the new climate economy report on better growth, better climate. Not only means a big plus for yes the economy and yes for the climate, but it means to avoid excessive forms of peripheralization of the urban poor which is socially unsustainable. We have done work in three emerging mega cities, Sao Paolo, Istanbul and Mumbai where we looked at how poorer segments of the population can access daily services including their jobs and how long it takes compared to richer sections of the population. The difference in Sao Paolo, which is very car oriented and sprawling, is at least double at already very high absolute levels. Poor people are on top of being sort of disadvantaged, punished in terms of access time. By contrast, more compact, more transit oriented, Mumbai and Istanbul actually equalize that access across income groups quite elegantly. Now social inclusion is actually a big driver for this sort of public transport policy we are seeing around the world. When bus rapid transit was invented in Curichiba and Föller Scaled in Bogotai, it was a strategy for more efficient and equitable transport. The now re-elected mayor Enrique Peñalosa who set up the trans-millennium bus system in Bogotai in the late 1990s, he wasn't thinking about carbon at all. However, these systems not only produce several billions of benefits in efficient access to the cities and for its jobs but are reducing carbon emissions by at least, I mean these are sort of the latest estimates by half a million metric tons annually in these BRT cities. And one final example linking proactive citizenship and renewable energy, which is also referred as decentralized energy, which is a unique opportunity for local empowerment, not only at the level of individual PV units, photovoltaic units or so-called citizen windmills, but at the scale of the city, the city of Munich owns its utility company and because of that public ownership they have set themselves a vision of becoming 100% carbon neutral with its electricity by 2025. That would have been impossible if it wasn't for public ownership. So all these examples just underscore a unique opportunity our cities provide us with to join up climate policy with other fundamental policy objectives. Philip, thank you very much indeed. I'm very glad that in that last contribution you got close to the democratic issues because I think what we've heard is an exposition about the choices, not just about where people live in cities or in rural communities, but how people live. What we've heard this evening is nothing short of a looming catastrophe and very clear trade-offs. We need renewal of infrastructure but while we renew infrastructure we deteriorate further, progress on climate change. I think that this reflection on the engagement of citizens, people feeling that this is something they must own, the correlation between that being the behaviour of people who are better educated and better paid jobs while poor communities exercise very little choice. I mean I know very well the community you refer to in Mumbai which is an optimistic but subsistence community. I wonder if you'd like to react perhaps Bruce to this question about engagement, personal responsibility, inter-governmental legislation, national legislation. Where does the bite and the leverage come? It's hard to mention national in the United States. Here's the issue. Cities are not governments. The national government is a government. States are governments. They can be hijacked by partisanship in the most parts of the world they are. The typical kind of ideological divisions. Cities are networks. Where you have not just representative democracy but participatory democracy. And that's why a lot of the actions that we've all described which again are not sufficient to have the kind of scale effect you want are happening in cities. In the United States what's essential for these kind of investments or regulatory reforms to happen is for people to make the argument, for leaders to make the argument. Whether it's public, private, civic or otherwise that there's a jobs effect and that there's a capital effect. This is not just environmental imperative but these are the kind of actions that are going to create good and quality jobs that can be coupled with the kind of skills training and education to bring more people into the prosperous economy. So it is particularly important in the United States to make the environmental, economic and social relationships both in general at the policy scale but at the granular level of geography. And so I think that is happening and frankly when you go into any city the kind of conversations that naturally occur in a very integrated way. That doesn't really happen at the national level or at the state level because then there are governments. They have specialized agencies. They have specialized expertise. At the city level it becomes mashed up across sectors, across disciplines. And so I think as we go forward here cities obviously will invent many solutions. They'll innovate on products but they're also going to send a signal higher up the food chain so to speak. I actually think cities are at the top of the food chain that there needs to be an integrated holistic perspective which Nick and Karen really have laid out. But it's hard for, I mean I was in the national government at the federal level for 10 years. Trust me it is so specialized. It is so compartmentalized. The natural relationship between housing and transportation and environment does not occur. At the city level how could it not occur? You live at every single day. So I do think that this network driven perspective and the sort of integration of economic, social and environmental solutions is fundamental to going forward. Thank you. Nick? I think we should also think of aspects of different kinds and often lower level politics. If you look at how the auto rickshaws in Delhi changed to compress national natural gas, it was essentially a legal case brought by a number of people settled in the Supreme Court on the human right to breathe. And they demanded that the auto rickshaws and some of the buses and trucks changed to compress natural gas. And it happened very quickly. Everybody said it's never going to work. The rickshaw drivers are going to stop. Excuse me. Sorry. I'm going to stop. Stop is the air pollution. I'm going to stop everything but it happened very quickly. I've done a lot of work in India over the last more than four decades. And there's one company called Selco which operates in Karnataka centered in Bangalore, one of the cities that Karen was focusing on. And they bring micro finance and small scale solar to people. Much of it is in some of it's in rural areas but much of it's in cities. And those things change understandings. So I think that type of event, whether it's through the courts or it's through entrepreneurship, can be extremely important in changing the way in which people understand and thus the politics. Karen. Well, cities are not going to act on climate change in and of itself. I mean, I think one of the things that really resonated that Phillip said was that it's all about what's happening at the local level. And in the climate change world we think about co-benefits as these other things you get when you also mitigate climate change. You get better health. You get economic development. But that's the co-benefit because your real aim is lowering emissions. But that's not going to make cities act or people act. People act because they want to live in better cities. They don't want to be commuting two hours or three hours. They want to breathe the air. They want to be able to live in safe, pleasant, aesthetically pleasing places. And I think we need a change in language because the co-benefit, if we have sustainable urbanization, is actually mitigating climate change. I would argue that Jane Jacobs is maybe one of the first environmentalists in terms of really linking cities and the environment. Because if you think about the small grid, the walkability, that's really all the features of low-carbon human or urban settlements. Maybe a follow-up. So I think absolutely right and I think probably we need to move from co-benefits to mutual benefits so we lose the directionality. But the question still reminds how can we inspire urban populations with what is possible and what would be so much better. And I think what I pick up a lot is this idea of we need to be more bold and do trials and test certain things, expose people to new experiences. Exposing is critical. They actually can live this new situation. Has anyone since we're doing lots of surveys, has anyone been to the car free day in Paris a few weeks ago, which was a much happier event in Paris? No, well, there were a few. Those that commented on the experience of being in central Paris without any vehicles, out there with kids, with bikes, feeling safe, has been an amazing eye-opener for every single person who has been there. And very successful urban policies that were actually introduced over time go back to those initial moments of getting the buy-in by people emotionally connecting to a new idea how urban life can take place. Thank you. Now, we're going to open this up to you. We've probably got time for four brief contributions and we've got roving microphones. And what we're going to do is take four contributions. I mean, literally 30 seconds each. Have you ever tried to express a view on climate change in 30 seconds? But tonight's your chance. And then I'm just going to ask each of our panellists just to respond to part of the aggregate group of questions. So who would like to start? Yes. Hi. With the responsibility for carbon emissions already generated, falling more heavily on the northern hemisphere, what sort of direct transfer either financially or technologically should there be between cities in the northern hemisphere and cities in the poor global south? The north south reactions. Did you get that? Okay, fine. Thank you very much. Gentleman here in the red jumper. Yeah, hi. Good night. One question maybe for the professor Nicholas Stern regarding the climate change is the biggest externality that some authors have said that there are some ways to mitigate it like taxes, but maybe there are other kinds, other ways to do it. Maybe with people engagement on some economic behavioral movements that are born like nudging. Okay. Thank you. Yes. Crispin, it's coming. I'll hear it. Great. Thank you. We've heard some very good talks covering I think most of the field, but not all of it. One of the things people have not spoken about is the pressure of human proliferation. The increase in the human population bears directly upon all of this. And in my own feelings about this I feel that the first element of trying to persuade not just people or governments but local communities is in fact to show that change is in their interest. That you have to be able to present things in such a fashion that it's in the interest of people to make the changes that we all think desirable. Okay. Thank you very much. And this is our last contribution. Thank you. Could you comment on the relationship between economic inequality and the quality of the environment and the possibility that it's open for mitigation? Okay. Thank you very much indeed. Right, Bruce. I'll try to respond to this because I do think, again, American perspective, we're responsible for the crack up of the great recession. Post recession, what you've seen is an attempt to return to the fundamentals of what drives a modern, sophisticated economy that can great more opportunities for a broader set of its citizenry. Well, what really drives this is advanced kinds of industries that are innovative, sustainable, and ultimately create more and better jobs. And then again training and education that can complement that. The question therefore is can we begin to invest in the clean energy economy at scale through R&D and then through new financial instruments, intermediaries, institutions around sustainable infrastructure and the companies that generally are going to make the sustainable products and create the sustainable services. There is a positive, there isn't essentially an interplay here between innovation, sustainability, and inclusion that needs to be fundamentally understood. And so at this point I think this is really about norms of finance because again it's not the old system of a national government basically doing what I said the first time or in the first statement. Set a price on carbon, tilt the playing field in this direction, that ain't going to happen in the United States. It's going to have to happen through the local and state financing of these disparate kinds of activities that in the end will create the more and better jobs that will send a clear signal that this is something that can relate to people's lives and should be fully politically supported. I'm happy to reinterpret the question about, actually it was for Nick, about what other policies are out there and I did hear you mentioned nudging, that's the one I leave for Nick. But I do think besides policies particularly from a national level that are targeted at the individual, national governments need to take much more serious their frameworks with regards to how cities operate Yes, spatial planning is the number one sort of power of urban governments but they are very much playing a game where the rules of the game are set in most countries at the national level for infrastructure finance and funding and even related to questions around developing new land for your local tax revenue as we have heard it. And by the way this is not just a story in China, it's actually a big issue in my home country in Germany where we still with a stagnating population are developing every day 73 hectares with a goal of 20 hectares. 73 hectares per day, so I don't know how many football, well that's 73 football fields here. But just to give you an idea per year that equals more or less the developed land of a city of Mumbai of 12 million people. And this happens in a country which is aware of the environmental issues, sophisticated democracy, a lot of environmental pressure, good urban planning but the national frameworks are still not up to speed incentivising cities to operate in the right way. The question about cities in the north versus cities in the south and their relative responsibilities, I mean absolutely there are very different responsibilities and very different strategies going forward. Remember I said there are four main drivers of urban emissions, income or socioeconomic factors, technology, the economy and then there's urban form. And for most cities in the not North America but really in the northern hemisphere their urban form has already been built and even though they're adding they're really adding on the fringe. And so when we infill or when we change the urban form in these cities it's really on the margin for cities that are already developed we have to look at those three other things. That's technology changing our maybe changing our economy and then changing our lifestyles. For the developing country cities it's a very different set of challenges and also opportunities and I think this is where the scale of the population comes in. Because if you remember that slide that I showed with the upper middle income greenhouse gas emissions almost at the same level as the higher income countries. So we're going to see that the aggregate effect of these emerging economies is going to be significant simply because of the sheer size. And then there's the lock in effect. Thank you, Nick. Can I take one or two things together? How far do people behave only in their own self interest? How do you get people together to share the benefits of what are good actions for a group as a whole? And some parts of this story I think it's remarkable how people do get together. I mean the fact that you've got a meeting in Paris in a couple of weeks time where people without a global government are getting together to try to do what collectively makes more sense. Is an example of groups getting together going beyond some very, very narrow sense of self interest and looking for a broader scope for community interest. So I actually think we do it injustice to people if we think they behave like the consumer in economics 101 with a single narrow objective perfect information about all the options and prices. And instant calculation of self interest. People do get together in ways. And secondly, that's a sort of a big scale. Incentives do matter, but people see bigger pictures. Another one is the example of getting people to share from the benefits of good infrastructure. I buy my electricity from good energy, you should too. I have no shareholding in the thing. But they've been very good. A lot of it's wind, a lot of it's onshore wind. Now some people don't like onshore wind. And what they do is they get local communities together to discuss how they can share in the benefits. Some cheap electricity, playing fields for the schools. So you can actually structure things in a way that people will see the advantages of acting together. It's a little bit like, although it's too mechanical, one of our LSE Nobel Prize winners, Ronald Coase, thinking about negotiations so that people get together to share the benefit. What you need, I think, is not simply the property rights in the negotiation. That's overly rigid in Ronald Coase. But you can get people to see common and shared interests and look beyond their own very narrow story. And good examples and good behaviour can be catching. Good. Thank you, Nick. Quick, far. Optimist or pessimist? Optimist or pessimist? If you're an urbanist, you're an optimist by definition. I'll give the example of my great, the reply of my great friend Jan Arthus Betran, who made these wonderful books, The Earth from Above, which you've probably seen. And he said it's too late to be a pessimist. Wonderful. Great. Karen, you've already told it. Absolutely optimist. Fabulous. Well, there you are. Listen, thank you all very much indeed. Happy birthday, LSE cities. And thank you all for coming to the party.