Skip to main content

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.



from Hackaday https://ift.tt/2SBKcX3

Comments

Popular posts from this blog

How To Play Doom – And More – On An NES

Doom was a breakthrough game for its time, and became so popular that now it’s essentially the “Banana For Scale” of hardware hacking. Doom has been ported to countless devices, most of which have enough processing ability to run the game natively. Recently, this lineup of Doom-compatible devices expanded to include the NES even though the system definitely doesn’t have enough capability to run it without special help. And if you want your own Doom NES cartridge, this video will show you how to build it . We featured the original build from [TheRasteri] a while back which goes into details about how it’s possible to run such a resource-intensive game on a comparatively weak system. You just have to enter the cheat code “RASPI”. After all the heavy lifting is done, it’s time to put it into a realistic-looking cartridge. To get everything to fit in the donor cartridge, first the ICs in the cartridge were removed (except the lockout IC) and replaced with custom ROM chips. Some modifica...

Try NopSCADlib for your Next OpenSCAD Project

Most readers of this site are familiar by now with the OpenSCAD 3D modeling software, where you can write code to create 3D models. You may have even used OpenSCAD to output some STL files for your 3D printer. But for years now, [nophead] has been pushing OpenSCAD further than most, creating some complex utility and parts libraries to help with modeling, and a suite of Python scripts that generate printable STLs, laser-ready DXFs, bills of material, and human-readable assembly instructions complete with PNG imagery of exploded-view sub-assemblies. Recently [nophead] tidied all of this OpenSCAD infrastructure up and released it on GitHub as NopSCADlib . You can find out more by browsing through the example projects and README file in the repository, and by reading the announcement blog post on the HydraRaptor blog . Some functionality highlights include: a large parts library full of motors, buttons, smooth rod, et cetera many utility functions to help with chamfers, fillets, precis...

The Newbie’s Guide To JTAG

Do you even snarf? If not, it might be because you haven’t mastered the basics of JTAG and learned how to dump, or snarf, the firmware of an embedded device. This JTAG primer will get you up to snuff on snarfing, and help you build your reverse engineering skills. Whatever your motivation for diving into reverse engineering devices with microcontrollers, JTAG skills are a must, and [Sergio Prado]’s guide will get you going. He starts with a description and brief history of the Joint Test Action Group interface, from its humble beginnings as a PCB testing standard to the de facto standard for testing, debugging, and flashing firmware onto devices. He covers how to locate the JTAG pads – even when they’ve been purposely obfuscated – including the use of brute-force tools like the JTAGulator . Once you’ve got a connection, his tutorial helps you find the firmware in flash memory and snarf it up to a file for inspection, modification, or whatever else you have planned. We always apprec...