Music expresses thoughts and emotions in artistic form and is made up of different components including harmony, rhythm, and melody. Several musical elements are tied together during the songwriting process in order to generate melodies that are harmonic. A music melody is the essential element of any music to generate strong feelings from listeners and capture their interest. In the process of music appreciation, melody controls the emotional changes of music. It is an efficiently perceived part and the tone of a song. In recent years, Sichuan unvoiced music has developed rapidly and attracted much attention. This paper selects Sichuan unvoiced music as the main research theme and constructs a melody generation algorithm by utilizing the state-of-the-art techniques of deep learning (DL) and evolutionary algorithms (EAs) such as recurrent neural network-long short-term memory (RNN-LSTM) and genetic algorithm (GA). Firstly, this paper briefly describes the concept of DL algorithms, the deep generation model, and sequence to sequence model, as they constitute the technological foundation for this research. Secondly, this paper proposes a melody generation algorithm that utilizes RNN-LSTM for melody generation and GA for melody optimization. More specifically, the melody is generated by preprocessing data, creating, and training the RNN-LSTM model. A GA was used to determine the melodic fitness function for eight songs as the fitness function directly affects the selected termination condition. The fitness function can be thought of as either a person or an evolutionary rule. Finally, the average score of these songs, before and after evolution, is calculated, which demonstrates that the analysis and rotation creation methods are more precise and that the song’s average melody score is higher. The method proposed in this study has been thoroughly compared to the existing approaches proposed in earlier studies, and it was found that the approach we propose is more effective in terms of accuracy and the average melody score.