Categories
Uncategorized

DotBot (Another Mastodon Bot)

Well, it’s been two weeks since I wrote about the @WeShouldBuild bot on Mastodon and somehow I created another bot. This one is called @DotBot and it creates a new piece of dot-based art once per day. (You can see an example above.)

I once again used Mastodon.py for this (GitHub and Docs) and there are twice as many lines of code for this one, which is still less than 50 lines. This one generates an image, saves it to disk, then posts that along with a small amount of text. A cron job kicks things off at 8:30am CST every day.

As for these dots? I realized it’s something I’ve been toying with for over a decade!

The image above was generated with a Processing sketch in April 2011. At that point I had probably been using Processing for less than a year. I had a lot of fun exploring creating images with code.

Here’s some fun I had with the images being projected onto a large while wall and taking photos of myself in front of it.

I found a folder dated September 2017 that had a bunch of generated images which I think I may have compiled into a video with each image being a frame. (I’ve done this other times, I just can’t find an output file for these. I probably did them last minute for the Maker Faire Milwaukee Dark Room and never got a chance to document them!)

I did find these images in the folder though… Not sure what I was doing, but I like it. If I had to dig up some related things I’d pick annular (more info) from 2013 and maybe Shape Grid Circles from 2019. I realized there are a few other related things but maybe they warrant their own post. Especially if I can find the videos. (If not, I can recreate them.)

Okay, that went a bit off course (of course) but the important thing is, if you’re on the Fediverse and want to see new dot-based colorful art each day, just follow @dotbot@botsin.space

And if you’re not on the Fediverse you can still get the RSS feed! Just grab https://botsin.space/@dotbot.rss

Categories
Uncategorized

SoundProp – Sound Effects with Processing & MIDI

Sometimes you forget to document things, and sometimes you try to get ahead of the game. Back around 2009 I was one of the organizers of Web414, Milwaukee’s Web Community Meetup, and at some point Gabe and I turned it into a live talk show. Yeah, I don’t know how we managed to do that, but… it happened. We had guests and we interviewed them, and even had a musical guest once! Anyway, one of the things I did was add sound effects to things because… well, I love that kind of shit. So yeah, my first “Sound Effect Board” was a web page on my web site I called ShowProp which used Flash to play some sound effects at the push of a button. (Still there, still mostly works. Here’s another silly web/sound thing from 2010, Evil-O-Mator.)

Where was I? Oh yeah, sound effects! Typically I was the co-host while Gabe was the primary host, so I would work the sound effects board at the appropriate (or inappropriate time.) It was fun.

And then I started messing around with Processing in 2010 and eventually started a re-write of ShowProp that would run locally on my computer rather than a Flash-enabled web page. (Flash is Dead! Sort of…) Processing is still very much alive, and I use it fairly often for creative coding, and hey, I figured since it’s 2020 it was time to update things.

I should mention that in 2019 I got my first “real” MIDI device, an Arturia Beat Step. A local synth guy was selling it for… wow, less than half the price of a new one. (I guess I got a deal!) I say my first “real” MIDI device because I’ve built them before, for myself, for museum exhibits, etc. but I had never bought a commercial unit before. Since I had this around, and I enjoy screwing around with MIDI, I dug into MIDI support in Processing, and…

I ended up redoing my old ShowProp sketch to be SoundProp, which is a Processing sketch that accepts MIDI input and plays sounds. It’s the second fanciest sound board style device I’ve used this year. (Yeah, I use others.) I also discovered the sound playing capabilities of Processing have greatly improved over the years, so that was an added bonus.

So basically, my sketch has a bunch of audio files, and each is mapped to a MIDI pitch which is sent by one of the 16 pads. Now, because it’s MIDI and not key commands it always works, no matter what application is in the front. No fumbling around to pull up the right window before you press a key or click a mouse. All the Sounds! All the Time!

The UI is quite minimal. It’s just a window that is 250 pixels by 130 pixels. I typically just launch the application and minimize it. (And hey, this will run as a native—well, Java—application on macOS, Windows, and Linux… in theory.)

If I get around to it I’ll clean it up and upload the code, and maybe create a video showing it work, though it’s not really that exciting, but hey… 2020, whaddaya want!?

Categories
Uncategorized

Reflect-O-Scope

The Reflect-O-Scope was an interactive museum exhibit I worked on a few years ago. It was a fantastical machine that allows users (typically children) to slide materials under a microscope and examine them. The materials were from the sponsor of the exhibit and consisted of specialty tape materials adhered to plastic boards.

One of the original ideas was to allow for focusing, but that got scrapped. We figured kids would put almost anything under a microscope, their hand, their little sister, etc. Focusing meant a moving mechanism, and it was deemed to complex at the time.

The sculptural build was done by John McGeen and Austin Boechler. My focus was on the hardware and software. There’s a USB microscope connected to a computer and then a small HDMI display in the “goggle” shaped piece that the user looks into. It’s all a bit “periscope” like in design.

The original design also had a secondary monitor (a large TV) that would be mounted further away, so people could see weird things on the TV and it would draw them over. Lots of features got killed due to lack of time or other reasons. Most of what you see on a museum floor probably started out a lot more complex when originally designed, and then simplified as time goes on.

I wrote the software, which is just an application written in Processing that automagically launches at boot up, runs full screen, and shows the output from the USB microscope. There’s also a companion application called “List Cameras” that can display all the connected USB cameras and all of the possible resolutions they support. This is there in case the USB microscope ever needs to get replace. The exhibit tech just needs to run the application and then edit a config file. No recompiling of the application is necessary.

One more fun addition was a white plastic tube running along the outside with some NeoPixels in it featuring some funky color runs to add to the fantastical nature of the piece.

One of the nice things about this component was that the software was created in-house, so the component could be replicated easily without additional license fees. (We had an amazing software partner we used for the complex things, but simple stuff was done, when possible, in-house by the tech team, which was basically me.)

Categories
Uncategorized

Shape Grid Circles

example-001

I love plotters and plotter art and if you’re into robots or other machines that draw, you should check out #PlotterTwitter and DrawingBots.net

example-002

While I’m still working on my new plotter (which is really an old HP7475A) I figured I’d have fun with Processing and write some code to generate some nice vector art. This is something I do every now and then. I’m someone who believes in writing code for pleasure, and sometimes I actually do that!

example-003

I’ve also released this code in case someone else wants to generate some art for use with their own plotter or whatever device they have that can do something with it. (Like a laser cutter, for instance.) And yes, the sample images you see on the page were generated by the sketch. There are a few variables you can change to adjust things, like the spacing between circles, steps between circles inside of circles, and setting the limit on the smallest circle.

example-004

You can find the code on GitHub: Shape-Grid-Circles.

If you make something cool with this code, let me know! I’d love to see what you come up with.

Categories
Uncategorized

Rectangle Chaos

rects-01

I started playing around with the #plottertwitter thing and wanted to do some creative coding with Processing, and at least one person asked about the code, so I’ve included it below.

rects-02

Instead of drawing a rectangle, I’m creating a shape, and then varying the position of it a bit more with each row that is drawn. I reused some code I’ve used plenty of times before that keeps track of where things are drawn so the code knows when to start a new row, and when the screen is filled. After it draws a screen full it will save a PDF and exit.

Once you have a PDF (which is a vector file) you can make your plotter (or laser cutter, or CNC machine) do what you want with it. I typically bring the PDF into Inkscape and make any adjustments needed before I save it out in a format suitable for the machine I’ll be sending it to.

Find the code on GitHub: Rectangle-Chaos

If you make something cool with this code, let me know! I’d love to see what you come up with.