Stanislaw playing notes on his MIDI keyboard, with the LEDs on the LED strip lighting up right above the note he's playing, driven by the Raspberry Pi that runs a script based on the Pianolizer toolkit

Pianolizer Helps Your Musical Projects Distinguish Notes

[Stanislaw Pusep] has gifted us with the Pianolizer project – an easy-to-use toolkit for music exploration and visualization, an audio spectrum analyzer helping you turn sounds into piano notes. You can run his toolkit on a variety of different devices, from Raspberry Pi and PCs, to any browser-equipped device including smartphones, and use its note output however your heart desires. To show off his toolkit in action, he set it up on a Raspberry Pi, with Python code taking the note data and sending color information to the LED strip, displaying the notes in real time as he plays them on a MIDI keyboard! He also created a browser version that you can use with a microphone input or an audio file of your choosing, so you only need to open a webpage to play with this toolkit’s capabilities.

He took time to make sure you can build your projects with this toolkit’s help, providing usage instructions with command-line and Python examples, and even shared all the code used in the making of the demonstration video. Thanks to everything that he’s shared, now you can add piano note recognition to any project of yours! Pianolizer is a self-contained library implemented in JavaScript and C++ (which in turn compiles into WebAssembly), and the examples show how it can be used from Python or some other language.

[Stanislaw] also documented the principles behind the code, explaining how the note recognition does its magic in simple terms, yet giving many insights. We are used to Fast Fourier Transform (FFT) being our go-to approach for spectral analysis, aka, recognizing different frequencies in a stream of data. However, a general-purpose FFT algorithm is not as good for musical notes, since intervals between note frequencies become wider as frequency increases, and you need to do more work to distinguish the notes. In this toolkit, he used a Sliding Discrete Fourier Transform (SDFT) algorithm, and explains to us how he derived the parameters for it from musical note frequencies. In the end of the documentation, he also gives you a lot of useful references if you would like to explore this topic further!

What are you going to build with this? Maybe, a box that records you playing the flute and instantly turns it into sheet music? Or, perhaps, an AI that continues the song for you when you stop?

Continue reading “Pianolizer Helps Your Musical Projects Distinguish Notes”

Fourier Transforms (and More) Using Light

Linear transforms — like a Fourier transform — are a key math tool in engineering and science. A team from UCLA recently published a paper describing how they used deep learning techniques to design an all-optical solution for arbitrary linear transforms. The technique doesn’t use any conventional processing elements and, instead, relies on diffractive surfaces. They also describe a “data free” design approach that does not rely on deep learning.

There is obvious appeal to using light to compute transforms. The computation occurs at the speed of light and in a highly parallel fashion. The final system will have multiple diffractive surfaces to compute the final result.

Continue reading “Fourier Transforms (and More) Using Light”

Even Faster Fourier Transforms On The Raspbery Pi Zero

Oftentimes in computing, we start doing a thing, and we’re glad we’re doing it. But then we realise, it would be much nicer if we could do it much faster. [Ricardo de Azambuja] was in just such a situation when working with the Raspberry Pi Zero, and realised that there were some techniques that could drastically speed up Fast Fourier Transforms (FFT) on the platform. Thus, he got to work.

The trick is using the Raspberry Pi Zero’s GPU to handle the FFTs instead of the CPU itself. This netted Ricardo a 7x speed upgrade for 1-dimensional FFTs, and a 2x speed upgrade for 2-dimensional operations.

The idea was cribbed from work we featured many years ago, which provided a similar speed up to the very first Raspberry Pi. Given the Pi Zero uses the same SoC as the original Raspberry Pi but at a higher clock rate, this makes perfect sense. However, in this case, [Ricardo] implemented the code in Python instead of C as suits his use case.

[Ricardo] uses the code with his Maple Syrup Pi Camera project, which pairs a Coral USB machine learning accelerator with a Pi Zero and a camera to achieve tasks such as automatic licence plate recognition or facemask detection. Fun!

Real Spectrum Analysis Goes Virtual

One of the hard things about electronics is that you can’t really see the working parts without some sort of tool. If you work on car engines, fashion swords, or sculpt clay, you can see with your unaided eye what’s going on. Electronic components are just abstract pieces and the real action requires a meter or oscilloscope to understand. Maybe that’s what [José] was thinking of when he built a-radio. This “humble experiment” pipes a scan from a software-defined radio into VR goggles, which can be as simple as a smartphone and some cardboard glasses.

The resulting image shows you what the radio spectrum looks like. Granted, so will a spectrum analyzer, but perhaps the immersion will provide a different kind of insight into radio frequency analysis.

Continue reading “Real Spectrum Analysis Goes Virtual”

Talking Head Teaches Laplace Transform

Most people who deal with electronics have heard of the Fourier transform. That mathematical process makes it possible for computers to analyze sound, video, and it also offers critical math insights for tasks ranging from pattern matching to frequency synthesis. The Laplace transform is less familiar, even though it is a generalization of the Fourier transform. [Steve Bruntun] has a good explanation of the math behind the Laplace transform in a recent video that you can see below.

There are many applications for the Laplace transform, including transforming types of differential equations. This comes up often in electronics where you have time-varying components like inductors and capacitors. Instead of having to solve a differential equation, you can perform a Laplace, solve using common algebra, and then do a reverse transform to get the right answer. This is similar to how logarithms can take a harder problem — multiplication — and change it into a simpler addition problem, but on a much larger scale.

Continue reading “Talking Head Teaches Laplace Transform”

Headphones Pexels Sega Square Sony MP3

MDFourier Project Seeks The Genesis Of SEGA 16-bit Sound

It always sounded a bit crunchy, but crunchy in a good way. SEGA’s 16-bit console, whether you call it the Genesis or Mega Drive, always had a unique sound thanks to it’s Yamaha YM2612 sound chip. The chip’s ability to reproduce shredding guitars and blasting bass drums was a joy to hear when placed in the hands of capable game developers. Games such as Toe Jam & Earl, Streets of Rage 2, and Sonic the Hedgehog 3 provided some of the most incredible game soundtracks of the ’90s; and while the retail shelf life of those games may have passed, their influence on sound design should not. One individual that is seeking to preserve that quintessential SEGA sound is [Artemio] whose MDFourier project seeks to capture it for future generations to hear.

Sega Mega Drive model 1 motherboard. (Bertram, Wikimedia Commons)

MDFourier is a crowd sourced project. Users are asked to use two pieces of software to first generate common audio through a videogame console, and another to analyze the output as to form an audio signature of that machine. Of course SEGA were not always known for their stellar manufacturing record. Throughout the dozen or so board revisions of the Model 1 console there were factory bodge wires, there was also the Model 2 console, Model 3 console, Nomad handheld, Mega Jet, CDX/Multi-Mega, and Wondermega karaoke machine. Each new revision of machine created a slightly new soundscape, and no single piece of emulation software takes them all into account. [Artemio] wants to aggregate all of this data in order to improve SEGA Genesis/Mega Drive emulators, FPGA implementations, or whatever else the future may hold.

Fans of the suite of SEGA consoles, or even fans of great documentation, can take a look at some of initial results as well as the written procedure for contributing to the MDFourier project. For those seeking a more visual step-by-step approach there is this video from YouTube channel RetroRGB below: If you’d like that Sega sound for your MIDI instrument, take a look at this MIDI synth using a Genesis sound chip.

Continue reading “MDFourier Project Seeks The Genesis Of SEGA 16-bit Sound”

LED Music Visualizer Bespeckles Your Bedroom

When it comes to wall-mounted ornamentation, get ready to throw out your throw-rugs and swap them for something that will pop so vividly, you’ll want to get your eyes checked. To get our eyes warmed up and popping, [James Best] has concocted a gargantuan 900-RGB-LED music visualizer to ensure that our bedrooms are bright and blinky on demand.

Like any other graduate from that small liberal-arts school in southern California, [James] started prototyping with some good old-fashioned blue tape. Once he had had his grid-spacing established, he set to work on 2-meter-by-0.5-meter wall mounted display from some plywood and lumber. Following some minor adhesive mishaps, James had his grid tacked down with Gaffers tape, and ready for visuals.

Under the hood, a Teensy is leveraging its DMA capabilities to conduct out a bitstream to 900 LEDs. By using the DMA feature and opting for a Teensy over the go-to Arduino, [James] is  using the spare CPU cycles to cook out some Fourier-Transformed music samples and display their frequency content.

We’ve covered folks proving the concept of driving oodles of WS2812B LEDs over DMA; it’s great seeing these ideas mature into a fully-featured project that lands on the walll. For more on chatting with WS2812B LEDs over DMA, have a look back into our archive.

Continue reading “LED Music Visualizer Bespeckles Your Bedroom”