How Optical Sensors Capture Hammer Velocity for MIDI
Smart and hybrid acoustic pianos bridge the traditional physical playing experience with the digital world by translating physical key strikes into digital MIDI data without altering the instrument's authentic touch. Instead of using mechanical switches that can introduce physical drag and alter the weight of the action, modern systems rely on non-contact optical sensors to track hammer movement. By measuring the precise time it takes for a hammer to pass through multiple points of light right before it strikes the string, the piano calculates hammer velocity and maps that physical speed into standard MIDI values.
The Advantage of Non-Contact Optical Sensing
Traditional digital pianos often rely on rubber dome switches beneath the keys, which inevitably alter the physical resistance and feel of the action. In contrast, an acoustic piano's expression relies heavily on the "escapement" mechanism, where the hammer is thrown freely toward the string.
Optical sensors use infrared light-emitting diodes (LEDs) paired with phototransistors. Because this detection relies purely on light interruption or reflection, there is zero physical friction or mechanical load added to the hammer assembly. The pianist experiences the exact weight, balance, and inertia of an authentic acoustic piano action while generating digital data in real time.
The Dual-Point Timing Mechanism
To convert movement into MIDI velocity, the system must determine the speed of the hammer immediately before it hits the string. This is typically achieved using one of two optical configurations:
- Vane and Dual-Beam Interrupters: A tiny, featherweight plastic shutter (or vane) is attached to the hammer shank. As the hammer rises toward the string, the shutter passes through an optical sensor housing containing two consecutive infrared beams: a primary beam and a secondary beam set at a strictly calibrated distance apart.
- Reflective Optical Arrays: A sensor rail mounted beneath the hammers emits light upward, measuring the intensity of the light reflected off a target on the hammer shank. As the hammer accelerates toward the string, the change in reflected light provides real-time position data.
In the dual-beam configuration, the system notes the exact microsecond the vane breaks the first light beam (\(t_1\)) and the exact microsecond it breaks the second light beam (\(t_2\)).
Calculating Velocity
Because the physical distance (\(d\)) between the two optical detection points is permanently fixed, the system calculates the velocity (\(v\)) using basic kinematics:
\[v = \frac{d}{t_2 - t_1}\]
Because this measurement occurs in the final millimeters of travel—after the key mechanism has released the hammer into free flight—it captures the true kinetic energy destined for the string. This distinguishes hammer-sensing systems from cheaper key-sensing systems, as key speed does not always directly correlate with hammer impact speed, particularly during soft playing or rapid trills.
Mapping to the MIDI Standard
Once the onboard microprocessor calculates the hammer's velocity, it converts that value into standard MIDI protocol:
- Standard MIDI (7-bit): The measured speed is scaled along a pre-calibrated velocity curve into a value ranging from 0 to 127, where 1 represents the softest pianissimo and 127 represents the hardest fortissimo (0 indicates a Note Off event).
- High-Resolution MIDI: Advanced systems utilize MIDI CC 88 or the MIDI 2.0 standard, expanding the resolution up to 16,384 steps (14-bit or higher) to capture micro-dynamics that standard 7-bit MIDI cannot convey.
Custom lookup tables inside the piano's firmware account for physical variations across individual notes, ensuring that bass hammers (which are heavier and naturally slower) yield the same musical volume as lighter, faster treble hammers when struck with equivalent force.
Note-Off and Continuous Monitoring
In addition to the hammer sensors, smart pianos feature continuous optical key sensors beneath the keyboard. While hammer sensors are optimized for the initial strike velocity, continuous key tracking monitors how fast the key is released. This release velocity is converted into a MIDI Note Off velocity, which controls how abruptly or smoothly virtual instruments damp the simulated string resonance.