Abstract In this paper, we systematically summarize the chord configuration method in harmonic writing, start from the connection principle of functional harmony, and use the knowledge of harmonic theory to research and explain the harmonic variability writing and chord configuration method. Secondly, based on big data algorithms, it is proposed that according to the chord composition law and progression logic, a chord system construction objective function is proposed, and a dynamic planning algorithm for automatic chord arrangement is designed to realize automatic chord arrangement by machine. Then, after reducing the chord repetition rate of the generated music, it was found that the ideal style type of music could not be achieved. For this problem, a hidden Markov-based chord auto-configuration model is proposed for optimization and experimental analysis of the chord configuration method in harmonic writing is carried out. The results show that the emotional response of the major triad music fragment with an octave decrease in overall pitch is a positive emotion, and the intensity of the emotion is significantly reduced compared to the major triad with no pitch change. The emotional response to the music fragment of the major triad with an octave increase in overall pitch was positive, and the emotional intensity of the major triad with no pitch change was significantly increased. This study improved students’ musical aesthetics, cognitive abilities, and experiences.