In 2016 artist Margaret Berry and I started talking about ways to bring together computer animation and traditional art. While at a microcomputer workshop I saw a demo of work an artist was doing that incorporated light emitting diodes and pressure sensors to create dynamically changing effects on paper. One example was a electronic circuit painted onto a paper substrate, along with sensors that could detect changes in air pressure. When the observer blows on the dandelion, the seed puffs explode and spread across the scene.

Margaret had the idea of doing interactive fireflies in a cornfield. We discussed ways to animate the fireflies and provide some form of interaction with the viewer. We decided to build a small test version, but left the motion sensor idea for a later version. She created the encaustic abstract cornfield that was applied to a sheet of plexiglass and made translucent. My job was to figure out how to animate the fireflies.

I started with a grid of Neopixel LEDs and a Raspberry Pi 3, using a Fadecandy board to control the pixels.

I wanted to animate both the fireflies and a day/night cycle. I first modeled the daily cycle in a spreadsheet. I wanted to add some randomness and variability to it so it wouldn’t just repeat the same scene endlessly. I added variables for weather and opacity. Each “day” began with a new simulated weather report. The software would decide whether it would be clear or partly cloudy and if the atmosphere was hazy. It then determined appropriate values for the color of the sky and would ramp up the colors at sunrise and sunset, selecting sunset colors based on the daily simulated weather report.

When night came, it would create fireflies. Rather than just a simple random sequence of dots, the software simulated individual fireflies as objects. In programming terms, it picked a target range for the number of fireflies to display at any given time, then started creating virtual fireflies. Each firefly has a limited time to live. They appear, brighten and dim, then expire. The software creates more fireflies at random locations until it hits the target number, then waits for some of them to expire before creating more. It also selects a mix of colors for the firefly population. Over the course of the simulated night, fireflies come and go in a random pattern that will never repeat. As morning comes, the number gradually diminishes as it gets brighter. The simulated sun comes up and the viewer sees another day with a different pattern of clouds and sky colors, then evening comes with a unique pattern of sunset colors and then the fireflies return.

The program starts with a random number “seed” based on the current time in milliseconds, and then generates other random numbers and parameters that are pseudorandom but based on the initial randomized value. Although it’s possible that a pattern could repeat, it could take years for that to happen.

Someday we will need to build version two. I’d like to build a much larger version that incorporates motion sensors so the fireflies would react to the motion of people standing or walking past the frame.

This unit was acquired by Anna Nolan and Allen Covault of David City, Nebraska. It can be seen at their private gallery next to the Bone Creek Museum of Agrarian Art.