Making Minty Fresh Music With Markov Chains: The After Eight Step Sequencer

Step sequencers are fantastic instruments, but they can be a little, well, repetitive. At it’s core, the step sequencer is a pretty simple device: it loops through a series of notes or phrases that are, well, sequentially ordered into steps. The operator can change the steps while the sequencer is looping, but it generally has a repetitive feel, as the musician isn’t likely to erase all of the steps and enter in an entirely new set between phrases.

Enter our old friend machine learning. If we introduce a certain variability on each step of the loop, the instrument can help the musician out a bit here, making the final product a bit more interesting. Such an instrument is exactly what [Charis Cat] set out to make when she created the After Eight Step Sequencer.

The After Eight is an eight-step sequencer that allows the artist to set each note with a series of potentiometers (which are, of course, housed in an After Eight mint tin). The potentiometers are read by an Arduino, which passes MIDI information to a computer running the popular music-oriented visual programming language Max MSP. The software uses a series of Markov Chains to augment the musician’s inputted series of notes, effectively working with the artist to create music. The result is a fantastic piece of music that’s different every time it’s performed. Make sure to check out the video at the end for a fantastic overview of the project (and to hear the After Eight in action, of course)!

[Charis Cat]’s wonderful creation reminds us of some the work [Sara Adkins] has done, blending human performance with complex algorithms. It’s exactly the kind of thing we love to see at Hackaday- the fusion of a musician’s artistic intent with the stochastic unpredictability of a machine learning system to produce something unique.

Thanks to [Chris] for the tip!

Continue reading “Making Minty Fresh Music With Markov Chains: The After Eight Step Sequencer”

Ask Hackaday: Why Make Modular Hardware?

In the movies, everything is modular. Some big gun fell off the spaceship when it crashed? Good thing you can just pick it up and fire it as-is (looking at you, Guardians of the Galaxy 2). Hyperdrive dead? No problem, because in the Star Wars universe you can just drop a new one in and be on your way.

Of course, things just aren’t that simple in the real world. Most systems, be they spaceships or cell phones, are enormously complicated and contain hundreds or thousands of interconnected parts. If the camera in my Samsung phone breaks, I can’t exactly steal the one from my girlfriend’s iPhone. They’re simply not interchangeable because the systems were designed differently. Even if we had the same phone and the cameras were interchangeable, they wouldn’t be easy to swap. We’d have to crack open the phones and carefully perform the switch. Speaking of switches, the Nintendo Switch is a good counterexample here. Joycon break? Just buy a new one and pop it on.

What if more products were like the Nintendo Switch? Is its modularity just the tip of the iceberg?

Continue reading “Ask Hackaday: Why Make Modular Hardware?”

Imaging The Past With Time-Travel Rephotography

Have you ever noticed that people in old photographs looks a bit weird? Deep wrinkles, sunken cheeks, and exaggerated blemishes are commonplace in photos taken up to the early 20th century. Surely not everybody looked like this, right? Maybe it was an odd makeup trend — was it just a fashionable look back then?

Not quite — it turns out that the culprit here is the film itself. The earliest glass-plate emulsions used in photography were only sensitive to the highest-frequency light, that which fell in the blue to ultraviolet range. Perhaps unsurprisingly, when combined with the fact that humans have red blood, this posed a real problem. While some of the historical figures we see in old photos may have benefited from an improved skincare regimen, the primary source of their haunting visage was that the photographic techniques available at the time were simply incapable of capturing skin properly. This lead to the sharp creases and dark lips we’re so used to seeing.

Of course, primitive film isn’t the only thing separating antique photos from the 42 megapixel behemoths that your camera can take nowadays. Film processing steps had the potential to introduce dust and other blemishes to the image, and over time the prints can fade and age in a variety of ways that depend upon the chemicals they were processed in. When rolled together, all of these factors make it difficult to paint an accurate portrait of some of history’s famous faces. Before you start to worry that you’ll never know just what Abraham Lincoln looked like, you might consider taking a stab at Time-Travel Rephotography.

Amazingly, Time-Travel Rephotography is a technique that actually lives up to how cool its name is. It uses a neural network (specifically, the StyleGAN2 framework) to take an old photo and project it into the space of high-res modern photos the network was trained on. This allows it to perform colorization, skin correction, upscaling, and various noise reduction and filtering operations in a single step which outputs remarkable results. Make sure you check out the project’s website to see some of the outputs at full-resolution.

We’ve seen AI upscaling before, but this project takes it to the next level by completely restoring antique photographs. We’re left wondering what techniques will be available 100 years from now to restore JPEGs stored way back in 2021, bringing them up to “modern” viewing standards.

Thanks to [Gus] for the tip!

Continue reading “Imaging The Past With Time-Travel Rephotography”

Python Will Soon Support Switch Statements

Rejoice! Gone are the long chains of ifelse statements, because switch statements will soon be here — sort of. What the Python gods are actually giving us are match statements. match statements are awfully similar to switch statements, but have a few really cool and unique features, which I’ll attempt to illustrate below.

Continue reading “Python Will Soon Support Switch Statements”

Bringing Some Coulter To The Bench: Measuring Tiny Particles With Nanopore Sensing

We’ve all been there: you’re sitting at your bench, with a beaker full of some conductive fluid with a bunch of tiny particles suspended in it, and you want to measure the sizes of each particle.

Okay, maybe this isn’t a shared experience we’ve all had, but It’s at least an ordeal Hackaday alum [Nava Whiteford] has been through, and he was able to carry out the measurements in question using a neat apparatus known as a Coulter counter.

Imagine a container full of a conductive fluid. If you place an electrode at each end, the fluid will carry a current. Now, drop an insulating divider in the middle of the container, and the current will stop flowing. Finally, poke a small hole (or nanopore) in the divider. Huzzah! The current is flowing again… but how does this let us measure particle sizes? Well, now think about a tiny particle moving through the hole in the divider. As the particle passes through, the hole will be partially blocked, and the current flow will be partially interrupted. It turns out, the resulting dip in current is proportional to the volume of the particle — a fun property known as the Coulter principle.

[Nava] built a great demo of the system with a macropore in place of the nanopore. The pore in question was a hole melted into a bottle cap, which was suspended in a beaker by two toothpicks. [Nava] used small chips of Acrylic as the particles to be measured, which they pipetted into the solution of KCl. They then passed a current through the solution and used an oscilloscope to sense the interruptions. Be sure to check out their write up for a video of the system in action!

Of course, this technique has a much wider range of applications than measuring little bits of plastic — obtaining blood cell counts, for one. We’ve seen particle counters for use in the air before, but it’s great to see that there’s a way to measure particles in an aqueous solution —  you know, in case we ever find ourselves in such a situation.

Sea Level: How Do We Measure Global Ocean Levels And Do Rising Oceans Change That Benchmark?

Every summer you go down the shore, but lately you’ve begun to notice that the beach seems narrower each time you visit. Is that the sea level rising, or is the sand just being swept away? Speaking of sea levels, you keep hearing that they rise higher every year — but how exactly is that measured? After all, you can’t exactly use a ruler. As it turns out, there are a number of clever systems in place that can accurately measure the global sea level down to less than an inch and a half.

Not only are waves always rippling across the ocean’s surface, but tides periodically roll in and out, making any single instantaneous measurement of sea level hopelessly inaccurate. Even if you plan to take hundreds or thousands of measurements over the course of weeks or months, taking the individual measurements is still difficult. Pick a nice, stable rock in the surf, mark a line on it, and return every hour for two weeks to hold a tape measure up to it. At best you’ll get within six inches on each reading, no matter what you’ll get wet, and at worst the rock will move and you’ll get a damp notebook full of useless numbers. So let’s take a look at how the pros do it.

Continue reading “Sea Level: How Do We Measure Global Ocean Levels And Do Rising Oceans Change That Benchmark?”

Continuous Excitation Piano Machine Looks Nervous, Sounds Grand

It’s not every day we see a grand piano with a Raspberry Pi inside, let alone one with 96 motors, but sometimes we get lucky. The contraption in question is one developed by [Konstantin Leonenko], as part of a collaboration with composer [Patricia Alessandrini] for a piece she created inspired by Ada Lovelace. Specifically, [Patricia] was inspired by Ada’s idea that an “analytical machine” would, someday, be able to create music on its own. [Konstantin] and [Patricia] worked together to make a machine that would learn from it’s human co-performers and create music with them.

Their creation, rather than just one tricked-out keyboard, is actually a portable attachment that can be easily fitted to any grand piano. Each of the device’s 96 motors drives a plastic “finger” that excites the piano’s strings. The result is a sound unlike any other — and you really need to experience it so click through that link at the top for the demo video.

Rather cleverly, the fingers are designed such that their dynamics help to mask the sound of the motor (a must for performances) while simultaneously enhancing the string’s timbre. Like any project, this one went through a number of iterations over the two-year design process, and even spun off into an entirely new, glove-based version.

We’ve seen some awesome music tech hacks, and this one fits right in with the rest. It’s always exciting to see an instrument as ubiquitous as the piano be used in new and refreshing ways. Be sure to check out the link at the top for a video of this incredible instrument in action!