Thursday, August 9, 2018

Electronic Musical Toy

There is an article on the website here written by Gareth Branwyn. It tells of a project built by Martin Hertig. It is essentially a one octave electronic musical instrument that Mr. Hertig built to be installed backstage at the concert venue Jugendkulturhaus Dynamo. I have a young grandson and I thought he might enjoy playing with something like that so I decided to build one. Here is my version, standing on the shoulders of Martin Hertig.

As in the original, rather than buttons, I wanted it to be touch sensitive. Here, as has happened many times in the past Adafruit came to my rescue with the "Adafruit 12-key Capacitive Touch Sensor Breakout - MPR121" that can be found here. It is a nifty little device that can sense touch on twelve different lines, with millions of adjustments (of course that can be good and bad) to control how it acts. This device can communicate with little computers via I2C (Inter-Integrated Circuit) a protocol that is supported by lots of devices including Arduino, Raspberry Pi, etc.

My thinking was this. I wanted a full chromatic octave, twelve notes, plus I wanted some non-chromatic percussion, drums and so forth. Also I wanted to be able to adjust the octave up or down that the twelve notes played. Finally, I wanted to change the instrument whose sound was emulated by the device. All that meant I would need two of the 12-key touch sensors.

I also needed a device that could generate the sounds of the notes and different instruments. Yet again, Adafruit bailed me out, this time with the "Adafruit "Music Maker" MP3 Shield for Arduino w/3W Stereo Amp - v1.0" found here. This item, among lots of other functionality, has a midi synthesizer (and I know midi from my pipe organ project) as well as a 3-Watt amplifier that can be connected directly to speakers. Further, it is an Arduino shield so it plugs right into an Arduino Uno, which of course speaks I2C. Sometimes things just work out.

And here it is. The knobs at the top are the percussion. The twelve handles are one chromatic octave, arranged like a piano keyboard. The two knobs on the left shift the notes up or down one octave. And the knob on the right changes the instrument that is being emulated.

This is what it looks like with the back removed. In the lower right is the Arduino Uno with the Music Maker shield on top. Next to it are the Capacitive Touch Sensors. Besides that just speakers and wire.

I posted a video on YouTube here in case you want to see it play.

1 comment: