Turning Sounds From A Flute Into Sheet Music

Composing music can be quite difficult – after all, you have to keep in mind all of the elements of musical theory, from time signature and key signature to the correct length for all of the notes. A team of students from Cornell University’s Designing with Microcontrollers class developed a solution for this problem by transcribing sounds from a flute into sheet music.

The project doesn’t simply detect the notes played – it is able to convert the raw audio into a standardized music score complete with accurate note timings and beats per minute. Before transcribing the music, some audio processing was necessary. The team chose to use a Sallen-Key filter to amplify the raw audio input due to its complex conjugate poles. They then used a fast Fourier Transform (FFT) to determine the frequency for the input note, converting the signal from the time domain to the frequency domain.

The algorithm samples the data to generate an input signal, using the ADC on the microcontroller to receive input from the microphone. It takes the real and imaginary components of the sampled signals and outputs a pair of real and imaginary amplitude components corresponding to the sampled frequency, evenly spaced from 0 to the Nyquist rate (half the sampling rate). The spacing of these bins and the bin with the largest amplitude are used to convert the signal back to a real frequency and a MIDI note.

The system uses a PIC32 for the logic. The circuitry for the microphone amplification uses a non-inverting op-amp with a gain of 50 to increase the microphone output signal amplitude from 15 mV to 750 mV to use by the microcontroller’s ADC. The signal is then sent to the anti-aliasing Sallen-Key filter, with a pole at 2.5 kHz and a Q of 1. The frequency was chosen since the FFT samples at 8 kHz and the frequency corresponds to a note out of the range of a flute. As for the filters, only the low pass filter was implemented in hardware.  While a bandpass filter could have been implemented in hardware, the team decided on a cleaner software approach.

The project is well-documented on the team’s project page, and it’s certainly worth checking out for more detailed discussions on the keypad controls and the software side of the audio processing. If you want to learn more about the FFT, check out this 2016 Hackaday Prize entry for an FFT spectrum analyezer.

Continue reading “Turning Sounds From A Flute Into Sheet Music”

Need Hackable Melodies? Here’s The TETRIS Theme And More

[Robson Couto] started to get interested in musical projects and as a side effect created downloadable code with simple notation for a good variety of themes, songs, and melodies. They are all for the Arduino and use only the built-in tone() function, but don’t let that distract you. If you look past that, you’ll see that each sketch is a melody that consists of single notes and durations; easily adapted to other purposes or simply used as-is. After all, [Robson] wanted the source of each tune to be easily understood, easily modified, and to have no external dependencies.

All that may sound a bit like MIDI, but MIDI has much more in common with hardware events than music notation because it includes (among other things) note starts and note ends as separate elements. Converting MIDI into a more usable format was a big part of a project that fed Bach music to a neural network and got surprisingly good results.

When doing music projects, sometimes having a recognizable melody represented very simply as notes and durations with only one note at a time can be an awfully handy resource, and you can find them on GitHub. There’s a brief video of the Tetris theme (actual name: Korobeiniki) being played after the break.

Continue reading “Need Hackable Melodies? Here’s The TETRIS Theme And More”

Bottle Organ Breakdown

A keen-eyed commenter pointed us to a homemade bottle organ that plays like a piano. The complexity gets turned up with foot-powered bellows and custom keys, but the magic of [Mike] and [Simon Haisell]’s garage-built instrument is not lost in the slightest. We also have the video below the break and there is a bottle organ performance by [Coyote Merlot].

The working concepts are explained well in the video, and that starts with the bellows. In the first few seconds of the video, we see an organist swaying as he plays, and it would be accurate to say the music moves him. The wobbling is to pedal a couple of levers that squeeze a pair of air sacs and slide under wheels that look like a hardware store purchase. The spring-return mechanism is a repurposed bungee cord and you know we dig that kind of resourcefulness. Each bellow valve is made with traditional leather flaps of the type that predate bungee cords and camera phones. These air pumps inflate a big reservoir in the back that provides continuous pressure to a manifold where each of the thirty-six keys control a valve responsible for one bottle. The pair built every wooden part we mentioned with the explicit purpose of creating this organ.

Continue reading “Bottle Organ Breakdown”

Sara Adkins Is Jamming Out With Machines

Asking machines to make music by themselves is kind of a strange notion. They’re machines, after all. They don’t feel happy or hurt, and as far as we know, they don’t long for the affections of other machines. Humans like to think of music as being a strictly human thing, a passionate undertaking so nuanced and emotion-based that a machine could never begin to understand the feeling that goes into the process of making music, or even the simple enjoyment of it.

The idea of humans and machines having a jam session together is even stranger. But oddly enough, the principles of the jam session may be exactly what machines need to begin to understand musical expression. As Sara Adkins explains in her enlightening 2019 Hackaday Superconference talk, Creating with the Machine, humans and machines have a lot to learn from each other.

To a human musician, a machine’s speed and accuracy are enviable. So is its ability to make instant transitions between notes and chords. Humans are slow to learn these transitions and have to practice going back and forth repeatedly to build muscle memory. If the machine were capable, it would likely envy the human in terms of passionate performance and musical expression.

Continue reading “Sara Adkins Is Jamming Out With Machines”

Electric Dreams Help Cows Survive The Desert Of The Real

Pictures of a cow wearing a pair of comically oversized virtual reality goggles recently spread like wildfire over social media, and even the major news outlets eventually picked it up. Why not? Nobody wants to read about geopolitical turmoil over the holidays, and this story was precisely the sort of lighthearted “news” people would, if you can forgive the pun, gobble up.

But since you’re reading Hackaday, these images probably left you with more questions than answers. Who made the hardware, what software is it running, and of course, why does a cow need VR? Unfortunately, the answers to the more technical questions aren’t exactly forthcoming. Even tracking the story back to the official press release from the Ministry of Agriculture and Food of the Moscow Region doesn’t tell us much more than we can gather from the image itself.

But it does at least explain why somebody went through the trouble of making a custom bovine VR rig: calm cows produce more milk. These VR goggles, should they pass their testing and actually be adopted by the Russian dairy industry, will be the newest addition to a list of cow-calming hardware devices that farmers have been using for decades to get the most out of their herds.

Continue reading “Electric Dreams Help Cows Survive The Desert Of The Real”

Secret C64 Program Found On A Christian Rock Band’s Vinyl Record

How often do you find Easter eggs in old vinyl records?

It sure was a surprise for [Robin Harbron] when he learned about a Commodore 64 program hidden on one of the sides of a record from the 1985 album of Christian rock band Prodigal. The host of the YouTube channel 8-Bit Show and Tell shows the “C-64” etching on one side of the vinyl, which he picked up after finding out online that the record contained the hidden program.

The run-out groove on records is typically an endless groove that keeps the record player from running off the record (unless there is an auto-return feature, which just replays the record). On side one of the vinyl, the run-out groove looks normal, but on side two, it’s a little thicker and contains some hidden audio. Recording the audio onto a cassette and loading it onto a dataset reveals a short C64 program.

The process is a little more troublesome that that, but after a few tries [Harbron] reveals a secret message, courtesy of Albert Einstein and Jesus Christ. It’s not the most impressive program ever written, but it’s pretty cool that programmers 35 years ago were able to fit it into only a few seconds of audio.

Unfortunately, we won’t be hearing much actual music from the album – [Harbron] chose not to play the songs to avoid copyright issues on YouTube.

Continue reading “Secret C64 Program Found On A Christian Rock Band’s Vinyl Record”

Turntable Spins Color And Sound Together

If you can’t grow your own synesthesia, buying electronics to do it for you is fine. Such is the case with the CHROMATIC by [Xavier Gazon], an artist who turns all kinds of electronics into circuit-bent musical art pieces. His project turns an old Philips Music 5120 turntable into a colorful MIDI sequencer, inspired by older 20th century instruments such as the Optophonic Piano and the Luminaphone.

The CHROMATIC uses colored pucks placed on a converted turntable to perform a looping sequence of chords in a given musical scale, generating MIDI data as output. Where its inspirations used primitive optics as their medium, this project employs a Teensy microcontroller and two modern optical sensors to do the work. One of these is a simple infrared sensor which tracks a white spot on the edge of the turntable, generating a MIDI clock signal to keep everything quantized and in sync. The other is a color sensor mounted on the tone arm, which can tell what color it sees and the height of the arm from the turntable.

While the instrument is still in beta testing phase details on how notes are generated aren’t yet given, though the general idea is that they are dictated by the color the tone arm sees and its position above the platter. Moving the tone arm changes which pucks it tracks, and the speed of the turntable can also be adjusted, changing how the melody sounds.​

The CHROMATIC is a very interesting project, but it’s not the first optical-based turntable hack we’ve seen here. We’ve also seen a much weirder use for a color sensor, too. Check out the video of this one in action after the break.

Continue reading “Turntable Spins Color And Sound Together”