In this paper, we first propose a Markov chain-based automatic composition method to construct a song set using classical and traditional music as a sample. Using probability matrices, experiments are conducted to generate pitch and time value sequences, and melodic segments of traditional music are generated using transformation techniques. Secondly, a traditional music digital resource library that integrates multiple functions is constructed by utilizing various information technologies. Finally, based on the existing classification dimensions, the relationship between various types of influencing factors in the inheritance of traditional music was analyzed, and the structure of the questionnaire was initially constructed. The results show that the correlation coefficients between the cultural inheritance of traditional music and its resources, environmental threats, development level, diversified values, public demand, and social cognition are 0.4235, 0.0953, 0.3594, 0.4253, 0.5348, and 0.5224, respectively, and there is a significant positive influence. This paper provides some theoretical and practical guidance for the protection and inheritance of traditional music.