Abstract:A music generation method based on variable neighborhood search and masking effect was proposed to overcome the shortcomings of traditional composing methods, such as high threshold and repeatable work. Compared with the existing music generation model, the proposed method is intuitive to operate and can excavate the consistency of music scores over a long period of time. In the training stage, the time domain waveform files were chosen as the input, which were easy to acquire. The music score was obtained by frequency extraction based on pitch significance and time domain block based on masking effect, and the music parameters were pre-set for training. In the generation stage, the method of combining variable neighborhood search with manual operation was adopted. By adding, deleting, and changing the notes in the music score, the artistic music score was generated according to the section, and the music score was manually modified and locked according to the preference of the operator. Then, the music segments were generated in four sections at a time and combined into a long-lasting music segment. Finally, the music score was perfected at different time scales, and the time domain waveform file was output. The idea of visualization and human-computer interaction throughout the whole process could fully mobilize the enthusiasm of music enthusiasts. Besides, a parametric musical instruments simulation method is proposed to modify the music score or generate a new timbre, in which two parts of parametric simulation of musical instruments and human voice can be carried out through sound source excitation and resonant cavity simulation according to the classification of musical instruments or the process of human voice production.