Introduction: Lead-O-Lyzer, a Midi Keyboard Redesigned in Arduino
The Lead-O-Lyzer is a device ive wanted to make for a while. I wanted to make a device that could make musical leads and eventually be used as a midi controller. the pitch can be controlled by a ultrasonic sensor on the side.
eventually i hope to make it more advanced by making it possible to play in many scales. when you select a scale to play in you can press any key and it will sound well. i would also like to add
- sheets of triplex
- old midi keyboard
- 4 screw corners
- arduino mega
- usb on a computer with arduino software
- a lot of 5v cables
- piezo buzzer
2 octave scale keyboard
buzzer with direct audio output
octave and key selectors
Step 1: Design
the first design of the lead-o-lyzer was far too complicated. it had too much functions to be realized by 1 person in the given amount of time. the smaller and reduced version looked a lot like the end product. it had all the buttons and display functions i wanted in this project. also the ultrasonic sensor was clearly displayed on this drawing.
Step 2: Taking Appart the Old Keyboard
being the very impatient me i know, i couldnt wait to take a picture of the keyboard when it was still in its case, so a google image will have to do. after screwing it open and removing a part that i couldnt get out of the case i was left with what you see at image 2, the keyboard with controll circuit and pitch/modulation wheels. after opening renoise, a music program dear to me, i could check if the keyboard still worked. at image 4 you can see the green light was active which meant that the midi controller was giving a signal to renoise.
Step 3: The Circuit
screwing the keyboard off the controll circuit, i could see how this thing worked. after closer inspection when the rubber front was removed, i could see a basic matrix keyboard. this works by sending a pulse over a wire and looking at multiple places if there is current flowing trough, and doing that with multiple wires. a way better and less incompetent description can be found on the arduino site:
basically, instead of needing 100 wires to check all the inputs, you just need 16. less hassle.
Step 4: The Whole Circuit
after figuring out that the keyboard keys were basically a matrix keypad, i could just hook them up in the arduino. one set of 8 was the input and the other set of 8 was the output.
the ultrasonic sensor was 5V, ground and 2 pins for sending and receiving pulses based on distance.
the piezo buzzer was sending a wave on the + pin and sending it out on the groundpin.
Step 5: The Case
seeing as keyboards come in different sizes and shapes, a casing is very personalized. for example, i know that my 61 key's containing keyboard wouldnt fit in the same case i made for this small 25 key keyboard. with that in mind ill follow you trought the steps ive undergone to create this case.
first i have taken the advice of someone working in the workplace that i should make a compartment for all the arduino related stuff instead of putting it above the keys so i can have a stronger design. so i needed a 13x20x5cm compartment for all the arduino stuff and wires. leaving some room for the ultrasonic sensor on the other side and space for the keyboard itself i finaly came to 51x20x5cm casing for it all. besides that i made an open block for the keyboard itself so you can actually acces the keys, holes for the ultrasonic sensor, screwcorners, usb and the arduino compartment. this was all made with a lasercutter and pretty much designed on the spot. i used instand glue to assemble the case and reinforced it with the screwcorners. i also installed a hole to acces the arduino circuitry with help of a neat little hinge.
lastly but not leastly i printed a cablemanager in a 3d printer because i always have some trouble with cables getting in the way during recording. it also works neatly as a holder for the piezobuzzer. it is an amazing cablemanager i got from thingiverse:
Step 6: The Code
the code was fairly easy after i had used the keypad library which you can get on the arduino website where it also explains this library:
after using the multikey example to fill in most of the work that needed to be done, i made some minor modifications to make it run well on the keypad i had, mostly expanding the keypad size.
i also included that a function should be run to check the distance of the ultrasonic sensor to adjust the pitch that was played.
the code can be found here:
Step 7: Conclusion
i really liked to make this project. i have learned a ton of cool stuff including how microcontrollers process information and how midi keyboards work. i also learned a ton on making a casing and how much thought you must sink in to the casing if you want a flawless looking keyboard
i hope you enjoyed watching my instructable. i will follow with a video soon.