Close

Development of the Key Mechanism (Part 1- Prototyping)

A project log for Vintage Toy Synthesiser

A wooden toy piano converted into a standalone digital synthesiser.

liam-laceyLiam Lacey 08/30/2018 at 20:410 Comments

(Original post date - 28/12/15)

The first part of this project I have decided to undertake is the development of the key mechanism - allowing the existing toy piano keys to generate note messages in the digital domain. I have decided to start with this particular task as, from a technical point of view, it could arguably be the most challenging part of the project, with next to nothing in regard to existing examples of it being done. I've done a lot of trial and error in past projects to find a reliable solution for doing this, however I'm now fairly confident that I'm on a path towards a working implementation. 

vintage toy piano key mechanism

A cross-section of the existing toy piano key mechanism, annotating the way it was designed to work.

Past implementations and ideas

This isn't the first project I've undertaken where I've needed to digitalise a toy piano key mech. Back in May 2015 at the MIDI HACK hackathon in Berlin I turned a vintage toy piano into a simple MIDI controller; the original idea for this synth project. For that particular project I decided to use piezo sensors that would be struck by the keys in order to create MIDI note on and off messages. I decided to use piezos as they're cheap sensors that have been a tried and tested solution among musical instrument projects, allowing great sensitivity as well as a mechanism for generating velocity values.  My intention was to have a row of piezos stuck to the underside of the top of the piano, which would be struck by the keys hammers to generate note-on messages along with a velocity value created by the hardness of the piezo strike, coupled with a second row of piezos underneath the back of the keys for generating note-off messages when the keys were released. However the piezos ended up being pretty unreliable for me due to the handmade construction of the piano - they wouldn't always get struck by the hammers, sometimes hammers would strike or trigger multiple sensors, and the velocity values wouldn't always create consistent results.

toy piano piezo project

The piezo implementation for my existing MIDI toy piano project.

This circuit was stuck to the underside of the top of the piano to allow the keys hammers to strike the piezos.

Another option I thought about for this project was to use Force Sensitive Resistors (FSR's) instead of piezos. These could have been placed underneath the front of the keys and generated note-on messages from the force applied to the keys when being pressed along with a velocity value, with note-off messages generated when the forced is released. FSR's would have also allowed me to implement MIDI polyphonic aftertouch into the piano, allowing each key to control a continuous parameter value by applying various amounts of pressure whilst the key is held down. However due to the increased expense of FSR's over piezos I didn't see it as a viable solution for the project. Also from past experiences I found that the touch sensitivity of FSR's isn't as great as I'd want it.

Current implementation idea

When approaching this synth project I realised a much simpler solution that could be implement - turning each key into a pair of simple switches, making them work in essentially the same way that most velocity-sensitive synth/MIDI keyboards work. This implementation is as follows:

  1. When a key is initially pressed it opens a switch/circuit that starts a timer
  2. When the key is fully pressed it closes a second switch/circuit that stops the timer. The time value is used to generate a velocity value, and a note-on message is sent.
  3. When the key is released it closes the first switch/circuit, generating a note-off message.

This is potentially a better solution than using existing sensors as it is a tried and tested method for electronic musical keyboards. As I need the touch sensitivity to be very sensitive I found I can't use any mechanical push switches/buttons here; even some membrane buttons I tried weren't sensitive enough. The best solution seems to be to just make the keys open and close circuits, acting in the same way that buttons/switches do.

Here's a basic sketch of the circuit for each key:

key schematic

Where I'm at so far

So far I have created the switch/circuit on each key that will generate the note on messages (the switch at the front of the key). To do this I have done the following:

modified key mech 1

modified key mech 2

modified key mech 4

Originally I was using copper tape on the underside of each key to close the circuit when a key is pressed, however I found that some keys needed to be heavily pressed for them to work, which was not desirable. To improve on this I went about trying to replicate the way that silicone keypads work, however after attempting get hold of some conductive pills (or the materials needed to make them) I discovered Velostat - a conductive and pressure sensitive flexible material that was recommended as an alternative to conductive silicone or rubber. I'm not 100% sure why (though I'm sure somebody reading this with more electronics knowledge and experience could tell me!), but using Velostat instead of copper tape works so much better, offering greater sensitivity to the keys. An added bonus to using Velostat is its pressure sensitivity, theoretically allowing me to implement polyphonic aftertouch into the piano. A small layer of foam has been inserted between the keys and the Velostat to give the keys a more tactile feel, especially when applying pressure. The foam has also decreased to the distance that the key needs to move in order to trigger a note message, making the keys less clunky and easier to play.

Here is a video of eight of the keys in action, wired up to an Arduino Mega board which is sending MIDI messages to Ableton Live software. There is no velocity or pressure sensitivity implemented yet, however notes of different lengths can be played, and it is fully polyphonic.

Next steps

I've still got a way to go before the key mechanism will be fully operational and connected to the BBB. Here are the main things I've got left to do:

Discussions