What linear sensor for a keyboard? [closed] Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Keyboard fixingusb keyboard with many simultaneous key pressesHow would I use this 12 key keyboard?Bluetooth keyboard?Hacking USB Keyboard for external keysBest linear position sensor for piston feedbackModern keyboard controllerWhat is this keyboard connector and how to connect it to MCU?Linearizing a 0-10V non linear sensorWhat kind of led would be used for this keyboard

A proverb that is used to imply that you have unexpectedly faced a big problem

How many time has Arya actually used Needle?

Why is a lens darker than other ones when applying the same settings?

Monty Hall Problem-Probability Paradox

Should a wizard buy fine inks every time he want to copy spells into his spellbook?

What adaptations would allow standard fantasy dwarves to survive in the desert?

Nose gear failure in single prop aircraft: belly landing or nose-gear up landing?

why did the subset and factor influenced coefficients of logistic regression in R

Can an iPhone 7 be made to function as a NFC Tag?

Co-worker has annoying ringtone

How to fit content of minipage dynamically within a standalone?

What is the origin of 落第?

Why are vacuum tubes still used in amateur radios?

What makes a man succeed?

Is CEO the "profession" with the most psychopaths?

What does this say in Elvish?

Does any scripture mention that forms of God or Goddess are symbolic?

A term for a woman complaining about things/begging in a cute/childish way

How could we fake a moon landing now?

Plot data from external file with floating numbers

Test print coming out spongy

What does Turing mean by this statement?

Resize vertical bars (absolute-value symbols)

What is the difference between a "ranged attack" and a "ranged weapon attack"?



What linear sensor for a keyboard? [closed]



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Keyboard fixingusb keyboard with many simultaneous key pressesHow would I use this 12 key keyboard?Bluetooth keyboard?Hacking USB Keyboard for external keysBest linear position sensor for piston feedbackModern keyboard controllerWhat is this keyboard connector and how to connect it to MCU?Linearizing a 0-10V non linear sensorWhat kind of led would be used for this keyboard



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








8












$begingroup$


I'm trying to make a velocity-sensitive keyboard for playing music.



I have to measure the position of each key in order to know how loud the sound should be.



The volume of the sound is a function of the velocity of the keys at the end of the descent. I know the position can be recovered from the velocity by integrating it.



What would be the cheapest and easiest, yet still reasonably precise way to do it?



I don't know exactly what “reasonably precise” would mean in the context. I'll have to test it.



The length of the maximum displacement is about 2 cm.



EDIT: not as some answers seem to suggest, the loudness is NOT function of the mean velocity of the key.



EDIT2: The loudness is function of the hammer speed at the moment it hits the string, but the key isn't pushing the hammer until the end of its path. It is really like throwing a ball on a wall: the ball leaves the hand at one moment, before it hits the wall.










share|improve this question











$endgroup$



closed as too broad by Hearth, Dmitry Grigoryev, laptop2d, Brian Carlton, Dave Tweed Mar 26 at 4:38


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 4




    $begingroup$
    You could use an IR-diode and a photodiode next to each other below the key, the photodiode measuring the reflected light. The lower the postion of the key, the more reflected light reaches the photodiode. Then convert the photocurrent to a voltage using a transimpedance amplifier. You will have to play around to see what voltage or voltage change corresponds to which volume.
    $endgroup$
    – jusaca
    Mar 24 at 13:07










  • $begingroup$
    Have you considered putting an accelerometer on each key? Integrating acceleration gives you velocity, and integrating velocity gives you position. Since you're dealing with short distances & time periods you could probably ignore the accelerometers' small offset errors.
    $endgroup$
    – brhans
    Mar 24 at 13:11






  • 1




    $begingroup$
    @cat I'm familiar with Launchpads and I still have no idea what you are talking about. Can you be a little more helpful?
    $endgroup$
    – Elliot Alderson
    Mar 24 at 14:48






  • 1




    $begingroup$
    Yes I believe you are wrong. Compare a $1 accelerometer to an individual mechanical sensor on each key. Think of the reliability from zero moving parts (assuming you do the interconnects properly). You would need a reasonably capable microcontroller and a little experience writing firmware to pull it off though.
    $endgroup$
    – brhans
    Mar 24 at 18:30






  • 1




    $begingroup$
    @jusaca looks like that's already a product on the market: deskthority.net/wiki/Adomax_Flaretech :)
    $endgroup$
    – user60561
    Mar 24 at 19:46

















8












$begingroup$


I'm trying to make a velocity-sensitive keyboard for playing music.



I have to measure the position of each key in order to know how loud the sound should be.



The volume of the sound is a function of the velocity of the keys at the end of the descent. I know the position can be recovered from the velocity by integrating it.



What would be the cheapest and easiest, yet still reasonably precise way to do it?



I don't know exactly what “reasonably precise” would mean in the context. I'll have to test it.



The length of the maximum displacement is about 2 cm.



EDIT: not as some answers seem to suggest, the loudness is NOT function of the mean velocity of the key.



EDIT2: The loudness is function of the hammer speed at the moment it hits the string, but the key isn't pushing the hammer until the end of its path. It is really like throwing a ball on a wall: the ball leaves the hand at one moment, before it hits the wall.










share|improve this question











$endgroup$



closed as too broad by Hearth, Dmitry Grigoryev, laptop2d, Brian Carlton, Dave Tweed Mar 26 at 4:38


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 4




    $begingroup$
    You could use an IR-diode and a photodiode next to each other below the key, the photodiode measuring the reflected light. The lower the postion of the key, the more reflected light reaches the photodiode. Then convert the photocurrent to a voltage using a transimpedance amplifier. You will have to play around to see what voltage or voltage change corresponds to which volume.
    $endgroup$
    – jusaca
    Mar 24 at 13:07










  • $begingroup$
    Have you considered putting an accelerometer on each key? Integrating acceleration gives you velocity, and integrating velocity gives you position. Since you're dealing with short distances & time periods you could probably ignore the accelerometers' small offset errors.
    $endgroup$
    – brhans
    Mar 24 at 13:11






  • 1




    $begingroup$
    @cat I'm familiar with Launchpads and I still have no idea what you are talking about. Can you be a little more helpful?
    $endgroup$
    – Elliot Alderson
    Mar 24 at 14:48






  • 1




    $begingroup$
    Yes I believe you are wrong. Compare a $1 accelerometer to an individual mechanical sensor on each key. Think of the reliability from zero moving parts (assuming you do the interconnects properly). You would need a reasonably capable microcontroller and a little experience writing firmware to pull it off though.
    $endgroup$
    – brhans
    Mar 24 at 18:30






  • 1




    $begingroup$
    @jusaca looks like that's already a product on the market: deskthority.net/wiki/Adomax_Flaretech :)
    $endgroup$
    – user60561
    Mar 24 at 19:46













8












8








8





$begingroup$


I'm trying to make a velocity-sensitive keyboard for playing music.



I have to measure the position of each key in order to know how loud the sound should be.



The volume of the sound is a function of the velocity of the keys at the end of the descent. I know the position can be recovered from the velocity by integrating it.



What would be the cheapest and easiest, yet still reasonably precise way to do it?



I don't know exactly what “reasonably precise” would mean in the context. I'll have to test it.



The length of the maximum displacement is about 2 cm.



EDIT: not as some answers seem to suggest, the loudness is NOT function of the mean velocity of the key.



EDIT2: The loudness is function of the hammer speed at the moment it hits the string, but the key isn't pushing the hammer until the end of its path. It is really like throwing a ball on a wall: the ball leaves the hand at one moment, before it hits the wall.










share|improve this question











$endgroup$




I'm trying to make a velocity-sensitive keyboard for playing music.



I have to measure the position of each key in order to know how loud the sound should be.



The volume of the sound is a function of the velocity of the keys at the end of the descent. I know the position can be recovered from the velocity by integrating it.



What would be the cheapest and easiest, yet still reasonably precise way to do it?



I don't know exactly what “reasonably precise” would mean in the context. I'll have to test it.



The length of the maximum displacement is about 2 cm.



EDIT: not as some answers seem to suggest, the loudness is NOT function of the mean velocity of the key.



EDIT2: The loudness is function of the hammer speed at the moment it hits the string, but the key isn't pushing the hammer until the end of its path. It is really like throwing a ball on a wall: the ball leaves the hand at one moment, before it hits the wall.







sensor keyboard






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 20:59







Jonas Daverio

















asked Mar 24 at 11:20









Jonas DaverioJonas Daverio

11117




11117




closed as too broad by Hearth, Dmitry Grigoryev, laptop2d, Brian Carlton, Dave Tweed Mar 26 at 4:38


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as too broad by Hearth, Dmitry Grigoryev, laptop2d, Brian Carlton, Dave Tweed Mar 26 at 4:38


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 4




    $begingroup$
    You could use an IR-diode and a photodiode next to each other below the key, the photodiode measuring the reflected light. The lower the postion of the key, the more reflected light reaches the photodiode. Then convert the photocurrent to a voltage using a transimpedance amplifier. You will have to play around to see what voltage or voltage change corresponds to which volume.
    $endgroup$
    – jusaca
    Mar 24 at 13:07










  • $begingroup$
    Have you considered putting an accelerometer on each key? Integrating acceleration gives you velocity, and integrating velocity gives you position. Since you're dealing with short distances & time periods you could probably ignore the accelerometers' small offset errors.
    $endgroup$
    – brhans
    Mar 24 at 13:11






  • 1




    $begingroup$
    @cat I'm familiar with Launchpads and I still have no idea what you are talking about. Can you be a little more helpful?
    $endgroup$
    – Elliot Alderson
    Mar 24 at 14:48






  • 1




    $begingroup$
    Yes I believe you are wrong. Compare a $1 accelerometer to an individual mechanical sensor on each key. Think of the reliability from zero moving parts (assuming you do the interconnects properly). You would need a reasonably capable microcontroller and a little experience writing firmware to pull it off though.
    $endgroup$
    – brhans
    Mar 24 at 18:30






  • 1




    $begingroup$
    @jusaca looks like that's already a product on the market: deskthority.net/wiki/Adomax_Flaretech :)
    $endgroup$
    – user60561
    Mar 24 at 19:46












  • 4




    $begingroup$
    You could use an IR-diode and a photodiode next to each other below the key, the photodiode measuring the reflected light. The lower the postion of the key, the more reflected light reaches the photodiode. Then convert the photocurrent to a voltage using a transimpedance amplifier. You will have to play around to see what voltage or voltage change corresponds to which volume.
    $endgroup$
    – jusaca
    Mar 24 at 13:07










  • $begingroup$
    Have you considered putting an accelerometer on each key? Integrating acceleration gives you velocity, and integrating velocity gives you position. Since you're dealing with short distances & time periods you could probably ignore the accelerometers' small offset errors.
    $endgroup$
    – brhans
    Mar 24 at 13:11






  • 1




    $begingroup$
    @cat I'm familiar with Launchpads and I still have no idea what you are talking about. Can you be a little more helpful?
    $endgroup$
    – Elliot Alderson
    Mar 24 at 14:48






  • 1




    $begingroup$
    Yes I believe you are wrong. Compare a $1 accelerometer to an individual mechanical sensor on each key. Think of the reliability from zero moving parts (assuming you do the interconnects properly). You would need a reasonably capable microcontroller and a little experience writing firmware to pull it off though.
    $endgroup$
    – brhans
    Mar 24 at 18:30






  • 1




    $begingroup$
    @jusaca looks like that's already a product on the market: deskthority.net/wiki/Adomax_Flaretech :)
    $endgroup$
    – user60561
    Mar 24 at 19:46







4




4




$begingroup$
You could use an IR-diode and a photodiode next to each other below the key, the photodiode measuring the reflected light. The lower the postion of the key, the more reflected light reaches the photodiode. Then convert the photocurrent to a voltage using a transimpedance amplifier. You will have to play around to see what voltage or voltage change corresponds to which volume.
$endgroup$
– jusaca
Mar 24 at 13:07




$begingroup$
You could use an IR-diode and a photodiode next to each other below the key, the photodiode measuring the reflected light. The lower the postion of the key, the more reflected light reaches the photodiode. Then convert the photocurrent to a voltage using a transimpedance amplifier. You will have to play around to see what voltage or voltage change corresponds to which volume.
$endgroup$
– jusaca
Mar 24 at 13:07












$begingroup$
Have you considered putting an accelerometer on each key? Integrating acceleration gives you velocity, and integrating velocity gives you position. Since you're dealing with short distances & time periods you could probably ignore the accelerometers' small offset errors.
$endgroup$
– brhans
Mar 24 at 13:11




$begingroup$
Have you considered putting an accelerometer on each key? Integrating acceleration gives you velocity, and integrating velocity gives you position. Since you're dealing with short distances & time periods you could probably ignore the accelerometers' small offset errors.
$endgroup$
– brhans
Mar 24 at 13:11




1




1




$begingroup$
@cat I'm familiar with Launchpads and I still have no idea what you are talking about. Can you be a little more helpful?
$endgroup$
– Elliot Alderson
Mar 24 at 14:48




$begingroup$
@cat I'm familiar with Launchpads and I still have no idea what you are talking about. Can you be a little more helpful?
$endgroup$
– Elliot Alderson
Mar 24 at 14:48




1




1




$begingroup$
Yes I believe you are wrong. Compare a $1 accelerometer to an individual mechanical sensor on each key. Think of the reliability from zero moving parts (assuming you do the interconnects properly). You would need a reasonably capable microcontroller and a little experience writing firmware to pull it off though.
$endgroup$
– brhans
Mar 24 at 18:30




$begingroup$
Yes I believe you are wrong. Compare a $1 accelerometer to an individual mechanical sensor on each key. Think of the reliability from zero moving parts (assuming you do the interconnects properly). You would need a reasonably capable microcontroller and a little experience writing firmware to pull it off though.
$endgroup$
– brhans
Mar 24 at 18:30




1




1




$begingroup$
@jusaca looks like that's already a product on the market: deskthority.net/wiki/Adomax_Flaretech :)
$endgroup$
– user60561
Mar 24 at 19:46




$begingroup$
@jusaca looks like that's already a product on the market: deskthority.net/wiki/Adomax_Flaretech :)
$endgroup$
– user60561
Mar 24 at 19:46










9 Answers
9






active

oldest

votes


















2












$begingroup$

How about capacitive sensing? Tape some aluminum foil to the bottom of the key, ground the bottom of the keyboard, and measure the rise time through a 100k resistor.



This method can be made almost arbitrarily precise, as long as your processor is fast enough to discriminate the change in capacitance.



I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.






share|improve this answer











$endgroup$












  • $begingroup$
    So, I would have to pass AC in it, wouldn't I?
    $endgroup$
    – Jonas Daverio
    Mar 24 at 23:53






  • 1




    $begingroup$
    @JonasDaverio I'm not sure what you're connecting the keys to, but one GPIO per key would suffice.
    $endgroup$
    – 0xDBFB7
    Mar 25 at 1:19










  • $begingroup$
    I'm not sure how I am supposed to measure the capacitance. One plate is connected to ground and the other is connected to what? A constant voltage source?
    $endgroup$
    – Jonas Daverio
    Mar 25 at 11:29






  • 1




    $begingroup$
    The Teensy LC microcontroller[1] has 11 capacitive sensing inputs and a C++ library that makes it as easy as calling analogRead in Arduino. [1]: pjrc.com/teensy/teensyLC.html
    $endgroup$
    – hoosierEE
    Mar 25 at 14:12






  • 1




    $begingroup$
    @JonasDaverio sorry, I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.
    $endgroup$
    – 0xDBFB7
    Mar 25 at 14:50


















15












$begingroup$

Most keyboards simply use two contacts per key, configured so that they close (or open) at different positions in the key's travel. They estimate velocity from the time that elapses between the two events. Even the fancy weighted "piano action" keyboards use this basic sensing method.



Trying to measure position and/or velocity directly sounds like massive overkill.






share|improve this answer









$endgroup$








  • 3




    $begingroup$
    I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.
    $endgroup$
    – Jonas Daverio
    Mar 24 at 17:26







  • 9




    $begingroup$
    If one contact was at the bottom and the other contact was very near the bottom, you would not have this problem.
    $endgroup$
    – George White
    Mar 24 at 17:40






  • 1




    $begingroup$
    Every real instrument has its nuances and limitations. Musicians develop techniques to exploit these for musical effect. The player will soon learn to carry through to the bottom of stroke to get the desired effect.
    $endgroup$
    – Transistor
    Mar 24 at 21:07






  • 1




    $begingroup$
    @Transistor Yes, indeed, but my goal here is to try to simulate as close as possible a real piano. There are already plenty of keyboards available, but I never found one that did that. There are probably some really expensive one, though.
    $endgroup$
    – Jonas Daverio
    Mar 24 at 21:46






  • 1




    $begingroup$
    The point would be to have a midi output and the possibility to have more keys (for microtonality) while keeping all the sensation of a real piano. I know this will never be reached anyway. And I also want to keep it relatively cheap, but if I can't, I'll stick on the regular solution.
    $endgroup$
    – Jonas Daverio
    Mar 24 at 22:59


















9












$begingroup$


I have to measure the position of each key in order to know how loud the sound should be.




Normally key velocity is calculated by measuring the time between the normally closed up-switch breaking and the normally open down-switch making.





schematic





simulate this circuit – Schematic created using CircuitLab



Figure 1. A break-before-make keyboard contact is typically used for velocity measurement.




The volume of the sound is not only function of the velocity of the keys at the end of the descent. ...
The length of the maximum displacement is about 2 cm.




In this case you need to mechanically arrange the normally closed contact so that it breaks in the last few mm of travel.





schematic





simulate this circuit



Figure 2. The mechanical switching arrangement.



It seems to me that your best bet would be to modify an existing MIDI bass pedalboard to suit your purposes.




OP's comment to Dave Tweed:




I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.




That is why I proposed activating the changeover switch in the last few mm of travel.






share|improve this answer











$endgroup$












  • $begingroup$
    I responded back for why I think this is still insufficient.
    $endgroup$
    – Jonas Daverio
    Mar 24 at 20:55










  • $begingroup$
    I think you misread what I wrote. I meant "The volume of the sound is NOT only function of the velocity of the keys at the end of the descent."
    $endgroup$
    – Jonas Daverio
    Mar 24 at 21:48










  • $begingroup$
    Indeed, the energy depends on the speed over the time-length of the impact, which is a function of acceleration (and the jerk, if you don't assume constant acceleration). However, are sure that makes much of a difference? Can you characterize the specifics that you have or are looking for? I don't know what that would be. It might depend on the effect that it's supposed to have on the algorithm.
    $endgroup$
    – vectory
    Mar 25 at 22:39











  • $begingroup$
    @JonasDaverio Are you referring to escapement? Digital pianos accomplish this with a third sensor that fires slightly above where the key bottoms out (and above the sensor that sounds the note). If the key does not go high enough to release this 3rd sensor, then bottoming out the key will not sound a second note, just like a real piano does not release the hammer unless the key is raised high enough.
    $endgroup$
    – Toor
    Mar 25 at 23:45


















8












$begingroup$

You should take a look at analog keyboards. Take a look at this video. This is just an example of concept.



Edit:
Also, if optical switches are not working for you, take a look at this:



enter image description here



There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.



Source:
Reddit
Imgur






share|improve this answer











$endgroup$












  • $begingroup$
    Apparently, they use a pair of IR-LED and photosensor: blog.wooting.nl/flaretech-the-optical-keyboard-switch However, I'm not sure wether they measure the delay between the emission and the detection or wether they measure the intensity of the light that could make through the tunnel.
    $endgroup$
    – Jonas Daverio
    Mar 25 at 10:46











  • $begingroup$
    I linked that just for the example of analog keyboard. You can take a look at reddit.com/r/MechanicalKeyboards/comments/9ii6gw/… and imgur.com/gallery/ImrH7nO . I'am not too familiar with the subject, just trying to help to push you into right direction :)
    $endgroup$
    – Matt
    Mar 25 at 11:12






  • 1




    $begingroup$
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    $endgroup$
    – Blair Fonville
    Mar 25 at 11:22






  • 1




    $begingroup$
    @BlairFonville Fair enough. Let me summarize it. There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.
    $endgroup$
    – Matt
    Mar 25 at 12:12


















7












$begingroup$

If the important variable is the impact of a "hammer" that you're trying to emulate, consider piezo sensors which allow you to measure this directly. They produce a pulse whose amplitude depends on the impact impulse.






share|improve this answer









$endgroup$




















    3












    $begingroup$

    One option could be Hall sensors, which sense the strength of a magnetic field. There are different types of Hall sensors for digital and analog sensing, you need one that has analog. For example SI7211 costs about 0.80 USD.



    You also need a small magnet underneath each key. When the magnet gets closer to the sensor, the magnetic field increases which increases the sensor's output voltage.






    share|improve this answer









    $endgroup$








    • 1




      $begingroup$
      Apparently, they use it on some music keyboards. I think this is a really simple and good solution. I will compare the costs with 0xDBFB7's solution.
      $endgroup$
      – Jonas Daverio
      Mar 25 at 16:46


















    2












    $begingroup$

    You can treat this as a hybrid digital/analog instrument by placing microphones[1] inside the keyboard, tuned to the sound of striking the keys. Signals from the microphones augment the traditional switch-based input, so the switch tells you which key is pressed, and the microphones tell you how loud the most recent keypress was.



    2 or more microphones along the keyboard's length would permit decoding a chord with loud/low notes and soft/high notes and vice versa.



    [1]: I keep saying "microphone", but I mean "generic vibration sensing device".






    share|improve this answer









    $endgroup$












    • $begingroup$
      That's pretty much how an E-Guitar works, I guess. However, the question didn't mention any acoustic parts, just keys.
      $endgroup$
      – vectory
      Mar 25 at 22:32


















    0












    $begingroup$

    You may want to research spring return variable resistors, spring return potentiometers, or linear position sensors. Here is one example:
    http://ecatalog.beisensors.com/item/linear-position-sensors/linear-position-sensor-9600-series-compact-spri/9610r3-4kl2-0



    Another possibility may be to use a small rotary encoder (and mechanically convert the linear key press motion to rotary motion). The encoder would output one or more sets of pulses as the shaft rotates. A higher pulse rate would indicate a higher velocity press. The encoder position could be tracked directly if the pulse groups are sent to additional digital logic. Here's an example part: https://www.mouser.com/ProductDetail/Bourns/PEC16-4220F-S0024?qs=6FD5PBp7ZtQte%252Bg7b%2FiMUw%3D%3D&gclid=EAIaIQobChMIrKbIjOSa4QIVCEsNCh3JAAKuEAQYAyABEgKM_fD_BwE






    share|improve this answer











    $endgroup$




















      0












      $begingroup$

      If you want super-accuracy at a reasonable price, how about using a linear encoder, attaching a Gray-coded strip (which you print yourself using a laser printer onto a transparent sheet, then cut up and attach one to each key) - more details of how they work under rotary encoders here. This way you need two (perhaps 3 so you get an accurate indication of end position) digital lines per key. This will allow you to measure velocity with very good accuracy and even position if that's relevant. The advantage of this is you could retrofit it to an old keyboard (even an acoustic keyboard).



      Caution: when I was a teenager (a long while ago) I wondered for ages whether I could make a realistic keyboard more cheaply than buying them. It seemed unlikely then and it seems even less likely now. The cost effective method is therefore probably "buy a velocity sensitive keyboard and take it apart" which is no fun.






      share|improve this answer









      $endgroup$








      • 1




        $begingroup$
        Yes, I'm not pretending this will end up cheaper than a commercial one, but I'm trying to construct a special arrangement of keys that doesn't exist on the market. For your answer, I'm not really sure what you mean. Do you mean making a linear encoder from scratch? I don't understand what's the point of the transparent strip. And 3 bits seems a bit low to encode precisely the position and to deduce the velocity from it.
        $endgroup$
        – Jonas Daverio
        Mar 25 at 10:56











      • $begingroup$
        A linear encoder will give you velocity with 2 bits only (see links) to a great resolution (you could get position to 256ths of the travel distance very easily). By timing the period between grey code bit transitions you will get a very accurate picture of velocity at different stages of travel of the key. 3rd bit gives you accurate 'hammer hits strings' signal. I was suggesting you use a linear encoder optical reader with your own 'tape' - transparent strip.
        $endgroup$
        – abligh
        Mar 25 at 22:29


















      9 Answers
      9






      active

      oldest

      votes








      9 Answers
      9






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2












      $begingroup$

      How about capacitive sensing? Tape some aluminum foil to the bottom of the key, ground the bottom of the keyboard, and measure the rise time through a 100k resistor.



      This method can be made almost arbitrarily precise, as long as your processor is fast enough to discriminate the change in capacitance.



      I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.






      share|improve this answer











      $endgroup$












      • $begingroup$
        So, I would have to pass AC in it, wouldn't I?
        $endgroup$
        – Jonas Daverio
        Mar 24 at 23:53






      • 1




        $begingroup$
        @JonasDaverio I'm not sure what you're connecting the keys to, but one GPIO per key would suffice.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 1:19










      • $begingroup$
        I'm not sure how I am supposed to measure the capacitance. One plate is connected to ground and the other is connected to what? A constant voltage source?
        $endgroup$
        – Jonas Daverio
        Mar 25 at 11:29






      • 1




        $begingroup$
        The Teensy LC microcontroller[1] has 11 capacitive sensing inputs and a C++ library that makes it as easy as calling analogRead in Arduino. [1]: pjrc.com/teensy/teensyLC.html
        $endgroup$
        – hoosierEE
        Mar 25 at 14:12






      • 1




        $begingroup$
        @JonasDaverio sorry, I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 14:50















      2












      $begingroup$

      How about capacitive sensing? Tape some aluminum foil to the bottom of the key, ground the bottom of the keyboard, and measure the rise time through a 100k resistor.



      This method can be made almost arbitrarily precise, as long as your processor is fast enough to discriminate the change in capacitance.



      I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.






      share|improve this answer











      $endgroup$












      • $begingroup$
        So, I would have to pass AC in it, wouldn't I?
        $endgroup$
        – Jonas Daverio
        Mar 24 at 23:53






      • 1




        $begingroup$
        @JonasDaverio I'm not sure what you're connecting the keys to, but one GPIO per key would suffice.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 1:19










      • $begingroup$
        I'm not sure how I am supposed to measure the capacitance. One plate is connected to ground and the other is connected to what? A constant voltage source?
        $endgroup$
        – Jonas Daverio
        Mar 25 at 11:29






      • 1




        $begingroup$
        The Teensy LC microcontroller[1] has 11 capacitive sensing inputs and a C++ library that makes it as easy as calling analogRead in Arduino. [1]: pjrc.com/teensy/teensyLC.html
        $endgroup$
        – hoosierEE
        Mar 25 at 14:12






      • 1




        $begingroup$
        @JonasDaverio sorry, I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 14:50













      2












      2








      2





      $begingroup$

      How about capacitive sensing? Tape some aluminum foil to the bottom of the key, ground the bottom of the keyboard, and measure the rise time through a 100k resistor.



      This method can be made almost arbitrarily precise, as long as your processor is fast enough to discriminate the change in capacitance.



      I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.






      share|improve this answer











      $endgroup$



      How about capacitive sensing? Tape some aluminum foil to the bottom of the key, ground the bottom of the keyboard, and measure the rise time through a 100k resistor.



      This method can be made almost arbitrarily precise, as long as your processor is fast enough to discriminate the change in capacitance.



      I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 26 at 4:20









      George White

      34727




      34727










      answered Mar 24 at 23:32









      0xDBFB70xDBFB7

      566517




      566517











      • $begingroup$
        So, I would have to pass AC in it, wouldn't I?
        $endgroup$
        – Jonas Daverio
        Mar 24 at 23:53






      • 1




        $begingroup$
        @JonasDaverio I'm not sure what you're connecting the keys to, but one GPIO per key would suffice.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 1:19










      • $begingroup$
        I'm not sure how I am supposed to measure the capacitance. One plate is connected to ground and the other is connected to what? A constant voltage source?
        $endgroup$
        – Jonas Daverio
        Mar 25 at 11:29






      • 1




        $begingroup$
        The Teensy LC microcontroller[1] has 11 capacitive sensing inputs and a C++ library that makes it as easy as calling analogRead in Arduino. [1]: pjrc.com/teensy/teensyLC.html
        $endgroup$
        – hoosierEE
        Mar 25 at 14:12






      • 1




        $begingroup$
        @JonasDaverio sorry, I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 14:50
















      • $begingroup$
        So, I would have to pass AC in it, wouldn't I?
        $endgroup$
        – Jonas Daverio
        Mar 24 at 23:53






      • 1




        $begingroup$
        @JonasDaverio I'm not sure what you're connecting the keys to, but one GPIO per key would suffice.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 1:19










      • $begingroup$
        I'm not sure how I am supposed to measure the capacitance. One plate is connected to ground and the other is connected to what? A constant voltage source?
        $endgroup$
        – Jonas Daverio
        Mar 25 at 11:29






      • 1




        $begingroup$
        The Teensy LC microcontroller[1] has 11 capacitive sensing inputs and a C++ library that makes it as easy as calling analogRead in Arduino. [1]: pjrc.com/teensy/teensyLC.html
        $endgroup$
        – hoosierEE
        Mar 25 at 14:12






      • 1




        $begingroup$
        @JonasDaverio sorry, I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.
        $endgroup$
        – 0xDBFB7
        Mar 25 at 14:50















      $begingroup$
      So, I would have to pass AC in it, wouldn't I?
      $endgroup$
      – Jonas Daverio
      Mar 24 at 23:53




      $begingroup$
      So, I would have to pass AC in it, wouldn't I?
      $endgroup$
      – Jonas Daverio
      Mar 24 at 23:53




      1




      1




      $begingroup$
      @JonasDaverio I'm not sure what you're connecting the keys to, but one GPIO per key would suffice.
      $endgroup$
      – 0xDBFB7
      Mar 25 at 1:19




      $begingroup$
      @JonasDaverio I'm not sure what you're connecting the keys to, but one GPIO per key would suffice.
      $endgroup$
      – 0xDBFB7
      Mar 25 at 1:19












      $begingroup$
      I'm not sure how I am supposed to measure the capacitance. One plate is connected to ground and the other is connected to what? A constant voltage source?
      $endgroup$
      – Jonas Daverio
      Mar 25 at 11:29




      $begingroup$
      I'm not sure how I am supposed to measure the capacitance. One plate is connected to ground and the other is connected to what? A constant voltage source?
      $endgroup$
      – Jonas Daverio
      Mar 25 at 11:29




      1




      1




      $begingroup$
      The Teensy LC microcontroller[1] has 11 capacitive sensing inputs and a C++ library that makes it as easy as calling analogRead in Arduino. [1]: pjrc.com/teensy/teensyLC.html
      $endgroup$
      – hoosierEE
      Mar 25 at 14:12




      $begingroup$
      The Teensy LC microcontroller[1] has 11 capacitive sensing inputs and a C++ library that makes it as easy as calling analogRead in Arduino. [1]: pjrc.com/teensy/teensyLC.html
      $endgroup$
      – hoosierEE
      Mar 25 at 14:12




      1




      1




      $begingroup$
      @JonasDaverio sorry, I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.
      $endgroup$
      – 0xDBFB7
      Mar 25 at 14:50




      $begingroup$
      @JonasDaverio sorry, I didn't explain the circuit very well. You connect a digital output to the key via a high value resistor, set it low to discharge any stray charge, and then set it high. You also connect a digital input directly to the key. The capacitance will slowly charge through the resistor, and you time how long it takes before the digital input turns on. This time is equal to the RC time constant of the circuit.
      $endgroup$
      – 0xDBFB7
      Mar 25 at 14:50













      15












      $begingroup$

      Most keyboards simply use two contacts per key, configured so that they close (or open) at different positions in the key's travel. They estimate velocity from the time that elapses between the two events. Even the fancy weighted "piano action" keyboards use this basic sensing method.



      Trying to measure position and/or velocity directly sounds like massive overkill.






      share|improve this answer









      $endgroup$








      • 3




        $begingroup$
        I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 17:26







      • 9




        $begingroup$
        If one contact was at the bottom and the other contact was very near the bottom, you would not have this problem.
        $endgroup$
        – George White
        Mar 24 at 17:40






      • 1




        $begingroup$
        Every real instrument has its nuances and limitations. Musicians develop techniques to exploit these for musical effect. The player will soon learn to carry through to the bottom of stroke to get the desired effect.
        $endgroup$
        – Transistor
        Mar 24 at 21:07






      • 1




        $begingroup$
        @Transistor Yes, indeed, but my goal here is to try to simulate as close as possible a real piano. There are already plenty of keyboards available, but I never found one that did that. There are probably some really expensive one, though.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:46






      • 1




        $begingroup$
        The point would be to have a midi output and the possibility to have more keys (for microtonality) while keeping all the sensation of a real piano. I know this will never be reached anyway. And I also want to keep it relatively cheap, but if I can't, I'll stick on the regular solution.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 22:59















      15












      $begingroup$

      Most keyboards simply use two contacts per key, configured so that they close (or open) at different positions in the key's travel. They estimate velocity from the time that elapses between the two events. Even the fancy weighted "piano action" keyboards use this basic sensing method.



      Trying to measure position and/or velocity directly sounds like massive overkill.






      share|improve this answer









      $endgroup$








      • 3




        $begingroup$
        I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 17:26







      • 9




        $begingroup$
        If one contact was at the bottom and the other contact was very near the bottom, you would not have this problem.
        $endgroup$
        – George White
        Mar 24 at 17:40






      • 1




        $begingroup$
        Every real instrument has its nuances and limitations. Musicians develop techniques to exploit these for musical effect. The player will soon learn to carry through to the bottom of stroke to get the desired effect.
        $endgroup$
        – Transistor
        Mar 24 at 21:07






      • 1




        $begingroup$
        @Transistor Yes, indeed, but my goal here is to try to simulate as close as possible a real piano. There are already plenty of keyboards available, but I never found one that did that. There are probably some really expensive one, though.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:46






      • 1




        $begingroup$
        The point would be to have a midi output and the possibility to have more keys (for microtonality) while keeping all the sensation of a real piano. I know this will never be reached anyway. And I also want to keep it relatively cheap, but if I can't, I'll stick on the regular solution.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 22:59













      15












      15








      15





      $begingroup$

      Most keyboards simply use two contacts per key, configured so that they close (or open) at different positions in the key's travel. They estimate velocity from the time that elapses between the two events. Even the fancy weighted "piano action" keyboards use this basic sensing method.



      Trying to measure position and/or velocity directly sounds like massive overkill.






      share|improve this answer









      $endgroup$



      Most keyboards simply use two contacts per key, configured so that they close (or open) at different positions in the key's travel. They estimate velocity from the time that elapses between the two events. Even the fancy weighted "piano action" keyboards use this basic sensing method.



      Trying to measure position and/or velocity directly sounds like massive overkill.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 24 at 13:37









      Dave TweedDave Tweed

      125k10155269




      125k10155269







      • 3




        $begingroup$
        I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 17:26







      • 9




        $begingroup$
        If one contact was at the bottom and the other contact was very near the bottom, you would not have this problem.
        $endgroup$
        – George White
        Mar 24 at 17:40






      • 1




        $begingroup$
        Every real instrument has its nuances and limitations. Musicians develop techniques to exploit these for musical effect. The player will soon learn to carry through to the bottom of stroke to get the desired effect.
        $endgroup$
        – Transistor
        Mar 24 at 21:07






      • 1




        $begingroup$
        @Transistor Yes, indeed, but my goal here is to try to simulate as close as possible a real piano. There are already plenty of keyboards available, but I never found one that did that. There are probably some really expensive one, though.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:46






      • 1




        $begingroup$
        The point would be to have a midi output and the possibility to have more keys (for microtonality) while keeping all the sensation of a real piano. I know this will never be reached anyway. And I also want to keep it relatively cheap, but if I can't, I'll stick on the regular solution.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 22:59












      • 3




        $begingroup$
        I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 17:26







      • 9




        $begingroup$
        If one contact was at the bottom and the other contact was very near the bottom, you would not have this problem.
        $endgroup$
        – George White
        Mar 24 at 17:40






      • 1




        $begingroup$
        Every real instrument has its nuances and limitations. Musicians develop techniques to exploit these for musical effect. The player will soon learn to carry through to the bottom of stroke to get the desired effect.
        $endgroup$
        – Transistor
        Mar 24 at 21:07






      • 1




        $begingroup$
        @Transistor Yes, indeed, but my goal here is to try to simulate as close as possible a real piano. There are already plenty of keyboards available, but I never found one that did that. There are probably some really expensive one, though.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:46






      • 1




        $begingroup$
        The point would be to have a midi output and the possibility to have more keys (for microtonality) while keeping all the sensation of a real piano. I know this will never be reached anyway. And I also want to keep it relatively cheap, but if I can't, I'll stick on the regular solution.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 22:59







      3




      3




      $begingroup$
      I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 17:26





      $begingroup$
      I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 17:26





      9




      9




      $begingroup$
      If one contact was at the bottom and the other contact was very near the bottom, you would not have this problem.
      $endgroup$
      – George White
      Mar 24 at 17:40




      $begingroup$
      If one contact was at the bottom and the other contact was very near the bottom, you would not have this problem.
      $endgroup$
      – George White
      Mar 24 at 17:40




      1




      1




      $begingroup$
      Every real instrument has its nuances and limitations. Musicians develop techniques to exploit these for musical effect. The player will soon learn to carry through to the bottom of stroke to get the desired effect.
      $endgroup$
      – Transistor
      Mar 24 at 21:07




      $begingroup$
      Every real instrument has its nuances and limitations. Musicians develop techniques to exploit these for musical effect. The player will soon learn to carry through to the bottom of stroke to get the desired effect.
      $endgroup$
      – Transistor
      Mar 24 at 21:07




      1




      1




      $begingroup$
      @Transistor Yes, indeed, but my goal here is to try to simulate as close as possible a real piano. There are already plenty of keyboards available, but I never found one that did that. There are probably some really expensive one, though.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 21:46




      $begingroup$
      @Transistor Yes, indeed, but my goal here is to try to simulate as close as possible a real piano. There are already plenty of keyboards available, but I never found one that did that. There are probably some really expensive one, though.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 21:46




      1




      1




      $begingroup$
      The point would be to have a midi output and the possibility to have more keys (for microtonality) while keeping all the sensation of a real piano. I know this will never be reached anyway. And I also want to keep it relatively cheap, but if I can't, I'll stick on the regular solution.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 22:59




      $begingroup$
      The point would be to have a midi output and the possibility to have more keys (for microtonality) while keeping all the sensation of a real piano. I know this will never be reached anyway. And I also want to keep it relatively cheap, but if I can't, I'll stick on the regular solution.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 22:59











      9












      $begingroup$


      I have to measure the position of each key in order to know how loud the sound should be.




      Normally key velocity is calculated by measuring the time between the normally closed up-switch breaking and the normally open down-switch making.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      Figure 1. A break-before-make keyboard contact is typically used for velocity measurement.




      The volume of the sound is not only function of the velocity of the keys at the end of the descent. ...
      The length of the maximum displacement is about 2 cm.




      In this case you need to mechanically arrange the normally closed contact so that it breaks in the last few mm of travel.





      schematic





      simulate this circuit



      Figure 2. The mechanical switching arrangement.



      It seems to me that your best bet would be to modify an existing MIDI bass pedalboard to suit your purposes.




      OP's comment to Dave Tweed:




      I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.




      That is why I proposed activating the changeover switch in the last few mm of travel.






      share|improve this answer











      $endgroup$












      • $begingroup$
        I responded back for why I think this is still insufficient.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 20:55










      • $begingroup$
        I think you misread what I wrote. I meant "The volume of the sound is NOT only function of the velocity of the keys at the end of the descent."
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:48










      • $begingroup$
        Indeed, the energy depends on the speed over the time-length of the impact, which is a function of acceleration (and the jerk, if you don't assume constant acceleration). However, are sure that makes much of a difference? Can you characterize the specifics that you have or are looking for? I don't know what that would be. It might depend on the effect that it's supposed to have on the algorithm.
        $endgroup$
        – vectory
        Mar 25 at 22:39











      • $begingroup$
        @JonasDaverio Are you referring to escapement? Digital pianos accomplish this with a third sensor that fires slightly above where the key bottoms out (and above the sensor that sounds the note). If the key does not go high enough to release this 3rd sensor, then bottoming out the key will not sound a second note, just like a real piano does not release the hammer unless the key is raised high enough.
        $endgroup$
        – Toor
        Mar 25 at 23:45















      9












      $begingroup$


      I have to measure the position of each key in order to know how loud the sound should be.




      Normally key velocity is calculated by measuring the time between the normally closed up-switch breaking and the normally open down-switch making.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      Figure 1. A break-before-make keyboard contact is typically used for velocity measurement.




      The volume of the sound is not only function of the velocity of the keys at the end of the descent. ...
      The length of the maximum displacement is about 2 cm.




      In this case you need to mechanically arrange the normally closed contact so that it breaks in the last few mm of travel.





      schematic





      simulate this circuit



      Figure 2. The mechanical switching arrangement.



      It seems to me that your best bet would be to modify an existing MIDI bass pedalboard to suit your purposes.




      OP's comment to Dave Tweed:




      I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.




      That is why I proposed activating the changeover switch in the last few mm of travel.






      share|improve this answer











      $endgroup$












      • $begingroup$
        I responded back for why I think this is still insufficient.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 20:55










      • $begingroup$
        I think you misread what I wrote. I meant "The volume of the sound is NOT only function of the velocity of the keys at the end of the descent."
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:48










      • $begingroup$
        Indeed, the energy depends on the speed over the time-length of the impact, which is a function of acceleration (and the jerk, if you don't assume constant acceleration). However, are sure that makes much of a difference? Can you characterize the specifics that you have or are looking for? I don't know what that would be. It might depend on the effect that it's supposed to have on the algorithm.
        $endgroup$
        – vectory
        Mar 25 at 22:39











      • $begingroup$
        @JonasDaverio Are you referring to escapement? Digital pianos accomplish this with a third sensor that fires slightly above where the key bottoms out (and above the sensor that sounds the note). If the key does not go high enough to release this 3rd sensor, then bottoming out the key will not sound a second note, just like a real piano does not release the hammer unless the key is raised high enough.
        $endgroup$
        – Toor
        Mar 25 at 23:45













      9












      9








      9





      $begingroup$


      I have to measure the position of each key in order to know how loud the sound should be.




      Normally key velocity is calculated by measuring the time between the normally closed up-switch breaking and the normally open down-switch making.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      Figure 1. A break-before-make keyboard contact is typically used for velocity measurement.




      The volume of the sound is not only function of the velocity of the keys at the end of the descent. ...
      The length of the maximum displacement is about 2 cm.




      In this case you need to mechanically arrange the normally closed contact so that it breaks in the last few mm of travel.





      schematic





      simulate this circuit



      Figure 2. The mechanical switching arrangement.



      It seems to me that your best bet would be to modify an existing MIDI bass pedalboard to suit your purposes.




      OP's comment to Dave Tweed:




      I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.




      That is why I proposed activating the changeover switch in the last few mm of travel.






      share|improve this answer











      $endgroup$




      I have to measure the position of each key in order to know how loud the sound should be.




      Normally key velocity is calculated by measuring the time between the normally closed up-switch breaking and the normally open down-switch making.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      Figure 1. A break-before-make keyboard contact is typically used for velocity measurement.




      The volume of the sound is not only function of the velocity of the keys at the end of the descent. ...
      The length of the maximum displacement is about 2 cm.




      In this case you need to mechanically arrange the normally closed contact so that it breaks in the last few mm of travel.





      schematic





      simulate this circuit



      Figure 2. The mechanical switching arrangement.



      It seems to me that your best bet would be to modify an existing MIDI bass pedalboard to suit your purposes.




      OP's comment to Dave Tweed:




      I think this method is insufficient. Here's why: if I slowly push the key down half of the path, and then quickly push it down to the end, the sound would be loud on a real piano, and this method would think the key was pushed really slowly and therefore output a really quiet sound. In addition, if I want to repeat a note, I would have to let the key completely return to its original position, which is not at all what I would do on a real piano.




      That is why I proposed activating the changeover switch in the last few mm of travel.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 24 at 18:02

























      answered Mar 24 at 13:36









      TransistorTransistor

      89.2k786191




      89.2k786191











      • $begingroup$
        I responded back for why I think this is still insufficient.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 20:55










      • $begingroup$
        I think you misread what I wrote. I meant "The volume of the sound is NOT only function of the velocity of the keys at the end of the descent."
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:48










      • $begingroup$
        Indeed, the energy depends on the speed over the time-length of the impact, which is a function of acceleration (and the jerk, if you don't assume constant acceleration). However, are sure that makes much of a difference? Can you characterize the specifics that you have or are looking for? I don't know what that would be. It might depend on the effect that it's supposed to have on the algorithm.
        $endgroup$
        – vectory
        Mar 25 at 22:39











      • $begingroup$
        @JonasDaverio Are you referring to escapement? Digital pianos accomplish this with a third sensor that fires slightly above where the key bottoms out (and above the sensor that sounds the note). If the key does not go high enough to release this 3rd sensor, then bottoming out the key will not sound a second note, just like a real piano does not release the hammer unless the key is raised high enough.
        $endgroup$
        – Toor
        Mar 25 at 23:45
















      • $begingroup$
        I responded back for why I think this is still insufficient.
        $endgroup$
        – Jonas Daverio
        Mar 24 at 20:55










      • $begingroup$
        I think you misread what I wrote. I meant "The volume of the sound is NOT only function of the velocity of the keys at the end of the descent."
        $endgroup$
        – Jonas Daverio
        Mar 24 at 21:48










      • $begingroup$
        Indeed, the energy depends on the speed over the time-length of the impact, which is a function of acceleration (and the jerk, if you don't assume constant acceleration). However, are sure that makes much of a difference? Can you characterize the specifics that you have or are looking for? I don't know what that would be. It might depend on the effect that it's supposed to have on the algorithm.
        $endgroup$
        – vectory
        Mar 25 at 22:39











      • $begingroup$
        @JonasDaverio Are you referring to escapement? Digital pianos accomplish this with a third sensor that fires slightly above where the key bottoms out (and above the sensor that sounds the note). If the key does not go high enough to release this 3rd sensor, then bottoming out the key will not sound a second note, just like a real piano does not release the hammer unless the key is raised high enough.
        $endgroup$
        – Toor
        Mar 25 at 23:45















      $begingroup$
      I responded back for why I think this is still insufficient.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 20:55




      $begingroup$
      I responded back for why I think this is still insufficient.
      $endgroup$
      – Jonas Daverio
      Mar 24 at 20:55












      $begingroup$
      I think you misread what I wrote. I meant "The volume of the sound is NOT only function of the velocity of the keys at the end of the descent."
      $endgroup$
      – Jonas Daverio
      Mar 24 at 21:48




      $begingroup$
      I think you misread what I wrote. I meant "The volume of the sound is NOT only function of the velocity of the keys at the end of the descent."
      $endgroup$
      – Jonas Daverio
      Mar 24 at 21:48












      $begingroup$
      Indeed, the energy depends on the speed over the time-length of the impact, which is a function of acceleration (and the jerk, if you don't assume constant acceleration). However, are sure that makes much of a difference? Can you characterize the specifics that you have or are looking for? I don't know what that would be. It might depend on the effect that it's supposed to have on the algorithm.
      $endgroup$
      – vectory
      Mar 25 at 22:39





      $begingroup$
      Indeed, the energy depends on the speed over the time-length of the impact, which is a function of acceleration (and the jerk, if you don't assume constant acceleration). However, are sure that makes much of a difference? Can you characterize the specifics that you have or are looking for? I don't know what that would be. It might depend on the effect that it's supposed to have on the algorithm.
      $endgroup$
      – vectory
      Mar 25 at 22:39













      $begingroup$
      @JonasDaverio Are you referring to escapement? Digital pianos accomplish this with a third sensor that fires slightly above where the key bottoms out (and above the sensor that sounds the note). If the key does not go high enough to release this 3rd sensor, then bottoming out the key will not sound a second note, just like a real piano does not release the hammer unless the key is raised high enough.
      $endgroup$
      – Toor
      Mar 25 at 23:45




      $begingroup$
      @JonasDaverio Are you referring to escapement? Digital pianos accomplish this with a third sensor that fires slightly above where the key bottoms out (and above the sensor that sounds the note). If the key does not go high enough to release this 3rd sensor, then bottoming out the key will not sound a second note, just like a real piano does not release the hammer unless the key is raised high enough.
      $endgroup$
      – Toor
      Mar 25 at 23:45











      8












      $begingroup$

      You should take a look at analog keyboards. Take a look at this video. This is just an example of concept.



      Edit:
      Also, if optical switches are not working for you, take a look at this:



      enter image description here



      There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.



      Source:
      Reddit
      Imgur






      share|improve this answer











      $endgroup$












      • $begingroup$
        Apparently, they use a pair of IR-LED and photosensor: blog.wooting.nl/flaretech-the-optical-keyboard-switch However, I'm not sure wether they measure the delay between the emission and the detection or wether they measure the intensity of the light that could make through the tunnel.
        $endgroup$
        – Jonas Daverio
        Mar 25 at 10:46











      • $begingroup$
        I linked that just for the example of analog keyboard. You can take a look at reddit.com/r/MechanicalKeyboards/comments/9ii6gw/… and imgur.com/gallery/ImrH7nO . I'am not too familiar with the subject, just trying to help to push you into right direction :)
        $endgroup$
        – Matt
        Mar 25 at 11:12






      • 1




        $begingroup$
        While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
        $endgroup$
        – Blair Fonville
        Mar 25 at 11:22






      • 1




        $begingroup$
        @BlairFonville Fair enough. Let me summarize it. There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.
        $endgroup$
        – Matt
        Mar 25 at 12:12















      8












      $begingroup$

      You should take a look at analog keyboards. Take a look at this video. This is just an example of concept.



      Edit:
      Also, if optical switches are not working for you, take a look at this:



      enter image description here



      There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.



      Source:
      Reddit
      Imgur






      share|improve this answer











      $endgroup$












      • $begingroup$
        Apparently, they use a pair of IR-LED and photosensor: blog.wooting.nl/flaretech-the-optical-keyboard-switch However, I'm not sure wether they measure the delay between the emission and the detection or wether they measure the intensity of the light that could make through the tunnel.
        $endgroup$
        – Jonas Daverio
        Mar 25 at 10:46











      • $begingroup$
        I linked that just for the example of analog keyboard. You can take a look at reddit.com/r/MechanicalKeyboards/comments/9ii6gw/… and imgur.com/gallery/ImrH7nO . I'am not too familiar with the subject, just trying to help to push you into right direction :)
        $endgroup$
        – Matt
        Mar 25 at 11:12






      • 1




        $begingroup$
        While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
        $endgroup$
        – Blair Fonville
        Mar 25 at 11:22






      • 1




        $begingroup$
        @BlairFonville Fair enough. Let me summarize it. There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.
        $endgroup$
        – Matt
        Mar 25 at 12:12













      8












      8








      8





      $begingroup$

      You should take a look at analog keyboards. Take a look at this video. This is just an example of concept.



      Edit:
      Also, if optical switches are not working for you, take a look at this:



      enter image description here



      There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.



      Source:
      Reddit
      Imgur






      share|improve this answer











      $endgroup$



      You should take a look at analog keyboards. Take a look at this video. This is just an example of concept.



      Edit:
      Also, if optical switches are not working for you, take a look at this:



      enter image description here



      There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.



      Source:
      Reddit
      Imgur







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 26 at 9:18

























      answered Mar 25 at 8:55









      MattMatt

      1803




      1803











      • $begingroup$
        Apparently, they use a pair of IR-LED and photosensor: blog.wooting.nl/flaretech-the-optical-keyboard-switch However, I'm not sure wether they measure the delay between the emission and the detection or wether they measure the intensity of the light that could make through the tunnel.
        $endgroup$
        – Jonas Daverio
        Mar 25 at 10:46











      • $begingroup$
        I linked that just for the example of analog keyboard. You can take a look at reddit.com/r/MechanicalKeyboards/comments/9ii6gw/… and imgur.com/gallery/ImrH7nO . I'am not too familiar with the subject, just trying to help to push you into right direction :)
        $endgroup$
        – Matt
        Mar 25 at 11:12






      • 1




        $begingroup$
        While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
        $endgroup$
        – Blair Fonville
        Mar 25 at 11:22






      • 1




        $begingroup$
        @BlairFonville Fair enough. Let me summarize it. There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.
        $endgroup$
        – Matt
        Mar 25 at 12:12
















      • $begingroup$
        Apparently, they use a pair of IR-LED and photosensor: blog.wooting.nl/flaretech-the-optical-keyboard-switch However, I'm not sure wether they measure the delay between the emission and the detection or wether they measure the intensity of the light that could make through the tunnel.
        $endgroup$
        – Jonas Daverio
        Mar 25 at 10:46











      • $begingroup$
        I linked that just for the example of analog keyboard. You can take a look at reddit.com/r/MechanicalKeyboards/comments/9ii6gw/… and imgur.com/gallery/ImrH7nO . I'am not too familiar with the subject, just trying to help to push you into right direction :)
        $endgroup$
        – Matt
        Mar 25 at 11:12






      • 1




        $begingroup$
        While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
        $endgroup$
        – Blair Fonville
        Mar 25 at 11:22






      • 1




        $begingroup$
        @BlairFonville Fair enough. Let me summarize it. There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.
        $endgroup$
        – Matt
        Mar 25 at 12:12















      $begingroup$
      Apparently, they use a pair of IR-LED and photosensor: blog.wooting.nl/flaretech-the-optical-keyboard-switch However, I'm not sure wether they measure the delay between the emission and the detection or wether they measure the intensity of the light that could make through the tunnel.
      $endgroup$
      – Jonas Daverio
      Mar 25 at 10:46





      $begingroup$
      Apparently, they use a pair of IR-LED and photosensor: blog.wooting.nl/flaretech-the-optical-keyboard-switch However, I'm not sure wether they measure the delay between the emission and the detection or wether they measure the intensity of the light that could make through the tunnel.
      $endgroup$
      – Jonas Daverio
      Mar 25 at 10:46













      $begingroup$
      I linked that just for the example of analog keyboard. You can take a look at reddit.com/r/MechanicalKeyboards/comments/9ii6gw/… and imgur.com/gallery/ImrH7nO . I'am not too familiar with the subject, just trying to help to push you into right direction :)
      $endgroup$
      – Matt
      Mar 25 at 11:12




      $begingroup$
      I linked that just for the example of analog keyboard. You can take a look at reddit.com/r/MechanicalKeyboards/comments/9ii6gw/… and imgur.com/gallery/ImrH7nO . I'am not too familiar with the subject, just trying to help to push you into right direction :)
      $endgroup$
      – Matt
      Mar 25 at 11:12




      1




      1




      $begingroup$
      While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
      $endgroup$
      – Blair Fonville
      Mar 25 at 11:22




      $begingroup$
      While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
      $endgroup$
      – Blair Fonville
      Mar 25 at 11:22




      1




      1




      $begingroup$
      @BlairFonville Fair enough. Let me summarize it. There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.
      $endgroup$
      – Matt
      Mar 25 at 12:12




      $begingroup$
      @BlairFonville Fair enough. Let me summarize it. There is a PCB printed coil under each key cap. As you press the button coil measures the inductance change caused by key spring compressing and decompressing, therefore, you can get pretty accurate reading of the switch position.
      $endgroup$
      – Matt
      Mar 25 at 12:12











      7












      $begingroup$

      If the important variable is the impact of a "hammer" that you're trying to emulate, consider piezo sensors which allow you to measure this directly. They produce a pulse whose amplitude depends on the impact impulse.






      share|improve this answer









      $endgroup$

















        7












        $begingroup$

        If the important variable is the impact of a "hammer" that you're trying to emulate, consider piezo sensors which allow you to measure this directly. They produce a pulse whose amplitude depends on the impact impulse.






        share|improve this answer









        $endgroup$















          7












          7








          7





          $begingroup$

          If the important variable is the impact of a "hammer" that you're trying to emulate, consider piezo sensors which allow you to measure this directly. They produce a pulse whose amplitude depends on the impact impulse.






          share|improve this answer









          $endgroup$



          If the important variable is the impact of a "hammer" that you're trying to emulate, consider piezo sensors which allow you to measure this directly. They produce a pulse whose amplitude depends on the impact impulse.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 24 at 17:54









          pjc50pjc50

          34.5k34288




          34.5k34288





















              3












              $begingroup$

              One option could be Hall sensors, which sense the strength of a magnetic field. There are different types of Hall sensors for digital and analog sensing, you need one that has analog. For example SI7211 costs about 0.80 USD.



              You also need a small magnet underneath each key. When the magnet gets closer to the sensor, the magnetic field increases which increases the sensor's output voltage.






              share|improve this answer









              $endgroup$








              • 1




                $begingroup$
                Apparently, they use it on some music keyboards. I think this is a really simple and good solution. I will compare the costs with 0xDBFB7's solution.
                $endgroup$
                – Jonas Daverio
                Mar 25 at 16:46















              3












              $begingroup$

              One option could be Hall sensors, which sense the strength of a magnetic field. There are different types of Hall sensors for digital and analog sensing, you need one that has analog. For example SI7211 costs about 0.80 USD.



              You also need a small magnet underneath each key. When the magnet gets closer to the sensor, the magnetic field increases which increases the sensor's output voltage.






              share|improve this answer









              $endgroup$








              • 1




                $begingroup$
                Apparently, they use it on some music keyboards. I think this is a really simple and good solution. I will compare the costs with 0xDBFB7's solution.
                $endgroup$
                – Jonas Daverio
                Mar 25 at 16:46













              3












              3








              3





              $begingroup$

              One option could be Hall sensors, which sense the strength of a magnetic field. There are different types of Hall sensors for digital and analog sensing, you need one that has analog. For example SI7211 costs about 0.80 USD.



              You also need a small magnet underneath each key. When the magnet gets closer to the sensor, the magnetic field increases which increases the sensor's output voltage.






              share|improve this answer









              $endgroup$



              One option could be Hall sensors, which sense the strength of a magnetic field. There are different types of Hall sensors for digital and analog sensing, you need one that has analog. For example SI7211 costs about 0.80 USD.



              You also need a small magnet underneath each key. When the magnet gets closer to the sensor, the magnetic field increases which increases the sensor's output voltage.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 25 at 12:26









              jpajpa

              1,676712




              1,676712







              • 1




                $begingroup$
                Apparently, they use it on some music keyboards. I think this is a really simple and good solution. I will compare the costs with 0xDBFB7's solution.
                $endgroup$
                – Jonas Daverio
                Mar 25 at 16:46












              • 1




                $begingroup$
                Apparently, they use it on some music keyboards. I think this is a really simple and good solution. I will compare the costs with 0xDBFB7's solution.
                $endgroup$
                – Jonas Daverio
                Mar 25 at 16:46







              1




              1




              $begingroup$
              Apparently, they use it on some music keyboards. I think this is a really simple and good solution. I will compare the costs with 0xDBFB7's solution.
              $endgroup$
              – Jonas Daverio
              Mar 25 at 16:46




              $begingroup$
              Apparently, they use it on some music keyboards. I think this is a really simple and good solution. I will compare the costs with 0xDBFB7's solution.
              $endgroup$
              – Jonas Daverio
              Mar 25 at 16:46











              2












              $begingroup$

              You can treat this as a hybrid digital/analog instrument by placing microphones[1] inside the keyboard, tuned to the sound of striking the keys. Signals from the microphones augment the traditional switch-based input, so the switch tells you which key is pressed, and the microphones tell you how loud the most recent keypress was.



              2 or more microphones along the keyboard's length would permit decoding a chord with loud/low notes and soft/high notes and vice versa.



              [1]: I keep saying "microphone", but I mean "generic vibration sensing device".






              share|improve this answer









              $endgroup$












              • $begingroup$
                That's pretty much how an E-Guitar works, I guess. However, the question didn't mention any acoustic parts, just keys.
                $endgroup$
                – vectory
                Mar 25 at 22:32















              2












              $begingroup$

              You can treat this as a hybrid digital/analog instrument by placing microphones[1] inside the keyboard, tuned to the sound of striking the keys. Signals from the microphones augment the traditional switch-based input, so the switch tells you which key is pressed, and the microphones tell you how loud the most recent keypress was.



              2 or more microphones along the keyboard's length would permit decoding a chord with loud/low notes and soft/high notes and vice versa.



              [1]: I keep saying "microphone", but I mean "generic vibration sensing device".






              share|improve this answer









              $endgroup$












              • $begingroup$
                That's pretty much how an E-Guitar works, I guess. However, the question didn't mention any acoustic parts, just keys.
                $endgroup$
                – vectory
                Mar 25 at 22:32













              2












              2








              2





              $begingroup$

              You can treat this as a hybrid digital/analog instrument by placing microphones[1] inside the keyboard, tuned to the sound of striking the keys. Signals from the microphones augment the traditional switch-based input, so the switch tells you which key is pressed, and the microphones tell you how loud the most recent keypress was.



              2 or more microphones along the keyboard's length would permit decoding a chord with loud/low notes and soft/high notes and vice versa.



              [1]: I keep saying "microphone", but I mean "generic vibration sensing device".






              share|improve this answer









              $endgroup$



              You can treat this as a hybrid digital/analog instrument by placing microphones[1] inside the keyboard, tuned to the sound of striking the keys. Signals from the microphones augment the traditional switch-based input, so the switch tells you which key is pressed, and the microphones tell you how loud the most recent keypress was.



              2 or more microphones along the keyboard's length would permit decoding a chord with loud/low notes and soft/high notes and vice versa.



              [1]: I keep saying "microphone", but I mean "generic vibration sensing device".







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 24 at 21:41









              hoosierEEhoosierEE

              1,180714




              1,180714











              • $begingroup$
                That's pretty much how an E-Guitar works, I guess. However, the question didn't mention any acoustic parts, just keys.
                $endgroup$
                – vectory
                Mar 25 at 22:32
















              • $begingroup$
                That's pretty much how an E-Guitar works, I guess. However, the question didn't mention any acoustic parts, just keys.
                $endgroup$
                – vectory
                Mar 25 at 22:32















              $begingroup$
              That's pretty much how an E-Guitar works, I guess. However, the question didn't mention any acoustic parts, just keys.
              $endgroup$
              – vectory
              Mar 25 at 22:32




              $begingroup$
              That's pretty much how an E-Guitar works, I guess. However, the question didn't mention any acoustic parts, just keys.
              $endgroup$
              – vectory
              Mar 25 at 22:32











              0












              $begingroup$

              You may want to research spring return variable resistors, spring return potentiometers, or linear position sensors. Here is one example:
              http://ecatalog.beisensors.com/item/linear-position-sensors/linear-position-sensor-9600-series-compact-spri/9610r3-4kl2-0



              Another possibility may be to use a small rotary encoder (and mechanically convert the linear key press motion to rotary motion). The encoder would output one or more sets of pulses as the shaft rotates. A higher pulse rate would indicate a higher velocity press. The encoder position could be tracked directly if the pulse groups are sent to additional digital logic. Here's an example part: https://www.mouser.com/ProductDetail/Bourns/PEC16-4220F-S0024?qs=6FD5PBp7ZtQte%252Bg7b%2FiMUw%3D%3D&gclid=EAIaIQobChMIrKbIjOSa4QIVCEsNCh3JAAKuEAQYAyABEgKM_fD_BwE






              share|improve this answer











              $endgroup$

















                0












                $begingroup$

                You may want to research spring return variable resistors, spring return potentiometers, or linear position sensors. Here is one example:
                http://ecatalog.beisensors.com/item/linear-position-sensors/linear-position-sensor-9600-series-compact-spri/9610r3-4kl2-0



                Another possibility may be to use a small rotary encoder (and mechanically convert the linear key press motion to rotary motion). The encoder would output one or more sets of pulses as the shaft rotates. A higher pulse rate would indicate a higher velocity press. The encoder position could be tracked directly if the pulse groups are sent to additional digital logic. Here's an example part: https://www.mouser.com/ProductDetail/Bourns/PEC16-4220F-S0024?qs=6FD5PBp7ZtQte%252Bg7b%2FiMUw%3D%3D&gclid=EAIaIQobChMIrKbIjOSa4QIVCEsNCh3JAAKuEAQYAyABEgKM_fD_BwE






                share|improve this answer











                $endgroup$















                  0












                  0








                  0





                  $begingroup$

                  You may want to research spring return variable resistors, spring return potentiometers, or linear position sensors. Here is one example:
                  http://ecatalog.beisensors.com/item/linear-position-sensors/linear-position-sensor-9600-series-compact-spri/9610r3-4kl2-0



                  Another possibility may be to use a small rotary encoder (and mechanically convert the linear key press motion to rotary motion). The encoder would output one or more sets of pulses as the shaft rotates. A higher pulse rate would indicate a higher velocity press. The encoder position could be tracked directly if the pulse groups are sent to additional digital logic. Here's an example part: https://www.mouser.com/ProductDetail/Bourns/PEC16-4220F-S0024?qs=6FD5PBp7ZtQte%252Bg7b%2FiMUw%3D%3D&gclid=EAIaIQobChMIrKbIjOSa4QIVCEsNCh3JAAKuEAQYAyABEgKM_fD_BwE






                  share|improve this answer











                  $endgroup$



                  You may want to research spring return variable resistors, spring return potentiometers, or linear position sensors. Here is one example:
                  http://ecatalog.beisensors.com/item/linear-position-sensors/linear-position-sensor-9600-series-compact-spri/9610r3-4kl2-0



                  Another possibility may be to use a small rotary encoder (and mechanically convert the linear key press motion to rotary motion). The encoder would output one or more sets of pulses as the shaft rotates. A higher pulse rate would indicate a higher velocity press. The encoder position could be tracked directly if the pulse groups are sent to additional digital logic. Here's an example part: https://www.mouser.com/ProductDetail/Bourns/PEC16-4220F-S0024?qs=6FD5PBp7ZtQte%252Bg7b%2FiMUw%3D%3D&gclid=EAIaIQobChMIrKbIjOSa4QIVCEsNCh3JAAKuEAQYAyABEgKM_fD_BwE







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 24 at 12:42

























                  answered Mar 24 at 12:34









                  NeddNedd

                  4,388713




                  4,388713





















                      0












                      $begingroup$

                      If you want super-accuracy at a reasonable price, how about using a linear encoder, attaching a Gray-coded strip (which you print yourself using a laser printer onto a transparent sheet, then cut up and attach one to each key) - more details of how they work under rotary encoders here. This way you need two (perhaps 3 so you get an accurate indication of end position) digital lines per key. This will allow you to measure velocity with very good accuracy and even position if that's relevant. The advantage of this is you could retrofit it to an old keyboard (even an acoustic keyboard).



                      Caution: when I was a teenager (a long while ago) I wondered for ages whether I could make a realistic keyboard more cheaply than buying them. It seemed unlikely then and it seems even less likely now. The cost effective method is therefore probably "buy a velocity sensitive keyboard and take it apart" which is no fun.






                      share|improve this answer









                      $endgroup$








                      • 1




                        $begingroup$
                        Yes, I'm not pretending this will end up cheaper than a commercial one, but I'm trying to construct a special arrangement of keys that doesn't exist on the market. For your answer, I'm not really sure what you mean. Do you mean making a linear encoder from scratch? I don't understand what's the point of the transparent strip. And 3 bits seems a bit low to encode precisely the position and to deduce the velocity from it.
                        $endgroup$
                        – Jonas Daverio
                        Mar 25 at 10:56











                      • $begingroup$
                        A linear encoder will give you velocity with 2 bits only (see links) to a great resolution (you could get position to 256ths of the travel distance very easily). By timing the period between grey code bit transitions you will get a very accurate picture of velocity at different stages of travel of the key. 3rd bit gives you accurate 'hammer hits strings' signal. I was suggesting you use a linear encoder optical reader with your own 'tape' - transparent strip.
                        $endgroup$
                        – abligh
                        Mar 25 at 22:29
















                      0












                      $begingroup$

                      If you want super-accuracy at a reasonable price, how about using a linear encoder, attaching a Gray-coded strip (which you print yourself using a laser printer onto a transparent sheet, then cut up and attach one to each key) - more details of how they work under rotary encoders here. This way you need two (perhaps 3 so you get an accurate indication of end position) digital lines per key. This will allow you to measure velocity with very good accuracy and even position if that's relevant. The advantage of this is you could retrofit it to an old keyboard (even an acoustic keyboard).



                      Caution: when I was a teenager (a long while ago) I wondered for ages whether I could make a realistic keyboard more cheaply than buying them. It seemed unlikely then and it seems even less likely now. The cost effective method is therefore probably "buy a velocity sensitive keyboard and take it apart" which is no fun.






                      share|improve this answer









                      $endgroup$








                      • 1




                        $begingroup$
                        Yes, I'm not pretending this will end up cheaper than a commercial one, but I'm trying to construct a special arrangement of keys that doesn't exist on the market. For your answer, I'm not really sure what you mean. Do you mean making a linear encoder from scratch? I don't understand what's the point of the transparent strip. And 3 bits seems a bit low to encode precisely the position and to deduce the velocity from it.
                        $endgroup$
                        – Jonas Daverio
                        Mar 25 at 10:56











                      • $begingroup$
                        A linear encoder will give you velocity with 2 bits only (see links) to a great resolution (you could get position to 256ths of the travel distance very easily). By timing the period between grey code bit transitions you will get a very accurate picture of velocity at different stages of travel of the key. 3rd bit gives you accurate 'hammer hits strings' signal. I was suggesting you use a linear encoder optical reader with your own 'tape' - transparent strip.
                        $endgroup$
                        – abligh
                        Mar 25 at 22:29














                      0












                      0








                      0





                      $begingroup$

                      If you want super-accuracy at a reasonable price, how about using a linear encoder, attaching a Gray-coded strip (which you print yourself using a laser printer onto a transparent sheet, then cut up and attach one to each key) - more details of how they work under rotary encoders here. This way you need two (perhaps 3 so you get an accurate indication of end position) digital lines per key. This will allow you to measure velocity with very good accuracy and even position if that's relevant. The advantage of this is you could retrofit it to an old keyboard (even an acoustic keyboard).



                      Caution: when I was a teenager (a long while ago) I wondered for ages whether I could make a realistic keyboard more cheaply than buying them. It seemed unlikely then and it seems even less likely now. The cost effective method is therefore probably "buy a velocity sensitive keyboard and take it apart" which is no fun.






                      share|improve this answer









                      $endgroup$



                      If you want super-accuracy at a reasonable price, how about using a linear encoder, attaching a Gray-coded strip (which you print yourself using a laser printer onto a transparent sheet, then cut up and attach one to each key) - more details of how they work under rotary encoders here. This way you need two (perhaps 3 so you get an accurate indication of end position) digital lines per key. This will allow you to measure velocity with very good accuracy and even position if that's relevant. The advantage of this is you could retrofit it to an old keyboard (even an acoustic keyboard).



                      Caution: when I was a teenager (a long while ago) I wondered for ages whether I could make a realistic keyboard more cheaply than buying them. It seemed unlikely then and it seems even less likely now. The cost effective method is therefore probably "buy a velocity sensitive keyboard and take it apart" which is no fun.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Mar 25 at 6:19









                      ablighabligh

                      21716




                      21716







                      • 1




                        $begingroup$
                        Yes, I'm not pretending this will end up cheaper than a commercial one, but I'm trying to construct a special arrangement of keys that doesn't exist on the market. For your answer, I'm not really sure what you mean. Do you mean making a linear encoder from scratch? I don't understand what's the point of the transparent strip. And 3 bits seems a bit low to encode precisely the position and to deduce the velocity from it.
                        $endgroup$
                        – Jonas Daverio
                        Mar 25 at 10:56











                      • $begingroup$
                        A linear encoder will give you velocity with 2 bits only (see links) to a great resolution (you could get position to 256ths of the travel distance very easily). By timing the period between grey code bit transitions you will get a very accurate picture of velocity at different stages of travel of the key. 3rd bit gives you accurate 'hammer hits strings' signal. I was suggesting you use a linear encoder optical reader with your own 'tape' - transparent strip.
                        $endgroup$
                        – abligh
                        Mar 25 at 22:29













                      • 1




                        $begingroup$
                        Yes, I'm not pretending this will end up cheaper than a commercial one, but I'm trying to construct a special arrangement of keys that doesn't exist on the market. For your answer, I'm not really sure what you mean. Do you mean making a linear encoder from scratch? I don't understand what's the point of the transparent strip. And 3 bits seems a bit low to encode precisely the position and to deduce the velocity from it.
                        $endgroup$
                        – Jonas Daverio
                        Mar 25 at 10:56











                      • $begingroup$
                        A linear encoder will give you velocity with 2 bits only (see links) to a great resolution (you could get position to 256ths of the travel distance very easily). By timing the period between grey code bit transitions you will get a very accurate picture of velocity at different stages of travel of the key. 3rd bit gives you accurate 'hammer hits strings' signal. I was suggesting you use a linear encoder optical reader with your own 'tape' - transparent strip.
                        $endgroup$
                        – abligh
                        Mar 25 at 22:29








                      1




                      1




                      $begingroup$
                      Yes, I'm not pretending this will end up cheaper than a commercial one, but I'm trying to construct a special arrangement of keys that doesn't exist on the market. For your answer, I'm not really sure what you mean. Do you mean making a linear encoder from scratch? I don't understand what's the point of the transparent strip. And 3 bits seems a bit low to encode precisely the position and to deduce the velocity from it.
                      $endgroup$
                      – Jonas Daverio
                      Mar 25 at 10:56





                      $begingroup$
                      Yes, I'm not pretending this will end up cheaper than a commercial one, but I'm trying to construct a special arrangement of keys that doesn't exist on the market. For your answer, I'm not really sure what you mean. Do you mean making a linear encoder from scratch? I don't understand what's the point of the transparent strip. And 3 bits seems a bit low to encode precisely the position and to deduce the velocity from it.
                      $endgroup$
                      – Jonas Daverio
                      Mar 25 at 10:56













                      $begingroup$
                      A linear encoder will give you velocity with 2 bits only (see links) to a great resolution (you could get position to 256ths of the travel distance very easily). By timing the period between grey code bit transitions you will get a very accurate picture of velocity at different stages of travel of the key. 3rd bit gives you accurate 'hammer hits strings' signal. I was suggesting you use a linear encoder optical reader with your own 'tape' - transparent strip.
                      $endgroup$
                      – abligh
                      Mar 25 at 22:29





                      $begingroup$
                      A linear encoder will give you velocity with 2 bits only (see links) to a great resolution (you could get position to 256ths of the travel distance very easily). By timing the period between grey code bit transitions you will get a very accurate picture of velocity at different stages of travel of the key. 3rd bit gives you accurate 'hammer hits strings' signal. I was suggesting you use a linear encoder optical reader with your own 'tape' - transparent strip.
                      $endgroup$
                      – abligh
                      Mar 25 at 22:29




                      Popular posts from this blog

                      Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum

                      He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

                      Slayer Innehåll Historia | Stil, komposition och lyrik | Bandets betydelse och framgångar | Sidoprojekt och samarbeten | Kontroverser | Medlemmar | Utmärkelser och nomineringar | Turnéer och festivaler | Diskografi | Referenser | Externa länkar | Navigeringsmenywww.slayer.net”Metal Massacre vol. 1””Metal Massacre vol. 3””Metal Massacre Volume III””Show No Mercy””Haunting the Chapel””Live Undead””Hell Awaits””Reign in Blood””Reign in Blood””Gold & Platinum – Reign in Blood””Golden Gods Awards Winners”originalet”Kerrang! Hall Of Fame””Slayer Looks Back On 37-Year Career In New Video Series: Part Two””South of Heaven””Gold & Platinum – South of Heaven””Seasons in the Abyss””Gold & Platinum - Seasons in the Abyss””Divine Intervention””Divine Intervention - Release group by Slayer””Gold & Platinum - Divine Intervention””Live Intrusion””Undisputed Attitude””Abolish Government/Superficial Love””Release “Slatanic Slaughter: A Tribute to Slayer” by Various Artists””Diabolus in Musica””Soundtrack to the Apocalypse””God Hates Us All””Systematic - Relationships””War at the Warfield””Gold & Platinum - War at the Warfield””Soundtrack to the Apocalypse””Gold & Platinum - Still Reigning””Metallica, Slayer, Iron Mauden Among Winners At Metal Hammer Awards””Eternal Pyre””Eternal Pyre - Slayer release group””Eternal Pyre””Metal Storm Awards 2006””Kerrang! Hall Of Fame””Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Bullet-For My Valentine booed at Metal Hammer Golden Gods Awards””Unholy Aliance””The End Of Slayer?””Slayer: We Could Thrash Out Two More Albums If We're Fast Enough...””'The Unholy Alliance: Chapter III' UK Dates Added”originalet”Megadeth And Slayer To Co-Headline 'Canadian Carnage' Trek”originalet”World Painted Blood””Release “World Painted Blood” by Slayer””Metallica Heading To Cinemas””Slayer, Megadeth To Join Forces For 'European Carnage' Tour - Dec. 18, 2010”originalet”Slayer's Hanneman Contracts Acute Infection; Band To Bring In Guest Guitarist””Cannibal Corpse's Pat O'Brien Will Step In As Slayer's Guest Guitarist”originalet”Slayer’s Jeff Hanneman Dead at 49””Dave Lombardo Says He Made Only $67,000 In 2011 While Touring With Slayer””Slayer: We Do Not Agree With Dave Lombardo's Substance Or Timeline Of Events””Slayer Welcomes Drummer Paul Bostaph Back To The Fold””Slayer Hope to Unveil Never-Before-Heard Jeff Hanneman Material on Next Album””Slayer Debut New Song 'Implode' During Surprise Golden Gods Appearance””Release group Repentless by Slayer””Repentless - Slayer - Credits””Slayer””Metal Storm Awards 2015””Slayer - to release comic book "Repentless #1"””Slayer To Release 'Repentless' 6.66" Vinyl Box Set””BREAKING NEWS: Slayer Announce Farewell Tour””Slayer Recruit Lamb of God, Anthrax, Behemoth + Testament for Final Tour””Slayer lägger ner efter 37 år””Slayer Announces Second North American Leg Of 'Final' Tour””Final World Tour””Slayer Announces Final European Tour With Lamb of God, Anthrax And Obituary””Slayer To Tour Europe With Lamb of God, Anthrax And Obituary””Slayer To Play 'Last French Show Ever' At Next Year's Hellfst””Slayer's Final World Tour Will Extend Into 2019””Death Angel's Rob Cavestany On Slayer's 'Farewell' Tour: 'Some Of Us Could See This Coming'””Testament Has No Plans To Retire Anytime Soon, Says Chuck Billy””Anthrax's Scott Ian On Slayer's 'Farewell' Tour Plans: 'I Was Surprised And I Wasn't Surprised'””Slayer””Slayer's Morbid Schlock””Review/Rock; For Slayer, the Mania Is the Message””Slayer - Biography””Slayer - Reign In Blood”originalet”Dave Lombardo””An exclusive oral history of Slayer”originalet”Exclusive! Interview With Slayer Guitarist Jeff Hanneman”originalet”Thinking Out Loud: Slayer's Kerry King on hair metal, Satan and being polite””Slayer Lyrics””Slayer - Biography””Most influential artists for extreme metal music””Slayer - Reign in Blood””Slayer guitarist Jeff Hanneman dies aged 49””Slatanic Slaughter: A Tribute to Slayer””Gateway to Hell: A Tribute to Slayer””Covered In Blood””Slayer: The Origins of Thrash in San Francisco, CA.””Why They Rule - #6 Slayer”originalet”Guitar World's 100 Greatest Heavy Metal Guitarists Of All Time”originalet”The fans have spoken: Slayer comes out on top in readers' polls”originalet”Tribute to Jeff Hanneman (1964-2013)””Lamb Of God Frontman: We Sound Like A Slayer Rip-Off””BEHEMOTH Frontman Pays Tribute To SLAYER's JEFF HANNEMAN””Slayer, Hatebreed Doing Double Duty On This Year's Ozzfest””System of a Down””Lacuna Coil’s Andrea Ferro Talks Influences, Skateboarding, Band Origins + More””Slayer - Reign in Blood””Into The Lungs of Hell””Slayer rules - en utställning om fans””Slayer and Their Fans Slashed Through a No-Holds-Barred Night at Gas Monkey””Home””Slayer””Gold & Platinum - The Big 4 Live from Sofia, Bulgaria””Exclusive! Interview With Slayer Guitarist Kerry King””2008-02-23: Wiltern, Los Angeles, CA, USA””Slayer's Kerry King To Perform With Megadeth Tonight! - Oct. 21, 2010”originalet”Dave Lombardo - Biography”Slayer Case DismissedArkiveradUltimate Classic Rock: Slayer guitarist Jeff Hanneman dead at 49.”Slayer: "We could never do any thing like Some Kind Of Monster..."””Cannibal Corpse'S Pat O'Brien Will Step In As Slayer'S Guest Guitarist | The Official Slayer Site”originalet”Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Kerrang! Awards 2006 Blog: Kerrang! Hall Of Fame””Kerrang! Awards 2013: Kerrang! Legend”originalet”Metallica, Slayer, Iron Maien Among Winners At Metal Hammer Awards””Metal Hammer Golden Gods Awards””Bullet For My Valentine Booed At Metal Hammer Golden Gods Awards””Metal Storm Awards 2006””Metal Storm Awards 2015””Slayer's Concert History””Slayer - Relationships””Slayer - Releases”Slayers officiella webbplatsSlayer på MusicBrainzOfficiell webbplatsSlayerSlayerr1373445760000 0001 1540 47353068615-5086262726cb13906545x(data)6033143kn20030215029