egghead.io developer chats

Learning and Experimenting with Physical and Digital Mediums with Keith Peters

Episode Summary

Today Keith Peters walks us through his experiences with getting books published, experimenting with code and math for the last two decades, and his time spent working in physical mediums like woodworking and blacksmithing.

Episode Notes

Keith Peters joins us today to talk about his experiences with experimenting with code and math, the transition from Flash to Go, woodworking and blacksmithing, and getting books published.

Keith talks to us a bit about multi trochoids; they're what happens when you take a circle and roll it around something, like a spirograph. He was inspired to do this project by Sodaplay, a site back in the flash days that had stuff you could hook up to various engines.

What language did Keith use to write his multi trochoid experiments? Initially, Keith wrote it in Go, but he wanted to put it out on the web and make it interactive, so he ported it to Javascript.

Back in the 90s Keith worked with Flash, when Flash left he moved over to Javascript and using the html5 canvas. Javascript is great if you want it live on the web but for still images and animations it was a pain in the neck, so Keith tried out Rust, Python, and finally settling on Go.

Keith is into some non-coding hobbies like woodworking and knife making, Joel has even bought some of his knives. It started when Keith wanted to build an arcade cabinet, he bought tools and got into learning how to use them. Keith has found a lot of crossover with working with his hands and building things with code, both of them can be boiled down to learning a technology to create things and solve problems.

Finally, Keith explains the pros and cons of going through a publisher to get your book out. He says that self-publishing is easier than ever, but a publisher provides you with a lot of assistance with editing, marketing, artwork, and a healthy dose of pressure.


Transcript

"Learning and Experimenting with Physical and Digital Mediums with Keith Peters" Transcript

Resources:

Keith Peters:

John Lindquist:

Episode Transcription

John Lindquist: My guest today is Keith Peters, you may know him as bit101. If you Google Bit-101, you'll find all of his stuff. He's written nine books that I could find on Amazon. Maybe more?

Keith Peters: Yeah. I think it's probably up around 15, but sure.

John Lindquist: 15, yeah. Which blows my mind. I've made it through one chapter of my own book and then gave up. So, 15 books, yeah.

John Lindquist: He created Gif Loop Coder, has a video series on coding math on YouTube. He's created lessons with us on Egghead, and has created many wonderful experiments throughout the years.

John Lindquist: So, Keith, thanks for being here.

Keith Peters: Yeah, thanks for having me.

John Lindquist: I just have to throw out my opening question, what is a multi-trochoid?

Keith Peters: Yeah, I guess I had mentioned that on Twitter the other day. A trochoid is basically if you take a circle and roll it around something and, well, you've played with a Spirograph before, right?

John Lindquist: Yeah, yeah, yeah.

Keith Peters: That's basically a trochoid. You take a circle and roll it around another circle and trace the path it makes and you get all these kind of weird spirals. And then you have to insert the other circle. It can be inside the larger circle or outside. So you get epitrochoids, your hypotrochoids and you could have circles around circles, around circles. That'd be a multi-trochoid.

John Lindquist: Yeah, the shapes you make on those little videos you post, they look incredible. They're just fun to sit there and watch.

Keith Peters: Yeah. Yeah I'm hoping on making a interactive version soon.

John Lindquist: Oh, cool.

Keith Peters: Where you can actually program it and change the sizes, and speeds and shapes and stuff.

John Lindquist: Did you see a real-world machine that inspired you to do that? Or did it just come, where'd you get the idea?

Keith Peters: Back in the early Flash days, there was a site called soda play. Soda, like, soda pop. And it basically had stuff like that that you could hook up these various engines. I forget what exactly it did. But it left an impression. I've always wanted to do something like that. And it just kind of came out in the last couple of weeks.

John Lindquist: I couldn't quite piece together, I saw you were talking about porting it to a Java Script, or are you working with this stuff in Go? Or Java Script?

Keith Peters: Yeah. I'd originally written it in Go, Go language, using Kyrographics, which is a 2D drawing API C library that you can link to from Go. And just using that to make the series of still images that I would convert into an animated gif. I realize it'd be a lot funner if it were an interactive piece on the web. So, I poured it all over to Java Script.

John Lindquist: Are you working with Go in your day-to-day job? What part about the [crosstalk 00:03:09]-?

Keith Peters: No. We're not working at Go on my job. As you know, I got started back in the late '90s in Flash, had a nice, long run on that. When Flash kind of went it's way, I switched over to Java Script for the most part, Canvas, HTML5. Done that for quite a few years. And I was just looking for something different. When you're creating graphics and animations in Java Script, it's great if you want them to be like, live on the web, interactive kind of things. But if you want to save them as images or animations, you get the whole browser you're working through and it can be a big pain in the neck. So I was looking for other languages that you could compile and run stuff locally on your machine. It could save a file directly to the machine. It could run other tools if it needs to do that.

John Lindquist: Got you.

Keith Peters: I played with Rust a little bit. I played with Python. And then I got into Go and just really started liking it.

John Lindquist: Cool.

John Lindquist: You mentioned that you started in the late '90s. Now, if I had to guess, I'd say you're probably the person who has the most experiments on the web, in the world. I tried to look back through the history of BIT-101 and I think it went back 17 years or something. For a long time you were doing daily little experiments, and balls bouncing around in physics, and triangles spinning. And I think we've all been through the arrow phase, when arrows would follow things or whatever.

Keith Peters: Mouse chasers.

John Lindquist: Yeah. Mouse chasers, and on and on and on.

John Lindquist: How do you keep coming up with all these ideas? How do you keep that kind of passion alive to keep on experimenting? I think there's quite a few people like myself who used to play and kind of lost the drive or motivation to play and have a humdrum, doldrum life now. I don't know.

Keith Peters: Yeah. I definitely have had slumps throughout the years. Particularly, like I said, when Flash ended and I switched over to Java Script, and was doing things in Canvas. And then, I realized that everything I was doing, I was just recreating stuff that I had done in Flash years ago, and kind of went through a slump from that for a while. But, I'm always looking at other people's work. A lot of what I do, too, is I just kind of troll Wikipedia, or Wolfram, the math site, and you know, look at different formulas, and shapes, and curves and stuff. And you say, "Wow. That looks really cool. I wonder if I could implement that formula in code". And then, usually it's pretty doable.

Keith Peters: A lot of it's like combining different techniques for me. You know, you have a Perlin noise flow or something, and then ... Okay, well everyone is done drawing a bunch of lines based on the Perlin noise flows. That's kind of boring, or circle packing. So there's all these canned techniques. But if you start taking a little bit of this and combining with a little bit of that, you wind up doing something that maybe nobody else has ever done before. The results can be really surprising. Sometimes that just kicks off a whole chain of ideas that keeps me going for a few weeks.

John Lindquist: It's funny how concepts like even sine and cosine are boring. But once you start moving a dot along it and it's animated, and things start spinning along it, you're like, "Hey, this is visually interesting, and even educational sometimes".

John Lindquist: So, you mentioned there's a few people out there who you follow. Is there anyone you can recommend?

Keith Peters: I don't know. I have a list. I started using Twitter lists, and I have this generative art list that I use. I don't even know how to say some of the names. But, Matt Des ... something.

John Lindquist: Do you know the name of the list, by chance?

Keith Peters: I just call it Gen Art. It's my own list.

John Lindquist: Okay. So, under your account?

Keith Peters: I can give you a link later if you want to throw it up there.

John Lindquist: Yeah, cool. We'll put it in the ...

Keith Peters: You know, Mario Klingemann, Matt DesLauriers, that's who it is, bunch of other people, though.

John Lindquist: Yeah. And they're making careers out of some of this stuff, right?

Keith Peters: Yeah. I don't know. I've never gotten into it so deeply where I start doing shows and stuff like that.

John Lindquist: Right.

John Lindquist: Have you put stuff to music before, like some of these others have?

Keith Peters: A little bit. I've experimented with that. Nothing that I've really put out there, though.

John Lindquist: I see you sharing your work on Mastodon. Is that a fairly recent transition? I don't know whether that was over the fidelity or quality differences of what you could share?

Keith Peters: I don't know what happened. I guess something happened. There was like some kind of protest or quick Twitter day or something, a few weeks back.

John Lindquist: Oh, yeah, yeah, yeah. Right, right, right.

Keith Peters: I wasn't really aware of it, but I noticed suddenly, everyone started jumping back on the Mastodon wagon. Which, I had signed up for a year or two ago, or whatever, and forgotten about. But yeah, I kind of had a lot of people seemed to be more active on there. So I started checking that out as well. Yeah, they do better on the quality. If you post a gif on twitter, they compress the hell out of it.

John Lindquist: Right.

John Lindquist: I know you've been into knife making and woodworking. I know Joel has bought some of your knives before. Is that something you're still doing? Can you help us geeks who have hobbies of coding. We work and we do code, and our hobbies are code, how do we get into these other non-coding hobbies?

Keith Peters: Yeah. I'm not actively doing that, but I do have all the stuff. And I'm sure I'll get back into it at some point. Actually, the way that all started was, I wanted to make an arcade machine ... you know, like the old retro arcades, and I had no idea how to do that so I started learning some woodworking stuff. And I bought some power tools and stuff, and wasn't really feeling that. Then I learned about hand tool woodworking which is just like hand planes and hand saws, no electricity or anything and that really intrigued me.

Keith Peters: So I started buying all these old tools off flea markets and Ebay and stuff like that. It's really cool, collecting these things and restoring them. One of the pieces, I needed a little metal blade on this particular plane that was missing. So, I realized that I could buy a piece of steel and grind it, file it into the right shape. And then, I learned how to harden it by heating it up and then quenching it. And that was pretty cool. Then I said, "Wow. These are all the steps you need to make a knife". I bought a couple books, learned how to make knives, and did that for a year, year and a half. That was really fun.

John Lindquist: That's fascinating.

Keith Peters: Then I got into blacksmithing for a little while. I took some courses on that. That was a blast.

John Lindquist: Did you make any swords, or morning stars? What did you ...?

Keith Peters: No. That was just for decorative stuff. I think one of the coolest things I made was these bottle openers. It's a dragon, his mouth is the bottle opener. Those were really fun to make and they look cool.

John Lindquist: Oh, cool.

Keith Peters: I made a bunch of them and gave them away as Christmas gifts a couple years ago.

John Lindquist: Did you ever get around to that arcade, finishing that?

Keith Peters: I never did. It sits unfulfilled.

John Lindquist: Yeah. I guess it's job was to inspire you to do something different.

Keith Peters: Exactly.

John Lindquist: Kind of like, I went to college for an English degree and that inspired me to not do that.

John Lindquist: Have you found any crossover between working with your hands and building things, and building things in code?

Keith Peters: Oh, totally, yeah. It's something I thought about a lot. Just learning skills and the realization that anything is basically learnable. Everything's a technology, like cutting a piece of wood, or shaping a piece of wood, or shaping a piece of metal. People have figured out how to do that and there's a technology for that. And you can learn that, and you can do it. The same way with code, if you want to build something, people have figured out how to build particular things in these, our design patterns or our libraries, and stuff like that. People know how to do this, and you can learn how to do that.

Keith Peters: The one thing I think that's really different, I think the starkest different is, when you're working physical materials is no undo button, or version control. If you screw something up, or cut too much off, or whatever, you got to start over.

John Lindquist: I could definitely use an undo button in the kitchen. A lot of coders I know, they talk about how cooking is a therapeutic thing for them. But I get in there, it just stresses me out. Because I know I can't undo it.

John Lindquist: Anything else you're working on right now that we should look forward to?

Keith Peters: I've got two, at least a couple books that I'm thinking about doing.

John Lindquist: Oh, really?

Keith Peters: Yeah. A few years ago, I self-published a book on coding fractals, and strange attractors, and stuff, in Java Script.

John Lindquist: Where can someone buy that if they're interested?

Keith Peters: It's on Amazon. It's called, Playing With Chaos. It's a Amazon Kindle book, but it's also on Gumroad.

John Lindquist: Yeah.

Keith Peters: If you buy it on Gumroad, you get three versions, DRM-free. I think it's cheaper too, so that's what I would go for. Also, the website actually has all this, playingwithchaos.net .

John Lindquist: Okay. Cool.

Keith Peters: But I had some other ideas for doing curves. Actually, getting back to the trochoids, bringing it back full circle, as it were. There's all these ...

John Lindquist: You can't just drop that level of pun and keep going.

Keith Peters: Sorry.

John Lindquist: That was incredible. I am bowing down right now to that pun.

Keith Peters: I did not intend that.

John Lindquist: That was, wow. I am like, reeling here. That was amazing.

Keith Peters: I thought that was good. Sometimes the universe just works out.

Keith Peters: Anyway, there's all these different curves and spirals, and sine waves. I just started cataloging all these cool curves you can create with code. There's a whole bunch and they're really fun to code. I probably started this project about four times. So maybe someday I'll actually get a book out the door on it.

John Lindquist: Do you have any advice for someone who's looking to write a book? You have the experience, I know. Many people have tried, and few have succeeded.

Keith Peters: Yeah. A little while ago I would have said self-publishing is the way to go. When I first started writing, that wasn't a real option. You really needed a publisher to get your stuff out there. And now with E-books, and Kindle, and everything else, so many different publishing platforms, the business of self-publishing is really easy. But actually getting a book done by yourself, with no one emailing you every other day saying, "Where's chapter three? You're late", that's really hard. And plus, you get the editor, and the copy reviews, and the code reviews, and the art work, and the layout and all that stuff.

Keith Peters: So, if you can get a publisher to work with you ... People like to complain about publishers, but they do provide a lot, the marketing and all that, getting it out there, pushing it and getting the sales.

John Lindquist: So is that the key? Take the advance, and then you got the pressure?

Keith Peters: Yeah. Exactly.

Keith Peters: I mean, you know, if you think you can do it and you're willing to wear all those hats, self-publishing is great, as well. But, I wouldn't throw away the publisher idea because publishers are evil or something. They actually provide a lot of value.

John Lindquist: Right. Yeah, I have a few friends who want to work on their own projects and they hire a coach, for lack of a better term. And that coach tells them what they already know, but they give them that pressure. Like, "I'm paying this person to make me do things". I'm like, "I guess that makes sense".

Keith Peters: Yeah. Now, Playing With Chaos book, I did hire a copy editor just to double check. I think my grammar's pretty good. So I hired a person and she went through, fair amount of stuff that I wouldn't have caught. So it was worth it.

John Lindquist: Cool.

John Lindquist: All right. Well, I think we can wrap it up there. That was a wonderful conversation.

Keith Peters: Great.

John Lindquist: Thanks for your time today, Keith.