Based on the theory of ordinary differential equations, this paper proposes a stable and discriminative method for piano tone tuning. We perform discriminative training on the hidden Markov tone model according to ordinary differential equations’ feature extraction parameters and model parameters. The model can improve the recognition rate of piano tones. This paper trains and tests the MAPS universal dataset for musical transcription of automatic piano tones. The model is uniformly trained on the synthetic part and tested on the real recording part. The experimental study found that the proposed model has high recognition stability and accuracy in piano tone recognition.