[ Washington University in St. Louis ]

Piano Key IDentification

By: Nick Jenkins and Skyler Wills

Many people that own a piano try to play by ear, using a whistle or hum to match their pitch to a key on the piano; some people own a piano and would like to know how to play their favorite songs from the radio or their mp3 player. Our senior design project looks to solve both desires by detecting a pitch and turning on a LED above the piano key corresponding with that pitch.


Our algorithm reliably and consistently detects the pitch of a piano tone, human whistle, or human voice and indicates which piano key corresponds with the detected pitch. Given a 22.05 kHz sampling frequency, our design can detect any tone between the piano scale 3rd C (130.813 Hz) and 6th C (1046.50 Hz). Our virtual implementation in LabVIEW with a Matlab Script Node constrains the highest detectable frequency to 5th C (523.251 Hz) and requires that LED output have a one second lag. Future improvements look to implement the design with hardware and increase the range of detectable frequencies.

Input Output
Piano Key Name Piano Key Nickname Piano Key Number Input Frequency (Hz) L for 5512.5 Hz Data L for 22.05 kHz Data Pitch Detected (Hz) Piano Key Number Pitch Percent Error
C 3 Low C 28 130.813 42 168 131.25 28 0.3341%
C 4 Middle C 40 261.626 21 84 262.50 40 0.3341%
C 5 Tenor C 52 523.251 10 42 525.00 52 0.3343%
C 6 Soprano C 64 1046.50 5 21 1050.00 64 0.3344%