With the advancement of contemporary technology, there is an increasing demand for sophisticated tone libraries in intelligent and digital pianos. This paper introduces a virtual piano system based on timbre simulation. Drawing upon the articulation principles of the piano, a mathematical model is formulated to derive the equation governing string vibrations. This equation facilitates a comprehensive analysis of the components constituting piano timbre and establishes a model for synthesizing these timbres using a frequency envelope algorithm. The short-time Fourier transform (STFT) is utilized to extract features from the synthesized timbre and to accomplish its digital simulation. Subsequently, the integration of the piano’s timbre features with computer programming facilitates the comprehensive design of the virtual piano system. Performance testing and evaluation of the system reveal promising results: the detection rate for each musical piece exceeds 90%, with an average detection rate of 94.81% across ten pieces and an average deviation (Mean-D) of 3.35 in the scoring of 100 music samples. This research contributes to the flexibility in timbre editing, enhances the expressiveness of intelligent and digital pianos, and aims to elevate the music industry to new heights.