A search procedure which takes into account the possible frequency fluctuations of the partials of piano notes is presented in this paper. This technique treats polyphonic sounds (as many notes as desired, provided that a sufficient number of their partials is present in the spectrum considered), in the same way as monophonic sounds and the computational time is linearly dependent on the number of partials recorded in a database. The identification of piano signals is difficult because of the problem of processing polyphonic signals. Depending on the model chosen, a note can be considered as harmonic [J. C. Brown, J. Acoust. Soc. Am. 92, 1394--1402 (1992)] or nonharmonic [Chafe and Jaffe, Proc. ICASSP, Tokyo, 1289--1292 (1986)] and the identification procedure is directly dependent on this model. The new sort procedure developed by the authors allows the sorting of harmonic, nonharmonic, or missing partials of a piano note.