Posts | Comments

Planet Arduino

Archive for the ‘musical hacks’ Category

[JanHerman] knows that tuning musical instruments is all about precision and that precision is measured in a logarithmic unit called a cent. A cheap tuner unit might be accurate to 1.5 cents which sounds good until you look at one for ten times the price and find it is accurate to 0.1 cents. So you can spend $800 for precision or $60 for something less. [Jan] decided to build something better and cheaper using a 32-bit Arduino and a DDS frequency generator chip on a breakout board.

Oddly enough, the device doesn’t have a display. Instead, it generates a precise frequency and couples it to the piano using a transducer. You tune the string to the corresponding note. The post has a lot of detail about how piano tuning works.

If you know about the chromatic scale, the equal temperament system, and how many cents are in an octave, you might want to skip the first section. We didn’t though. If we learned any of that in childhood piano classes, we’ve forgotten it.

For those whose quest for precision isn’t that critical, note that the difference between two notes can be as little as 0.3316 Hz. It is interesting that the final design isn’t the first one [Jan] attempted and there is an explanation of why the first design wasn’t successful.

The final design calls for a 24-position rotary switch which is tough to find. We might have opted for a rotary encoder and a display or even some LEDs to make a cheap alternative. As it was, the cheap switch used caused problems and required a replacement and very careful soldering.

We’ve seen self-tuning pianos and the use of an oscilloscope for tuning, but those links are long dead. More recently, we’ve seen an old piano hacked for ragtime and if you decide you are giving up on piano lessons, you can always convert your instrument into a workbench.

A macro keypad making music.

Do you kind of want a macropad, but aren’t sure that you would use it? Hackaday alum [Jeremy Cook] is now making and selling the JC Pro Macro on Tindie, which is exactly what it sounds like — a Pro Micro-based macro keypad with an OLED screen and a rotary encoder. In the video below, [Jeremy] shows how he made it into a music maker by adding a speaker and a small solenoid that does percussion, all while retaining the original macro pad functionality.

[Jeremy]’s original idea for a drum was to have a servo seesawing a chopstick back and forth on the table as one might nervously twiddle a pencil. That didn’t work out so well, so he switched to the solenoid and printed a thing to hold it upright, and we absolutely love it. The drum is controlled with the rotary encoder: push to turn the beat on or off and crank it to change the BPM.

To make it easier to connect up the solenoid and speaker, [Jeremy] had a little I²C helper board fabricated. There’s one SVG connection and another with power and ground swapped in the event it is needed. If you’re interested in the JC Pro Macro, you can pick it up in various forms over on Tindie. Of course, you might want to wait for version 2, which is coming to Kickstarter in October.

There are many ways to make a macro keyboard. Here’s one that also takes gesture input.

[Fearless Night]’s optical theremin project takes advantage of the kind of highly-integrated parts that are available to the modern hacker and hobbyist in all the right ways. The result is a compact instrument with software that can be modified using the Arduino IDE to take it places the original Theremin design could never go.

The design is based on a ‘Blue Pill’ STM32 MCU development board and two Avago APDS-9960 gesture sensor breakout boards, along with a few other supporting components. Where the original Theremin sensed hand proximity using two antenna-like capacitive sensors to control note frequency and volume, this design relies on two optical sensors to do the same job.

[Fearless Night] provides downloads for the schematic, code, parts list, and even 3D models for the enclosure. PCB files are also included for a convenient assembly, but since the component count is fairly low, a patient hacker should be able to get away with soldering it up by hand without much trouble.

This project creates the audio using the STM32’s Direct Digital Synthesis (DDS) capability and a simple low-pass filter, and has several ways to fine-tune the output. What’s DDS? Our own Elliot Williams explains it in terms of audio output for microcontrollers, and if you’d like a more comprehensive overview, Bil Herd will happily tell you all about it.

We aren’t sure if you really need lasers to build [HoPE’s] laser harp. It is little more than some photocells and has an Arduino generate tones based on the signals. Still, you need to excite the photocells somehow, and lasers are cheap enough these days.

Mechanically, the device is a pretty large wooden structure. There are six lasers aligned to six light sensors. Each sensor is read by an analog input pin on an Arduino armed with a music-generation shield. We’ve seen plenty of these in the past, but the simplicity of this one is engaging.

We’ve used the copper tape writing trick ourselves and it is quite effective. The tape is often used for stained glass work and sticks to many surfaces. You can solder to it and solder overlaps where you need connections. The results are often as good as a simple single-sided PCB.

The code attached to the post is fairly straightforward and the MIDI shield does the bulk of the work. It should also make it easy to create some really impressive musical effects with a bit of extra coding.

If you want an artsy self-contained version, check out this previous Hackaday Prize entry. We’ve seen several of these at different levels of complexity.

Small synth held in two hands

We’ve always been delighted with the thoughtful and detailed write-ups that accompany each of [Tommy]’s synth products, and the background of his newest instrument, the Scout, is no exception. The Scout is specifically designed to be beginner-friendly, hackable, and uses 3D printed parts and components as much as possible. But there is much more to effectively using 3D printing as a production method than simply churning out parts. Everything needed to be carefully designed and tested, including the 3D printed battery holder, which we happen to think is a great idea.

3d printed battery holder, showing inserted spring contacts
3D printed battery holder, with spring contacts inserted by hand.

[Tommy] also spends some time explaining how he decided which features and design elements to include and which to leave out, contrasting the Scout with his POLY555 synth. Since the Scout is designed to be affordable and beginner-friendly, too many features can in fact be a drawback. Component costs go up, assembly becomes less straightforward, and more complex parts means additional failure points when 3D printing.

[Tommy] opted to keep the Scout tightly focused, but since it’s entirely open-sourced with a hackable design, adding features is made as easy as can be. [Tommy] designed the PCB in KiCad and used OpenSCAD for everything else. The Scout uses the ATmega328, and can be easily modified using the Arduino IDE.

STL files can be downloaded here and all source files are on the project’s GitHub repository, which also contains detailed assembly and modification guides. Watch it in action in the video, embedded below.

It’s an old misconception that digital musicians just use a mouse and keyboard for their art. This is often far from the truth, as many computer music artists have a wide variety of keyboards/synths, MIDI controllers, and “analog” instruments that all get used in their creative process. But what if one of those instruments was just a mouse?

Well, that must have been what was going through [kzra]’s mind when he turned an old ps/2 roller ball mouse into an electronic instrument. Born out of a love for music and a hate for waste, the mouse is a fully functional MIDI controller. Note pitch is mapped to the x-coordinate of the pointer, and volume (known as velocity, in MIDI-speak) is mapped to the y-coordinate. The scroll wheel can be used as a mod wheel, user-configurable but most often used to vary the note’s pitch. The mouse buttons are used to play notes, and can behave slightly differently depending on the mode the instrument is set to.

Not satisfied with simply outputting MIDI notes, [kzra] also designed an intuitive user interface to go along with the mouse. A nice little OLED displays the mode, volume, note, and mouse coordinates, and an 8×8 LED matrix also indicates the note and volume. It’s a fantastic and versatile little instrument, and you’ve gotta check out the video after the break to see it for yourself. We’ve seen some awesome retro-tech MIDI controllers before, and this fits right in.

Thanks to [midierror] for the tip!

Looking for a digital recreation of the classic analog volume unit (VU) meter? If you’ve got an Arduino, a few passive components, and a SSD1306 OLED, then [mircemk] might have the answer for you. As you can see in the video below, his code turns a handful of cheap parts into an attractive and functional audio display.

The project’s Hackaday.IO page explains that the idea is based on the work of [stevenart], with code adapted for the SSD1306 display and some tweaks made to the circuit. While [mircemk] says the code could be modified for stereo as long as the two displays don’t have conflicting I2C addresses, he decided to simply duplicate the whole setup for each channel to keep things simple. With as cheap as some of these parts are nowadays, it’s hard to blame him.

[mircemk] has provided source code for a couple different styles of VU indicators, the colors of which can easily be inverted depending on your tastes. He also clarifies that the jerky motion of the virtual “needle” seen in the video is due to the camera; in real-life it sweeps smoothly like the genuine article.

Much like the project that aimed to recreate authentic “steam gauges” with e-paper displays, this as an excellent technique to file away for use in the future. Compared to authentic analog gauges, these digital recreations are quicker and faster to implement, plus going this route prevents any antique hardware from going on the chopping block.

Ever since we saw the movie Big, we’ve wanted a floor piano. Still do, actually. We sometimes wonder how many floor pianos that movie has sold. It’s definitely launched some builds, too, but perhaps none as robust as this acrylic and wooden beauty by [FredTSL]. If you want more technical detail, check out the project on IO.

The best part is that this piano is modular and easily expands from 1 to 8 octaves. Each octave runs on an Arduino Mega, with the first octave set up as a primary and the others as secondaries. When [FredTSL] turns it on, the primary octave sends a message to find out how many octaves are out there, and then it assigns each one a number. Whenever a note is played via conductive fabric and sensor, the program fetches the key number and octave number and sends the message back to the primary Mega, which plays the note through a MIDI music shield.

We think this looks fantastic and super fun to dance around on. Be sure to check out the build log in photos, and stick around after the break, because you’d better believe they busted out some Heart and Soul on this baby. After all, it’s pretty much mandatory at this point.

Wish you could build a floor piano but don’t have the space or woodworking skills? Here’s a smaller, wireless version that was built in 24 hours.

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!

Playing the guitar requires speed, strength, and dexterity in both hands. Depending on your mobility level, rocking out with your axe might be impossible unless you could somehow hold down the strings and have a robot do the strumming for you.

[Jacob Stambaugh]’s Auto Strummer uses six lighted buttons to tell the hidden internal pick which string(s) to strum, which it does with the help of an Arduino Pro Mini and a stepper motor. If two or more buttons are pressed, all the strings between the outermost pair selected will be strummed. That little golden knob near the top is a pot that controls the strumming tempo.

[Jacob]’s impressive 3D-printed enclosure attaches to the guitar with a pair of spring-loaded clamps that grasp the edge of the sound hole. But don’t fret — there’s plenty of foam padding under every point that touches the soundboard.

We were worried that the enclosure would block or muffle the sound, even though it sits about an inch above the hole. But as you can hear in the video after the break, that doesn’t seem to be the case — it sounds fantastic.

Never touched a real guitar, but love to play Guitar Hero? There’s a robot for that, too.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook